/* ==========================================================================
   Doina Vin · kit/base.css
   Reset, typography roles, links, focus, container and grid, utilities, reduced motion.
   Requires kit/tokens.css. Class prefix: dvh- (WooCommerce / WordPress mappings in WOO-MAP.md).
   ========================================================================== */

/* ---- Reset ------------------------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + var(--sp-4));
  hanging-punctuation: first last;
}
body {
  min-height: 100vh;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-weight: var(--fw-text);
  font-optical-sizing: auto;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  /* no overflow-x clipping here on purpose: tools/render.py must see real horizontal overflow */
}
img, picture, svg, video, canvas { display: block; max-width: 100%; }
img { height: auto; }
input, button, textarea, select { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled, [aria-disabled="true"] { cursor: not-allowed; }
:where(ul, ol)[role="list"], :where(ul, ol).dvh-plain { list-style: none; padding: 0; }
table { border-collapse: collapse; }
p, h1, h2, h3, h4, h5, h6, li, dd, figcaption { overflow-wrap: break-word; }
[hidden] { display: none !important; }
::selection { background: var(--action); color: var(--on-action); }
dialog { color: inherit; }

/* ---- Typography roles ------------------------------------------------------------------------ */
h1, h2, h3, h4,
.dvh-display, .dvh-h1, .dvh-h1-wine, .dvh-h2, .dvh-h3, .dvh-card-title, .dvh-quote, .dvh-numeral, .dvh-kicker {
  font-family: var(--font-display);
  font-weight: var(--fw-display);
  text-wrap: balance;
}
h1, .dvh-h1 { font-size: var(--fs-h1); line-height: var(--lh-h1); }
h2, .dvh-h2 { font-size: var(--fs-h2); line-height: var(--lh-h2); }
h3, .dvh-h3 { font-size: var(--fs-h3); line-height: var(--lh-h3); font-weight: var(--fw-title); }
h4 { font-size: var(--fs-card); line-height: var(--lh-card); font-weight: var(--fw-title); }

.dvh-display { font-size: var(--fs-display); line-height: var(--lh-display); letter-spacing: var(--track-display); }
.dvh-h1-wine { font-size: var(--fs-h1-wine); line-height: var(--lh-h1-wine); font-weight: var(--fw-title); }
.dvh-card-title { font-size: var(--fs-card); line-height: var(--lh-card); font-weight: var(--fw-title); }
.dvh-quote { font-size: var(--fs-quote); line-height: var(--lh-quote); font-style: italic; }   /* italic = quotes only */
.dvh-numeral { font-size: var(--fs-numeral); line-height: var(--lh-numeral); font-variant-numeric: tabular-nums lining-nums; }
.dvh-kicker { font-size: var(--fs-kicker); line-height: var(--lh-kicker); color: var(--muted); }  /* "(IGP Codru)", "(1875)" */
.dvh-lead { font-size: var(--fs-lead); line-height: var(--lh-lead); max-width: var(--text-measure); text-wrap: pretty; }
.dvh-body, .dvh-prose p { font-size: var(--fs-body); line-height: var(--lh-body); max-width: var(--text-measure); text-wrap: pretty; }
.dvh-ui { font-size: var(--fs-ui); line-height: var(--lh-ui); font-weight: var(--fw-ui); }
.dvh-meta { font-size: var(--fs-meta); line-height: var(--lh-meta); color: var(--muted); }
.dvh-eyebrow {
  font-family: var(--font-text);
  font-size: var(--fs-eyebrow);
  line-height: var(--lh-eyebrow);
  font-weight: var(--fw-strong);
  letter-spacing: var(--track-eyebrow);
  text-transform: uppercase;
  color: var(--muted);
}
.dvh-price, .dvh-price-lg, .price, .woocommerce-Price-amount {
  font-family: var(--font-text);
  font-weight: var(--fw-strong);
  font-variant-numeric: tabular-nums lining-nums;
  white-space: nowrap;
}
.dvh-price { font-size: var(--fs-price); line-height: var(--lh-price); }
.dvh-price-lg { font-size: var(--fs-price-lg); line-height: 1.15; }
.dvh-tnum { font-variant-numeric: tabular-nums lining-nums; }
.dvh-prose > * + * { margin-top: 1em; }
strong, b { font-weight: var(--fw-strong); }

/* ---- Links ------------------------------------------------------------------------------------- */
a { color: var(--link); text-decoration-line: underline; text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:hover { text-decoration-thickness: 2px; }
.dvh-link-quiet { color: inherit; text-decoration: none; }
.dvh-link-quiet:hover { text-decoration: underline; text-decoration-thickness: 1px; }

/* ---- Focus (2 px leaf ring on light grounds; bone ring on --deep and every --house-deep field) -- */
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--ring, var(--focus)); outline-offset: 2px; }
.dvh-on-deep, .dvh-on-house { --ring: var(--focus-on-deep); }
.dvh-on-deep { background: var(--deep); color: var(--on-deep); }
.dvh-on-deep a, .dvh-on-house a { color: inherit; }

