/* ==========================================================================
   Wine Atlas — styles for the Wines page only.

   Loaded ONLY on the page using the Wine Atlas template. Header, footer,
   buttons, eyebrow, wrap and the waitlist section all come from main.css —
   nothing here redefines them.

   The atlas hero is deliberately .vs-atlas-hero, NOT .vs-hero: main.css uses
   .vs-hero for the landing page's phone-mockup hero, and reusing it here
   would restyle the homepage.
   ========================================================================== */

:root {
  --vs-text-faint: #8b7982;
  --vs-line-strong: rgba(28, 18, 22, 0.24);
  --vs-sea: #f2e9dd;        /* parchment, not atlas blue */
  --vs-land: #ddd0c2;
  --vs-land-edge: #c9b8a7;
  --vs-dim: 0.28;           /* opacity of regions filtered out */
  --vs-toolbar-h: 56px;
}

.vs-atlas { scroll-padding-top: calc(var(--vs-header-h) + var(--vs-toolbar-h) + 12px); }

/* The `hidden` attribute is only a UA `display:none`, so any author display
   rule beats it — `.vs-btn { display:inline-flex }` in main.css made the
   hidden "Clear" and "← World" buttons render anyway, and the toolbar
   overflowed on mobile. The script toggles `hidden`, so make it win. */
.vs-atlas [hidden] { display: none !important; }

/* --------------------------------------------------------------- hero */

.vs-atlas-hero { padding-block: clamp(40px, 6vw, 72px) clamp(24px, 3vw, 36px); text-align: center; }
.vs-atlas-hero h1 { font-size: clamp(2.3rem, 5.4vw, 3.6rem); margin-bottom: 18px; }
.vs-atlas-hero h1 em { font-style: italic; color: var(--vs-wine); }
.vs-atlas-hero p {
  max-width: 58ch; margin-inline: auto; margin-bottom: 0;
  color: var(--vs-text-soft); font-size: clamp(1.05rem, 1.6vw, 1.2rem);
}
.vs-atlas-hero .vs-eyebrow::before { display: none; }

/* --------------------------------------------------------------- hub cards */

/* This element also carries .vs-wrap, which centres it with
   `margin-inline: auto`. Never set a `margin` shorthand here — it resets the
   inline margins and the whole card row slams to the left edge while the rest
   of the page stays centred. Same applies to any .vs-wrap partner class. */
.vs-hub {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
  gap: 20px;
  padding-block: clamp(28px, 4vw, 44px);
  margin-inline: auto;
}

.vs-hubcard {
  display: flex; flex-direction: column; padding: 0; text-align: left; cursor: pointer;
  background: var(--vs-surface); border: 1px solid var(--vs-line);
  border-radius: var(--vs-radius-lg); box-shadow: var(--vs-shadow-sm); overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  font-family: inherit; color: inherit;
  /* the fourth card is an <a>, the others are <button> — keep them identical */
  text-decoration: none;
}
.vs-hubcard:hover { transform: translateY(-3px); box-shadow: var(--vs-shadow); }
.vs-hubcard[aria-selected="true"] { border-color: var(--vs-wine); box-shadow: 0 0 0 1px var(--vs-wine), var(--vs-shadow); }

