/* =========================================================
   MAGGIE MODERSOHN — analog / typewriter / dymo-tape system
   ========================================================= */

:root {
  --paper: #fafaf7;
  --paper-dim: #f1f1ec;
  --ink: #211d16;
  --ink-soft: #6b6255;
  --rule: #dedad1;

  --tape-gold: #c7a339;     /* Tommaso I */
  --tape-olive: #5c6b3b;    /* form-note success (kept muted, distinct from Tommaso II's tape) */
  --tape-green: #22c55e;    /* Tommaso II — neon-leaning green */
  --tape-rose: #c08887;     /* Ignazio */
  --tape-rust: #C0022F;     /* Concettina */
  --tape-violet: #3a5f9e;   /* Pippo & Anna — shifted blue */
  --tape-ink: #211d16;      /* wordmark / neutral tape */

  --font-display: 'Special Elite', 'Courier New', monospace;
  --font-mono: 'IBM Plex Mono', 'Courier New', monospace;

  --nav-h: 68px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-mono);
}

body {
  overflow: hidden;
}

@media (max-width: 899px) {
  body { overflow: auto; }
}

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

/* subtle paper grain, applied globally */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 500;
  opacity: 0.045;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* =============== TAPE COMPONENT =============== */
.tape {
  display: inline-block;
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.72rem;
  padding: 0.42em 0.9em;
  color: #f3efe3;
  border-radius: 2px;
  text-shadow:
    0 1px 0 rgba(255,255,255,0.35),
    0 -1px 0 rgba(0,0,0,0.35);
  box-shadow: 0 1px 2px rgba(0,0,0,0.25), inset 0 0 0 1px rgba(0,0,0,0.08);
  white-space: nowrap;
}
.tape--small { font-size: 0.6rem; padding: 0.32em 0.6em; }
.tape--gold   { background: var(--tape-gold); }
.tape--olive  { background: var(--tape-olive); }
.tape--green  { background: var(--tape-green); }
.tape--rose   { background: var(--tape-rose); }
.tape--rust   { background: var(--tape-rust); }
.tape--violet { background: var(--tape-violet); }
.tape--ink    { background: var(--tape-ink); }
.tape--submit {
  background: var(--ink);
  border: none;
  font-size: 0.75rem;
  padding: 0.65em 1.6em;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}
.tape--submit:hover { background: var(--tape-rust); transform: translateY(-1px); }

/* =============== TOP BAR =============== */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(1rem, 3vw, 2.4rem);
  z-index: 200;
}

.wordmark { display: inline-flex; align-items: center; }
.wordmark__img { height: 60px; width: auto; display: block; filter: drop-shadow(0 2px 3px rgba(33,29,22,0.3)); }

.mainnav {
  position: relative;
  display: flex;
  align-items: center;
  gap: clamp(1.1rem, 2.4vw, 2.2rem);
  flex-shrink: 0;
}
/* Language toggle — a small tape chip, not a plain nav link. It carries
   its own opaque background (like every .tape), so unlike the plain nav
   links it never needs the on-photo/off-photo colour-swap logic. */
.lang-toggle {
  font-size: 0.62rem;
  padding: 0.32em 0.7em;
  letter-spacing: 0.12em;
  border: none;
  transition: opacity 0.2s ease, transform 0.15s ease;
}
.lang-toggle:hover { opacity: 0.82; }
.lang-toggle:active { transform: translateY(1px); }
/* Header has no background of its own, so nav colour has to flip explicitly
   depending on which panel is behind it — light over the Home photo, dark
   ink everywhere else. script.js toggles .topbar--on-photo to match the
   section the nav-highlight logic already tracks. */
.mainnav__link {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding: 0.4rem 0.1rem;
  white-space: nowrap;
  transition: color 0.2s ease;
}
.mainnav__link.is-active,
.mainnav__link:hover { color: var(--ink); }