/* ---- Layout ------------------------------------------------------------------------------------ */
.dvh-container {
  width: 100%;
  max-width: calc(var(--container) + 2 * var(--page-gutter));
  margin-inline: auto;
  padding-inline: var(--page-gutter);
}
.dvh-container--narrow { max-width: calc(860px + 2 * var(--page-gutter)); }
.dvh-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--col-gap); }
.dvh-grid > * { grid-column: span 12; }   /* phone: every child spans the row */
@media (min-width: 900px) {
  .dvh-grid > .dvh-span-4 { grid-column: span 4; } .dvh-grid > .dvh-span-5 { grid-column: span 5; }
  .dvh-grid > .dvh-span-6 { grid-column: span 6; } .dvh-grid > .dvh-span-7 { grid-column: span 7; }
  .dvh-grid > .dvh-span-8 { grid-column: span 8; }
}
.dvh-section { padding-block: var(--section); }
.dvh-section--tight { padding-block: var(--section-inner); }
.dvh-band { background: var(--band); }
.dvh-surface { background: var(--surface); }
.dvh-ground { background: var(--ground); }

/* flow and clusters */
.dvh-stack > * + * { margin-top: var(--stack, var(--sp-4)); }
.dvh-stack-sm { --stack: var(--sp-2); }
.dvh-stack-lg { --stack: var(--sp-6); }
.dvh-cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--cluster, var(--sp-3)); }
.dvh-split { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-4); }

/* ---- Utilities ---------------------------------------------------------------------------------- */
.dvh-sr, .screen-reader-text {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
.dvh-measure { max-width: var(--text-measure); }
.dvh-muted { color: var(--muted); }
.dvh-nowrap { white-space: nowrap; }
.dvh-clamp-1, .dvh-clamp-2, .dvh-clamp-3 { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.dvh-clamp-1 { -webkit-line-clamp: 1; line-clamp: 1; }
.dvh-clamp-2 { -webkit-line-clamp: 2; line-clamp: 2; }
.dvh-clamp-3 { -webkit-line-clamp: 3; line-clamp: 3; }
.dvh-hairline { border: 0; border-top: 1px solid var(--line); }
.dvh-icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.dvh-icon--sm { width: 16px; height: 16px; }
.dvh-icon--lg { width: 24px; height: 24px; }
.dvh-skip {
  position: absolute; left: var(--sp-4); top: var(--sp-2); z-index: var(--z-toast);
  padding: var(--sp-2) var(--sp-4); background: var(--surface); color: var(--ink); border-radius: var(--radius-control);
  translate: 0 -200%;
}
.dvh-skip:focus-visible { translate: 0 0; }

/* page with a fixed phone buy bar: reserve its height so nothing hides under it (no layout shift) */
@media (max-width: 899.98px) {
  .dvh-has-buybar { padding-bottom: calc(var(--buybar-h) + env(safe-area-inset-bottom, 0px)); }
}

/* ---- Reduced motion: final states, no transforms, no scroll-linked effects ------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    transition-delay: 0s !important;
    scroll-behavior: auto !important;
  }
}