.vs-hubcard__art {
  height: 112px; background: var(--vs-cream-warm); border-bottom: 1px solid var(--vs-line);
  display: grid; place-items: center; overflow: hidden;
}
.vs-hubcard__art svg { width: 100%; height: 100%; }
.vs-hubcard__body { padding: 18px 22px 22px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.vs-hubcard h2 { font-size: 1.12rem; margin: 0; }
.vs-hubcard p { font-size: .9rem; color: var(--vs-text-soft); line-height: 1.5; margin: 0; }
.vs-hubcard__go {
  margin-top: auto; padding-top: 12px; font-size: .84rem; font-weight: 600;
  color: var(--vs-wine); display: inline-flex; align-items: center; gap: 6px;
}
.vs-hubcard__go span:last-child { transition: transform .18s ease; }
.vs-hubcard:hover .vs-hubcard__go span:last-child { transform: translateX(3px); }

.vs-minimap .land { fill: var(--vs-land); }
.vs-minimap .wine { fill: var(--vs-wine-soft); }

.vs-gart { display: flex; flex-wrap: wrap; gap: 5px; padding: 14px; align-content: center; justify-content: center; }
.vs-gart span {
  font-size: .66rem; font-weight: 600; padding: 3px 9px; border-radius: var(--vs-radius-pill);
  background: var(--vs-surface); border: 1px solid var(--vs-line); color: var(--vs-text-soft);
}
.vs-gart span.r { border-color: rgba(107, 20, 53, 0.45); color: var(--vs-wine); }

.vs-rart { display: flex; flex-direction: column; gap: 3px; padding: 12px 18px; width: 100%; }
.vs-rart div { display: flex; justify-content: space-between; font-size: .7rem; color: var(--vs-text-soft); }
.vs-rart b { font-weight: 600; color: var(--vs-text); }

.vs-wart {
  display: grid; place-items: center; width: 100%; height: 100%;
  background: linear-gradient(140deg, var(--vs-wine), var(--vs-wine-deep));
}
.vs-wart svg { width: 42px; height: 42px; color: var(--vs-gold-soft); }

/* --------------------------------------------------------------- toolbar */

.vs-toolbar {
  position: sticky;
  top: var(--vs-header-h);
  z-index: 40;
  background: rgba(251, 247, 242, 0.93);
  backdrop-filter: saturate(150%) blur(10px);
  border-block: 1px solid var(--vs-line);
  padding-block: 11px;
}
.vs-toolbar__in { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

/* flex:1 + min-width:0 lets this shrink under its content, and flex items do
   not clip — so long breadcrumbs used to spill across the filter. Wrap. */
.vs-crumbs {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: 4px 7px; font-size: .88rem; flex: 1 1 auto; min-width: 0;
}
.vs-crumbs button {
  background: none; border: 0; padding: 4px 2px; cursor: pointer; font: inherit;
  color: var(--vs-wine); font-weight: 600;
  text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px;
}
.vs-crumbs button:hover { color: var(--vs-wine-soft); }
.vs-crumbs .sep { color: var(--vs-text-faint); }
.vs-crumbs .cur { color: var(--vs-text); font-weight: 600; }

.vs-filter { display: flex; align-items: center; gap: 9px; }
.vs-filter label { font-size: .82rem; font-weight: 600; color: var(--vs-text-soft); white-space: nowrap; }
.vs-filter select {
  font: inherit; font-size: .9rem; padding: 8px 14px;
  border-radius: var(--vs-radius-pill); border: 1px solid var(--vs-line-strong);
  background: var(--vs-surface); color: var(--vs-text); cursor: pointer; max-width: 240px;
}
.vs-filter select:hover { border-color: var(--vs-wine); }

@media (max-width: 720px) {
  /* the toolbar is two rows here, so anchor jumps need the taller offset */
  :root { --vs-toolbar-h: 98px; }
  .vs-toolbar__in { flex-direction: column; align-items: stretch; gap: 10px; }
  .vs-filter { justify-content: space-between; }
  .vs-filter select { flex: 1 1 auto; max-width: none; }
}

/* --------------------------------------------------------------- explorer */

.vs-explorer { padding-block: clamp(22px, 3vw, 34px) clamp(44px, 6vw, 76px); }

.vs-split {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: clamp(18px, 2.4vw, 30px);
  align-items: start;
}
@media (max-width: 980px) { .vs-split { grid-template-columns: 1fr; } }
@media (min-width: 981px) {
  /* the region list outruns the map, so pin the map while the list scrolls */
  .vs-split__map { position: sticky; top: calc(var(--vs-header-h) + var(--vs-toolbar-h) + 16px); }
}

.vs-mapcard {
  background: var(--vs-sea); border: 1px solid var(--vs-line);
  border-radius: var(--vs-radius-lg); overflow: hidden; position: relative;
}
.vs-mapcard svg { display: block; width: 100%; height: auto; max-width: 100%; }

.vs-maphead {
  position: absolute; top: 14px; left: 16px; right: 16px;
  display: flex; justify-content: space-between; align-items: flex-start; gap: 10px;
  pointer-events: none;
}
.vs-maptitle {
  font-family: var(--vs-font-display); font-size: .97rem; font-weight: 600;
  background: rgba(255, 255, 255, 0.9); padding: 5px 13px;
  border-radius: var(--vs-radius-pill); border: 1px solid var(--vs-line); backdrop-filter: blur(6px);
}
.vs-maphead .vs-btn { pointer-events: auto; background: var(--vs-surface); }

.vs-mapcard .c-land { fill: var(--vs-land); stroke: var(--vs-land-edge); stroke-width: .4; }
.vs-mapcard .c-wine {
  fill: var(--vs-wine-soft); stroke: var(--vs-sea); stroke-width: .5;
  cursor: pointer; transition: fill .2s ease, opacity .2s ease;
}
.vs-mapcard .c-wine:hover { fill: var(--vs-wine); }
.vs-mapcard .c-wine.dimmed, .vs-mapcard .pin.dimmed { opacity: var(--vs-dim); }
.vs-mapcard .country-outline { fill: var(--vs-land); stroke: var(--vs-land-edge); stroke-width: 1; }

.vs-mapcard .pin { cursor: pointer; }
.vs-mapcard .pin circle.dot { fill: var(--vs-wine); stroke: #fff; stroke-width: 2; transition: r .18s ease; }
.vs-mapcard .pin:hover circle.dot, .vs-mapcard .pin:focus-visible circle.dot { r: 11; }
.vs-mapcard .pin.active circle.dot { fill: var(--vs-gold); stroke: var(--vs-wine-deep); }
.vs-mapcard .pin text.num { fill: #fff; font: 700 11px var(--vs-font-body); text-anchor: middle; pointer-events: none; }
.vs-mapcard .pin text.lbl {
  fill: var(--vs-text); font: 600 12.5px var(--vs-font-body);
  paint-order: stroke; stroke: var(--vs-sea); stroke-width: 3.5px; stroke-linejoin: round;
  pointer-events: none;
}
.vs-mapcard .pin .leader { stroke: var(--vs-wine); stroke-width: 1; opacity: .55; pointer-events: none; }

.vs-legend {
  display: flex; flex-wrap: wrap; gap: 16px; padding: 11px 18px;
  border-top: 1px solid var(--vs-line); background: rgba(255, 255, 255, 0.7);
  font-size: .78rem; color: var(--vs-text-soft);
}
.vs-legend i { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* --------------------------------------------------------------- panel */

.vs-panel {
  background: var(--vs-surface); border: 1px solid var(--vs-line);
  border-radius: var(--vs-radius-lg); padding: clamp(20px, 2.4vw, 28px);
  box-shadow: var(--vs-shadow-sm);
}
.vs-panel__kicker {
  font-size: .73rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--vs-wine-soft); margin-bottom: 8px;
}
.vs-panel h2 { font-size: clamp(1.6rem, 2.7vw, 2.05rem); margin-bottom: 6px; }
.vs-panel__tag { font-family: var(--vs-font-display); font-style: italic; font-size: 1.06rem; color: var(--vs-text-soft); margin-bottom: 18px; }
.vs-panel__intro { font-size: .96rem; color: var(--vs-text-soft); margin-bottom: 22px; }

.vs-meta { display: grid; gap: 11px; margin-bottom: 24px; }
.vs-meta div { display: grid; grid-template-columns: 80px 1fr; gap: 12px; font-size: .88rem; align-items: start; }
.vs-meta .k { font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--vs-text-faint); padding-top: 3px; }
.vs-meta .v { color: var(--vs-text-soft); }

.vs-sec { margin-bottom: 24px; }
.vs-sec:last-child { margin-bottom: 0; }
.vs-sec h3 {
  font-family: var(--vs-font-body); font-size: .73rem; font-weight: 700;
  letter-spacing: .13em; text-transform: uppercase; color: var(--vs-text-faint);
  margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--vs-line);
}

.vs-grapes { display: flex; flex-direction: column; gap: 2px; }
.vs-graperow {
  display: grid; grid-template-columns: 9px 1fr auto; gap: 12px; align-items: baseline;
  width: 100%; text-align: left; background: none; border: 0; font: inherit; color: inherit;
  padding: 9px 8px; border-radius: 10px; cursor: pointer;
}
.vs-graperow:hover { background: var(--vs-cream-warm); }
.vs-graperow.hit { background: rgba(200, 155, 60, 0.24); }
.vs-swatch { width: 9px; height: 9px; border-radius: 50%; align-self: center; display: inline-block; }
.vs-swatch.red { background: var(--vs-wine); }
.vs-swatch.white { background: var(--vs-gold); }
.vs-graperow b { font-size: .94rem; font-weight: 600; display: block; }
.vs-graperow small { font-size: .79rem; color: var(--vs-text-faint); display: block; line-height: 1.45; }

.vs-styles { display: flex; flex-direction: column; gap: 14px; }
.vs-style b { font-size: .93rem; display: block; margin-bottom: 2px; }
.vs-style p { font-size: .86rem; color: var(--vs-text-soft); line-height: 1.55; margin: 0; }

.vs-facts { display: flex; flex-direction: column; gap: 12px; }
.vs-fact { font-size: .86rem; color: var(--vs-text-soft); line-height: 1.55; padding-left: 15px; border-left: 2px solid var(--vs-gold); margin: 0; }

.vs-tryline {
  margin-top: 20px; padding: 14px 16px; background: var(--vs-cream-warm);
  border-radius: var(--vs-radius); font-size: .88rem; color: var(--vs-text-soft);
}
.vs-tryline b { color: var(--vs-text); font-weight: 600; }

/* --------------------------------------------------------------- list rows */

.vs-rgrid { display: grid; gap: 10px; }
.vs-rbtn {
  display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center;
  width: 100%; text-align: left; cursor: pointer; padding: 13px 16px; font: inherit; color: inherit;
  border-radius: var(--vs-radius); background: var(--vs-surface); border: 1px solid var(--vs-line);
  transition: border-color .16s ease, transform .16s ease;
}
.vs-rbtn:hover { border-color: var(--vs-wine); transform: translateX(2px); }
.vs-rbtn.dimmed { opacity: .4; }
.vs-rbtn b { font-size: .96rem; font-weight: 600; display: block; }
.vs-rbtn small { font-size: .79rem; color: var(--vs-text-faint); }
.vs-rbtn .badge {
  font-size: .69rem; font-weight: 700; padding: 3px 10px; border-radius: var(--vs-radius-pill);
  background: rgba(200, 155, 60, 0.26); color: var(--vs-text); white-space: nowrap;
}

/* --------------------------------------------------------------- grapes */

.vs-gidx { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(265px, 100%), 1fr)); gap: 16px; }
.vs-gcard {
  background: var(--vs-surface); border: 1px solid var(--vs-line);
  border-radius: var(--vs-radius); padding: 18px 20px;
  display: flex; flex-direction: column; gap: 8px;
}
.vs-gcard__top {
  display: flex; align-items: center; gap: 10px; background: none; border: 0;
  padding: 0; cursor: pointer; text-align: left; width: 100%; font: inherit; color: inherit;
}
.vs-gcard__top:hover h3 { color: var(--vs-wine); }
.vs-gcard h3 { font-size: 1.02rem; margin: 0; }
.vs-gcard p { font-size: .86rem; color: var(--vs-text-soft); line-height: 1.5; margin: 0; }
.vs-gcard__spec { display: flex; gap: 11px; flex-wrap: wrap; font-size: .73rem; color: var(--vs-text-faint); font-variant-numeric: tabular-nums; }
.vs-gcard__spec b { color: var(--vs-text-soft); font-weight: 600; }
.vs-gcard__regions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 8px; }
.vs-gcard__regions button {
  font-size: .74rem; font-weight: 600; padding: 4px 11px; border-radius: var(--vs-radius-pill);
  cursor: pointer; font-family: inherit;
  background: var(--vs-cream-warm); border: 1px solid var(--vs-line); color: var(--vs-text-soft);
}
.vs-gcard__regions button:hover { border-color: var(--vs-wine); color: var(--vs-wine); }