.topbar--on-photo .mainnav__link {
  color: rgba(243,239,227,0.85);
  text-shadow: 0 1px 4px rgba(0,0,0,0.45);
}
.topbar--on-photo .mainnav__link.is-active,
.topbar--on-photo .mainnav__link:hover { color: #fff; }

.mainnav__indicator {
  position: absolute;
  bottom: -2px;
  height: 4px;
  border-radius: 2px;
  background: var(--tape-rust);
  transition: transform 0.35s cubic-bezier(.65,0,.35,1), width 0.35s cubic-bezier(.65,0,.35,1);
  width: 0;
  transform: translateX(0);
}

/* =============== RESPONSIVE NAV (hamburger) =====================
   script.js measures whether #mainnav's natural width actually fits
   next to the logo and toggles .nav-collapsed/.nav-expanded on .topbar
   accordingly — that JS decision is the primary mechanism and wins at
   any viewport width (see the higher-specificity #mainnav override
   below). The bare `max-width: 640px` query further down is only a
   pure-CSS safety net for the brief window before script.js has run,
   or if it fails outright — same idea as the .topbar--on-photo pattern
   already used elsewhere in this file, just width-driven instead of
   scroll-driven. */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
}
.hamburger__bar {
  width: 20px;
  height: 2px;
  background: var(--ink);
  border-radius: 1px;
  transition: transform 0.25s ease, opacity 0.2s ease, background 0.2s ease;
}
.topbar--on-photo .hamburger__bar { background: #f3efe3; }
.hamburger.is-open .hamburger__bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.is-open .hamburger__bar:nth-child(2) { opacity: 0; }
.hamburger.is-open .hamburger__bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Dropdown panel — a child of the fixed .topbar, so it's already
   positioned relative to it with no extra wrapper needed. Opaque dark
   backing (the site's --ink token) since, unlike the header itself,
   this slides down over arbitrary page content and needs to stay
   legible regardless of what's behind it. */
.mobilemenu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--ink);
  box-shadow: 0 12px 24px rgba(0,0,0,0.3);
  padding: 0.5rem clamp(1rem, 3vw, 2.4rem) 1.2rem;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.mobilemenu.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
/* Closed state is kept out of focus/tab order and the accessibility tree
   via the `inert` attribute (toggled instantly in script.js, not through
   a CSS transition) rather than `visibility`/`display` — those transition
   on a delay to let the fade-out finish, which made a just-opened menu's
   first link unfocusable for that same delay since visibility was still
   computing as hidden at the exact moment openMobileMenu() called
   .focus(). `inert` has no such timing gap. */
/* #mainnav is physically moved in here when collapsed (see script.js) —
   restyle it from an inline row to a stacked mobile list. Scoped purely
   by DOM position, not by a modifier class, since where the node
   currently lives already says which layout it needs. */
.mobilemenu .mainnav {
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  width: 100%;
}
.mobilemenu .mainnav__indicator { display: none; }
.mobilemenu .mainnav__link {
  width: 100%;
  padding: 0.9rem 0.1rem;
  font-size: 0.85rem;
  color: rgba(243,239,227,0.85);
  border-bottom: 1px solid rgba(243,239,227,0.12);
}
.mobilemenu .mainnav__link.is-active,
.mobilemenu .mainnav__link:hover { color: #fff; }
.mobilemenu .lang-toggle { margin-top: 0.9rem; }

/* =============== SITE FOOTER (copyright) =============== */
/* Fixed, deliberately faint — mix-blend-mode: difference keeps it at a
   similar low-contrast grey against both the light paper panels and the
   dark photo panels without needing the topbar's on-photo/off-photo
   colour-swap logic. */
.site-footer {
  position: fixed;
  right: clamp(0.8rem, 2.4vw, 1.4rem);
  bottom: 0.6rem;
  z-index: 60;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.05em;
  color: #888;
  mix-blend-mode: difference;
  pointer-events: none;
  user-select: none;
}

/* =============== TRACK / PANELS (desktop = horizontal) =============== */
.track {
  height: 100vh;
  display: flex;
  flex-direction: row;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}
.track::-webkit-scrollbar { display: none; }
.track { scrollbar-width: none; }

.panel {
  position: relative;
  flex: 0 0 100vw;
  width: 100vw;
  height: 100vh;
  scroll-snap-align: start;
  display: flex;
  align-items: center;
  overflow-y: auto;
  padding: calc(var(--nav-h) + 1.5rem) clamp(1.2rem, 6vw, 6rem) 3rem;
}

.eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 0.9rem;
}
.eyebrow--light { color: rgba(241,234,217,0.85); }

.section-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.9rem, 3.4vw, 3rem);
  line-height: 1.15;
  margin: 0 0 1.1rem;
}