.vs-gdetail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 340px); gap: clamp(20px, 2.6vw, 34px); align-items: start; }
@media (max-width: 900px) { .vs-gdetail { grid-template-columns: 1fr; } }

.vs-gd__badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .73rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  padding: 5px 13px; border-radius: var(--vs-radius-pill);
  background: var(--vs-cream-warm); border: 1px solid var(--vs-line); color: var(--vs-text-soft);
  margin-bottom: 14px;
}
.vs-gd__hero h2 { font-size: clamp(2.1rem, 4.4vw, 3rem); margin-bottom: 8px; }
.vs-gd__origin { font-size: .92rem; color: var(--vs-text-faint); margin-bottom: 18px; }
.vs-gd__origin b { color: var(--vs-text-soft); font-weight: 600; }
.vs-gd__note {
  font-family: var(--vs-font-display); font-size: clamp(1.1rem, 1.9vw, 1.32rem);
  line-height: 1.45; color: var(--vs-text-soft); margin-bottom: 28px; max-width: 42ch;
}

.vs-specs {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(134px, 100%), 1fr));
  gap: 1px; background: var(--vs-line); border: 1px solid var(--vs-line);
  border-radius: var(--vs-radius); overflow: hidden; margin-bottom: 28px;
}
.vs-spec { background: var(--vs-surface); padding: 14px 16px; }
.vs-spec .k { display: block; font-size: .66rem; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; color: var(--vs-text-faint); margin-bottom: 5px; }
.vs-spec .v { font-size: .94rem; font-weight: 600; font-variant-numeric: tabular-nums; }

.vs-pairings { display: flex; flex-direction: column; gap: 8px; }
.vs-pairing { display: flex; align-items: baseline; gap: 10px; font-size: .9rem; color: var(--vs-text-soft); }
.vs-pairing::before { content: ""; flex: none; width: 5px; height: 5px; border-radius: 50%; background: var(--vs-gold); transform: translateY(-2px); }

.vs-backlink {
  background: none; border: 0; padding: 0; cursor: pointer; color: var(--vs-wine); font: inherit;
  font-size: .88rem; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; margin-bottom: 20px;
}
.vs-backlink:hover { color: var(--vs-wine-soft); }

.vs-subhead { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.vs-subhead h2 { font-size: clamp(1.5rem, 2.7vw, 1.9rem); }
.vs-subhead p { font-size: .9rem; color: var(--vs-text-soft); margin: 0; }

/* --------------------------------------------------------------- misc */

.vs-protonote {
  display: flex; gap: 10px; align-items: flex-start;
  max-width: 760px; margin: 26px auto 0; padding: 13px 16px;
  background: #fdf4e3; border: 1px solid rgba(200, 155, 60, 0.45);
  border-radius: var(--vs-radius);
  font-size: .86rem; color: var(--vs-text-soft); line-height: 1.5; text-align: left;
}
.vs-protonote b { color: var(--vs-text); }

.vs-footer__source { margin-top: 10px; font-size: .78rem; color: rgba(255, 255, 255, 0.34); max-width: 70ch; }

/* Server-rendered content is visible before the script upgrades the page, so
   the atlas is readable (and indexable) without JavaScript. */
.vs-atlas-noscript { padding-block: clamp(22px, 3vw, 34px); }
.js .vs-atlas-noscript { display: none; }
.js .vs-atlas-enhanced { display: block; }
.vs-atlas-enhanced { display: none; }