.body-copy {
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--ink);
  margin: 0 0 1.1rem;
  max-width: 46ch;
}
.body-copy--narrow { max-width: 40ch; }

/* =============== HOME PANEL =============== */
.panel--home { align-items: flex-start; color: #f3efe3; }
.panel__bg {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center 62%;
  z-index: 0;
}
.panel__scrim {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(20,16,10,0.6) 0%, rgba(20,16,10,0.22) 45%, rgba(20,16,10,0.08) 100%);
  z-index: 1;
}
.home__content { position: relative; z-index: 2; max-width: 1400px; padding-top: 2.5rem; }
.home__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  line-height: 1.08;
  margin: 0 0 1.2rem;
  text-shadow: 0 2px 18px rgba(0,0,0,0.35);
}
@media (min-width: 900px) {
  .home__title { white-space: nowrap; }
}
.home__lede {
  font-size: 1rem;
  line-height: 1.7;
  max-width: 46ch;
  color: rgba(243,239,227,0.92);
  margin: 0 0 1.6rem;
}
/* =============== WINES SUB-NAV (progress within the wines sequence) === */
.wines-subnav {
  position: fixed;
  top: var(--nav-h);
  left: 0; right: 0;
  z-index: 190;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(0.9rem, 2.2vw, 1.8rem);
  padding: 0.6rem clamp(1rem, 3vw, 2.4rem) 1rem;
  background: rgba(20,16,10,0.55);
  backdrop-filter: blur(6px);
  transform: translateY(-100%);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  pointer-events: none;
}
.wines-subnav.is-visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.wines-subnav__item {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: rgba(243,239,227,0.7);
  padding: 0.2rem 0.1rem;
  white-space: nowrap;
  transition: color 0.2s ease;
}
.wines-subnav__item.is-active,
.wines-subnav__item:hover { color: #fff; }
.wines-subnav__item.is-active { font-weight: 700; }

/* =============== WINE PANELS (one per cuvée) =============================
   Full-bleed vineyard photo with a left-to-right scrim; copy sits directly
   on top in light text (kept to one short paragraph, so the scrim alone
   holds enough contrast without needing a card behind it). The bottle
   gets its own small paper-card "shelf" on the right — modest and
   consistent in size, rather than a giant cutout floating on the photo. */
.panel--wine {
  padding: 0;
  color: #f3efe3;
  overflow: hidden;
}
.wine-panel__media {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  z-index: 0;
}
.wine-panel__scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(20,16,10,0.7) 0%, rgba(20,16,10,0.42) 34%, rgba(20,16,10,0.12) 58%);
  z-index: 1;
}
.wine-panel__content {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  height: 100%;
  max-width: 460px;
  padding: calc(var(--nav-h) + 2rem) 0 3rem clamp(1.5rem, 6vw, 6rem);
  border-left: 4px solid var(--wine-accent, transparent);
}
.wine-panel__tag { margin: 0 0 1rem; }
.wine-panel__grapes {
  font-size: 0.85rem;
  color: rgba(243,239,227,0.85);
  margin: 0 0 1.1rem;
  max-width: 40ch;
  text-shadow: 0 1px 5px rgba(0,0,0,0.4);
}
.wine-panel__blurb {
  font-size: 1rem;
  line-height: 1.7;
  color: rgba(243,239,227,0.97);
  max-width: 42ch;
  margin: 0 0 1.8rem;
  text-shadow: 0 1px 6px rgba(0,0,0,0.4);
}
.wine-panel__specs-btn {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,0.5);
  padding-bottom: 3px;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  text-shadow: 0 1px 5px rgba(0,0,0,0.4);
  transition: border-color 0.2s ease, opacity 0.2s ease;
}
.wine-panel__specs-btn:hover { border-color: #fff; opacity: 0.85; }

/* =============== CONTACT PANEL =============== */
.panel--contact { align-items: flex-start; padding-top: calc(var(--nav-h) + 4rem); }
.contact__content {
  display: grid;
  grid-template-columns: minmax(300px, 480px) 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  align-items: stretch;
}
.contact__text { display: flex; flex-direction: column; gap: 1.5rem; max-width: 460px; }
.contact-form { position: relative; display: flex; flex-direction: column; gap: 1rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.contact-form label {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.contact-form label span { color: var(--tape-rust); margin-left: 2px; }
.contact-form input,
.contact-form textarea {
  display: block;
  width: 100%;
  margin-top: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--ink);
  background: var(--paper-dim);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 0.65rem 0.7rem;
  resize: vertical;
}
.contact-form input:focus,
.contact-form textarea:focus {
  outline: 2px solid var(--tape-rust);
  outline-offset: 1px;
}
.form-note {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: var(--ink-soft);
  min-height: 1.2em;
}
.form-note.is-success { color: var(--tape-olive); }
.form-note.is-error { color: var(--tape-rust); }

.contact__image {
  align-self: stretch;
  margin: 0;
  border-radius: 3px;
  overflow: hidden;
  height: 0;
  min-height: 100%;
  box-shadow: 0 10px 30px rgba(33,29,22,0.2);
}
.contact__image img { width: 100%; height: 100%; object-fit: cover; }

/* =============== GALLERY PANEL =============== */
/* Same top-anchored pattern as Contact (see the align-items/padding-top
   note above it) rather than the base .panel's vertical centering — a
   fixed-height grid like this one needs a stable, predictable top edge,
   not one that shifts with content height. */
.panel--gallery { align-items: flex-start; padding-top: calc(var(--nav-h) + 4rem); padding-bottom: 2rem; }
.gallery__content {
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
  width: 100%;
  max-width: 1280px;
  height: 100%;
  margin: 0 auto;
}
.gallery__intro { flex: 0 0 auto; }
.gallery__intro .section-title { margin-bottom: 0.5rem; }

.gallery__grid-wrap { flex: 1 1 auto; min-height: 0; }
.gallery__grid {
  --gcols: 3;
  --grows: 3;
  display: grid;
  grid-template-columns: repeat(var(--gcols), 1fr);
  grid-template-rows: repeat(var(--grows), 1fr);
  gap: clamp(0.6rem, 1.4vw, 1rem);
  height: 100%;
}

.gallery__tile {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: var(--paper-dim);
  box-shadow: 0 3px 10px rgba(33,29,22,0.12);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.gallery__tile:hover,
.gallery__tile:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(33,29,22,0.2);
}
.gallery__tile img,
.gallery__tile video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* Video tiles play inline like a GIF instead of opening the lightbox, so
   they're a plain <div>, not a <button> — drop the button's interactive
   affordances (pointer cursor, hover/focus lift) since there's nothing to
   click here. */
.gallery__tile--video { cursor: default; }
.gallery__tile--video:hover,
.gallery__tile--video:focus-visible {
  transform: none;
  box-shadow: 0 3px 10px rgba(33,29,22,0.12);
}

/* Pagination — dots for direct page access, arrows to step; both share the
   nav indicator's rust accent so the two "current position" cues in the
   UI (main nav tape, gallery page) read as the same language. */
.gallery__pagination {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
}
.gallery__pagination[hidden] { display: none; }
.gallery__arrow {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  border: 1px solid var(--rule);
  border-radius: 50%;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.gallery__arrow:hover { color: var(--ink); border-color: var(--ink-soft); }
.gallery__arrow:disabled { opacity: 0.3; pointer-events: none; }
.gallery__dots { display: flex; align-items: center; gap: 0.5rem; }
.gallery__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--rule);
  transition: background 0.2s ease, transform 0.2s ease;
}
.gallery__dot:hover { background: var(--ink-soft); }
.gallery__dot.is-active { background: var(--tape-rust); transform: scale(1.3); }

/* =============== GALLERY LIGHTBOX =============== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 450;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(10,8,5,0.94);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.lightbox.is-open { opacity: 1; pointer-events: auto; }

.lightbox__stage {
  position: relative;
  max-width: 90vw;
  max-height: 78vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox__stage img,
.lightbox__stage video {
  max-width: 90vw;
  max-height: 78vh;
  width: auto;
  height: auto;
  display: block;
  border-radius: 2px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.lightbox__close,
.lightbox__arrow {
  position: absolute;
  color: rgba(243,239,227,0.85);
  transition: color 0.2s ease, opacity 0.2s ease;
}
.lightbox__close:hover,
.lightbox__arrow:hover { color: #fff; }

.lightbox__close {
  top: 1.2rem;
  right: 1.4rem;
  font-size: 2rem;
  line-height: 1;
  z-index: 2;
}
.lightbox__arrow {
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(243,239,227,0.35);
  border-radius: 50%;
}
.lightbox__arrow:hover { border-color: rgba(243,239,227,0.7); }
.lightbox__arrow--prev { left: clamp(0.8rem, 3vw, 2.5rem); }
.lightbox__arrow--next { right: clamp(0.8rem, 3vw, 2.5rem); }
.lightbox__arrow:disabled { opacity: 0.25; pointer-events: none; }

.lightbox__counter {
  margin-top: 1rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: rgba(243,239,227,0.7);
}

/* Prevents the page behind the lightbox from scrolling while it's open. */
body.is-lightbox-open { overflow: hidden; }

/* =============== OVERLAY (wine detail) =============== */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.2rem;
  background: rgba(20,16,10,0.62);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.overlay.is-open { opacity: 1; pointer-events: auto; }

.overlay__panel {
  position: relative;
  background: var(--paper);
  max-width: 780px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  border-radius: 4px;
  padding: clamp(1.6rem, 4vw, 3rem);
  transform: translateY(14px);
  transition: transform 0.25s ease;
  box-shadow: 0 30px 60px rgba(0,0,0,0.35);
}
.overlay.is-open .overlay__panel { transform: translateY(0); }

.overlay__close {
  position: absolute;
  top: 1rem; right: 1.1rem;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--ink-soft);
}
.overlay__close:hover { color: var(--ink); }

.overlay-header { display: flex; gap: 1.6rem; align-items: flex-start; margin-bottom: 1.6rem; flex-wrap: wrap; }
.overlay-header__bottle { width: 100px; flex: 0 0 auto; }
.overlay-header__bottle img { width: 100%; height: auto; filter: drop-shadow(0 6px 10px rgba(33,29,22,0.22)); }
.overlay-header__name { font-family: var(--font-display); font-size: 1.7rem; margin: 0 0 0.4rem; }
.overlay-header__grapes { font-size: 0.85rem; color: var(--ink-soft); max-width: 46ch; }

.vintage-tabs { display: flex; gap: 0.5rem; margin-bottom: 1.4rem; flex-wrap: wrap; }
.vintage-tab {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  padding: 0.4em 0.9em;
  border: 1px solid var(--rule);
  border-radius: 2px;
  color: var(--ink-soft);
}
.vintage-tab.is-active { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.vintage-detail p { font-size: 0.92rem; line-height: 1.75; margin: 0 0 1rem; }
.vintage-specs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.9rem 1.2rem;
  border-top: 1px dashed var(--rule);
  padding-top: 1.1rem;
  margin-top: 1.2rem;
}
.vintage-specs dt { font-size: 0.62rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 0.2rem; }
.vintage-specs dd { margin: 0; font-size: 0.82rem; }

/* =============== RESPONSIVE: MOBILE = VERTICAL STACK =============== */
@media (max-width: 899px) {
  .track {
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: auto;
    scroll-snap-type: y proximity;
    height: auto;
  }
  .panel {
    width: 100%;
    flex: none;
    height: auto;
    min-height: 100vh;
    scroll-snap-align: start;
    padding: calc(var(--nav-h) + 1.6rem) 1.2rem 3rem;
  }
  .contact__content { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .contact__image { height: 320px; order: -1; }

  /* Below the desktop breakpoint the track is just a normal vertically
     scrolling page (see .track above), so the fixed no-scroll grid isn't
     needed here — the whole point of pagination was to avoid a second
     scroll axis fighting the horizontal track, and that constraint only
     exists on desktop. Mobile shows every thumbnail as a plain flowing
     grid and the page scrolls through it like any other panel. */
  .panel--gallery { padding-top: calc(var(--nav-h) + 1.6rem); }
  .gallery__content { height: auto; }
  .gallery__grid-wrap { min-height: 0; }
  .gallery__grid {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: none;
    height: auto;
  }
  .gallery__tile { aspect-ratio: 4 / 3; height: auto; }
  .gallery__pagination { display: none; }

  .lightbox__arrow { width: 40px; height: 40px; }
  .lightbox__arrow--prev { left: 0.6rem; }
  .lightbox__arrow--next { right: 0.6rem; }
  .lightbox__close { top: 0.8rem; right: 0.9rem; }

  .wines-subnav {
    flex-wrap: wrap;
    row-gap: 0.4rem;
    padding: 0.5rem 1.2rem 0.7rem;
  }
  /* The sub-nav adds its own (wrapping) row below the main header, so
     wine panels need extra top clearance beyond the standard nav-height
     offset every other panel uses. */
  .panel--wine { align-items: flex-start; padding: 0; }
  .wine-panel__content {
    height: auto;
    margin-top: calc(var(--nav-h) + 5.5rem);
    max-width: 100%;
    padding: 0 1.2rem 3rem;
    border-left: none;
    border-top: 4px solid var(--wine-accent, transparent);
  }
}

@media (max-width: 520px) {
  .mainnav { gap: 0.9rem; }
  .mainnav__link { font-size: 0.68rem; }
  .wordmark__img { height: 44px; }
  .wines-subnav__item { font-size: 0.6rem; }
  .lang-toggle { font-size: 0.56rem; padding: 0.28em 0.55em; }
}

/* Pure-CSS hamburger fallback — only matters before script.js has run
   (or if it fails). Once it runs, .topbar carries .nav-collapsed or
   .nav-expanded and the rules right after this block take over at any
   width, per the note above .hamburger. The `.topbar >` child combinator
   here is deliberate, not just belt-and-suspenders: #mainnav is an ID
   selector, so without scoping it to "only while directly inside
   .topbar" it would keep matching (and hiding) #mainnav after script.js
   moves it into #mobileMenu too — which broke focusing the open mobile
   menu's links, since a display:none element can't take focus no matter
   what visibility/inert say. */
@media (max-width: 640px) {
  .topbar > #mainnav { display: none; }
  .hamburger { display: flex; }
}
.topbar.nav-expanded > #mainnav { display: flex; }
.topbar.nav-collapsed .hamburger { display: flex; }
.topbar.nav-expanded .hamburger { display: none; }

/* Wide desktop gets one extra column/row (12 per page instead of 9) —
   gallery.js reads this same 1300px breakpoint to size its pages, so the
   two stay in sync. */
@media (min-width: 1300px) {
  .gallery__grid { --gcols: 4; --grows: 3; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .mainnav__indicator, .overlay, .overlay__panel { transition: none; }
}

/* Visible keyboard focus */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--tape-rust);
  outline-offset: 2px;
}
