/* Mirabelle Farm & Vineyard: shared design system. Page stylesheets add to this; they never restyle the chrome. */

/* Tokens: palette, fonts, type scale, ledger rail, gutters, the one drawn-motion timing. */
:root {
  --ground: #22236B;
  --panel: #292B78;
  --ink: #F0EFFC;
  --accent: #BFCAD8;
  --second: #4847A4;
  --rule: #7F82BC;
  --display: 'Jost', 'Futura', 'Century Gothic', system-ui, sans-serif;
  --text: 'Noto Serif', Georgia, 'Times New Roman', serif;
  --fs-body: 1rem;
  --fs-hl: 1.3125rem;
  --fs-label: 0.95rem;
  --fs-small: 0.9rem;
  --rail: clamp(4.5rem, 22vw, 5.5rem);
  --gut: 0.5rem;
  --pad: 0.875rem;
  --max: 90rem;
  --line: 0.0625rem solid var(--rule);
  --ease: cubic-bezier(0.3, 0.7, 0.2, 1);
  --draw: 0.3s;
  --dashes: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 9l5-2M8 14l5-2' fill='none' stroke='%234847A4' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
}
@media (min-width: 48rem) {
  :root { --fs-body: 1.0625rem; --fs-hl: 1.5rem; --rail: 16%; --gut: clamp(1rem, 3vw, 2.5rem); --pad: clamp(1rem, 1.8vw, 1.5rem); }
}
@media (min-width: 75rem) { :root { --fs-body: 1.125rem; } }

/* Base: the page ground is indigo with the violet dash tile; every text block sits on a solid ground of its own. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--ground) var(--dashes) 0 0 / 1.5rem 1.5rem; color: var(--ink); font: 400 var(--fs-body)/1.6 var(--text); }
h1, h2, h3, p, ul, ol, dl, dd, figure, address { margin: 0; }
ul, ol { padding: 0; list-style: none; }
address { font-style: normal; }
img, video, svg { display: block; max-width: 100%; }
img, video { height: auto; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 0.1875rem solid var(--accent); outline-offset: 0.1875rem; }

/* Width frame: .wrap centres a block inside the patterned gutters (header, main and footer already carry it). */
.wrap { width: min(100% - 2 * var(--gut), var(--max)); margin-inline: auto; }

/* Solid grounds: .solid (indigo) or .panel (lighter indigo) behind any text that is not in a ledger cell. */
.solid, .panel, .opening, .row__body { position: relative; z-index: 0; }
.solid { background: var(--ground); }
.panel { background: var(--panel); }

/* Open space: .gap is an empty patterned band between sections; never put text in it. */
.gap { height: clamp(1.5rem, 5vh, 3.5rem); }

/* Screen-reader text: .vh. Skip link: .skip. */
.vh { position: absolute; width: 0.0625rem; height: 0.0625rem; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: var(--gut); top: -6rem; z-index: 60; padding: 0.75rem 1rem; background: var(--accent); color: var(--ground); font-family: var(--display); }
.skip:focus { top: 0.5rem; }

/* Headlines: h1-h3 or .hl are whole sentences in Jost 400 at 21-24px; wrap only the first word or phrase in <b>. */
h1, h2, h3, .hl { font: 400 var(--fs-hl)/1.25 var(--display); letter-spacing: 0; text-wrap: balance; }
h1 b, h2 b, h3 b, .hl b, h1 strong, h2 strong, h3 strong, .hl strong { font-weight: 650; }
h3 { font-size: 1.3125rem; }

/* Labels: .label is the Noto Serif label for product names, table labels and short facts (never a headline). */
.label { font: 400 var(--fs-label)/1.4 var(--text); }

/* Running text: .prose keeps a readable measure and spaces paragraphs and lists; put a picture beside it on desktop. */
.prose { max-width: 40em; }
.prose > * + * { margin-top: 0.9em; }
.prose > h2, .prose > h3 { margin-top: 1.6em; }
.prose ul { list-style: square; padding-left: 1.2em; }
.prose ol { list-style: decimal; padding-left: 1.4em; }
.prose li + li { margin-top: 0.35em; }

/* Text links: plain <a> inside main, or .link anywhere, get a violet underline; a silver stroke grows over it on hover/focus. */
main a:not([class]), .link, .slip__ask a {
  text-decoration: underline; text-decoration-color: var(--rule); text-decoration-thickness: 0.0625rem; text-underline-offset: 0.22em;
  background: linear-gradient(var(--accent), var(--accent)) 0 100% / 0 0.125rem no-repeat;
  transition: background-size var(--draw) var(--ease);
}
main a:not([class]):hover, main a:not([class]):focus-visible, .link:hover, .link:focus-visible, .slip__ask a:hover, .slip__ask a:focus-visible { background-size: 100% 0.125rem; text-decoration-color: transparent; }

/* Action links and text buttons: .act on <a> or <button> (text only inside) is a 44px tap target; no filled buttons on this site. */
.act {
  display: inline-flex; flex-direction: column; justify-content: center; align-items: stretch; min-height: 2.75rem; max-width: 100%;
  padding: 0.35rem 0; border: 0; background: none; color: inherit; font: inherit; line-height: 1.35; text-align: left; cursor: pointer;
  text-decoration: underline; text-decoration-color: var(--rule); text-decoration-thickness: 0.0625rem; text-underline-offset: 0.22em; overflow-wrap: anywhere;
}
.act::after, .strip__cap::after, .mast__cells a::after {
  content: ""; display: block; height: 0.125rem; background: var(--accent);
  transform: scaleX(0); transform-origin: 0 50%; transition: transform var(--draw) var(--ease);
}
.act:hover, .act:focus-visible { text-decoration-color: transparent; }
.act:hover::after, .act:focus-visible::after { transform: none; }

/* Header: .mast is the two-row ruled table; row one .mast__name (mark + name, home link), row two .mast__cells (numbered cells). */
.mast { background: var(--panel); border: var(--line); border-top: 0; }
.mast__name { display: flex; align-items: center; gap: 0.75rem; min-height: 3.25rem; padding: 0.5rem var(--pad); font: 400 clamp(1.125rem, 1rem + 0.6vw, 1.375rem)/1.2 var(--text); letter-spacing: 0; text-decoration: none; }
.mast__mark { flex: none; width: 2.75rem; height: auto; }
.mast__cells { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); border-top: var(--line); }
.mast__cells li + li { border-left: var(--line); }
.mast__cells a { display: flex; flex-direction: column; justify-content: center; align-items: center; min-height: 3.5rem; padding: 0.4rem 0.25rem; font-size: 0.9375rem; line-height: 1.25; text-align: center; text-decoration: none; }
.mast__num { font: 400 var(--fs-small)/1.2 var(--display); color: var(--accent); }
.mast__cells a::after { width: 1.75rem; margin-top: 0.3rem; }
.mast__cells a:hover::after, .mast__cells a:focus-visible::after, .mast__cells a[aria-current]::after { transform: none; }
.mast__cells a:focus-visible { outline-offset: -0.25rem; }
@media (min-width: 48rem) {
  .mast__cells a { display: grid; grid-template-columns: auto 1fr; column-gap: 0.65rem; align-items: baseline; align-content: center; justify-items: start; min-height: 3.25rem; padding-inline: var(--pad); font-size: 1.0625rem; text-align: left; }
  .mast__cells a::after { grid-column: 2; }
}

/* Page opening: .opening holds the h1; .opening__meta is the line under it (hours text plus an .act link beside or wrapped). */
.opening { padding: clamp(0.75rem, 2.2vh, 1.25rem) var(--pad) clamp(0.5rem, 1.6vh, 1rem); background: var(--ground); border-inline: var(--line); }
.opening__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0 1.5rem; }

/* THE DEVICE, flash contact strip: .strip > .strip__frame (a or figure, style="--w:24") > img + .strip__cap; .strip--short for rows; .strip--scroll scrolls sideways on phones. */
.strip { --strip-h: clamp(11rem, 46vh, 25rem); display: flex; align-items: flex-start; gap: 0.5rem; }
.strip--short { --strip-h: clamp(9rem, 32vh, 17rem); }
.strip__frame { display: block; flex: var(--w, 20) 1 0; min-width: 0; margin: 0; color: inherit; text-decoration: none; }
.strip__frame img, .strip__frame video { width: 100%; height: var(--strip-h); object-fit: cover; }
.strip__cap { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; min-height: 2.75rem; padding: 0.4rem 0.5rem; background: var(--ground); font: 400 1rem/1.3 var(--text); }
.strip__cap::after { width: 2.25rem; margin-top: 0.25rem; }
a.strip__frame:hover .strip__cap::after, a.strip__frame:focus-visible .strip__cap::after, a.strip__frame[aria-current] .strip__cap::after { transform: none; }
a.strip__frame:focus-visible { outline-offset: -0.1875rem; }
@media (max-width: 47.99rem) {
  .strip--scroll { overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .strip--scroll::-webkit-scrollbar { display: none; }
  .strip--scroll .strip__frame { flex: 0 0 calc(var(--w, 20) * 2.9vw); scroll-snap-align: start; }
  .strip { --strip-h: clamp(10rem, 40vh, 17rem); }
  .strip--short { --strip-h: clamp(7.5rem, 26vh, 11rem); }
}

/* Silver band: .band is one line of Jost on solid brushed silver (shelf-price notice, Saturday cell); never over a photo. */
.band { padding: 0.85rem var(--pad); background: var(--accent); color: var(--ground); font: 400 var(--fs-hl)/1.2 var(--display); }
.band :focus-visible, #promo :focus-visible { outline-color: var(--ground); }

/* Ledger: .ledger > .row > .row__label (left rail, 16% / 72-88px on phones) + .row__body (the material); rules between rows, one vertical divider. */
.ledger { border-bottom: var(--line); }
.row { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); border-top: var(--line); }
.row__label { padding: var(--pad) 0.5rem; background: var(--ground); font: 400 var(--fs-label)/1.35 var(--text); overflow-wrap: anywhere; hyphens: auto; }
.row__body { min-width: 0; background: var(--ground); border-left: var(--line); }
.row__body--pad { padding: var(--pad); }
@media (min-width: 48rem) { .row__label { padding-inline: var(--pad); font-size: 1.0625rem; } }

/* Ledger entry: .entry inside .row__body puts picture and text side by side (stacked on phones); .entry--flip moves the picture right. */
.entry { display: grid; gap: var(--pad); padding: var(--pad); }
.entry + .entry { border-top: var(--line); }
.entry__name { font: 400 1.25rem/1.3 var(--text); }
.entry__price { font: 400 var(--fs-hl)/1.2 var(--display); }
@media (min-width: 48rem) {
  .entry { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: start; }
  .entry--flip > :first-child { order: 2; }
}

/* Facts ledger: dl.facts > div > dt + dd; ruled rows at reading size for specs, hours and terms. */
.facts > div { display: grid; grid-template-columns: minmax(6.5rem, 30%) minmax(0, 1fr); gap: 0.25rem 1rem; padding: 0.7rem 0; border-top: var(--line); }
.facts > div:last-child { border-bottom: var(--line); }
.facts dt { color: var(--accent); }

/* Figure and caption: .fig with a straight-cropped img and .fig__cap beneath; .fig--tall (4:5) and .fig--wide (3:2) fix the crop. */
.fig img { width: 100%; object-fit: cover; }
.fig--tall img { aspect-ratio: 4 / 5; }
.fig--wide img { aspect-ratio: 3 / 2; }
.fig__cap { padding: 0.5rem 0; background: var(--ground); font: 400 var(--fs-label)/1.4 var(--text); }

/* Flash spill: .spill on a photo or short text group lays a flat periwinkle blob under its edge; .spill--left throws it the other way. */
.spill { position: relative; }
.spill::before { content: ""; position: absolute; z-index: -1; inset: 18% -1rem -1rem 24%; background: var(--second); border-radius: 62% 38% 46% 54% / 44% 58% 42% 56%; pointer-events: none; }
.spill--left::before { inset: -1rem 30% 22% -1rem; border-radius: 41% 59% 63% 37% / 55% 39% 61% 45%; }

/* Rules: hr.rule is a structural ledger divider; .rule--v is its vertical twin for grid cells. */
.rule { height: 0; margin: 0; border: 0; border-top: var(--line); }
.rule--v { width: 0; height: auto; align-self: stretch; border-top: 0; border-left: var(--line); }

/* Draw-on-scroll (the only reveal): add data-draw (optional delay in ms) to .stroke, or to svg.draw whose shapes carry pathLength="1"; site.js adds .is-drawn. */
.stroke { display: block; height: 0.125rem; background: var(--accent); transform-origin: 0 50%; transition: transform 0.7s var(--ease); }
.stroke--rule { background: var(--rule); }
.js .stroke[data-draw]:not(.is-drawn) { transform: scaleX(0); }
.draw :is(path, line, polyline, rect, circle) { fill: none; stroke: var(--rule); stroke-width: 1.5; stroke-dasharray: 1; stroke-dashoffset: 0; transition: stroke-dashoffset 1.1s var(--ease); }
.js .draw[data-draw]:not(.is-drawn) :is(path, line, polyline, rect, circle) { stroke-dashoffset: 1; }

/* Live hours: put data-hours (site.hours_spec | tojson) on the element printing the hours and an empty .live[data-hours-live] inside; site.js fills it. */
.live { display: block; color: var(--accent); }
.live:empty { display: none; }

/* Footer: .exit is the last screen; .exit__photo (entrance picture) fills it, .exit__col is the vertical visit column at the right. */
.exit { display: grid; margin-top: clamp(1.5rem, 5vh, 3.5rem); border-top: var(--line); }
.exit__photo { position: relative; min-height: 58vw; }
.exit__photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.exit__col { margin-left: var(--rail); padding-bottom: 1rem; background: var(--panel); border-left: var(--line); }
.exit__col > * { padding: 0.7rem var(--pad); }
.exit__col > * + * { border-top: var(--line); }
.exit__col > .vh { padding: 0; }
.exit__name { font-size: 1.125rem; }
.exit__links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1rem; }
.exit__copy { font-size: var(--fs-small); }
@media (min-width: 48rem) {
  .exit { grid-template-columns: minmax(0, 1fr) clamp(18rem, 27vw, 23rem); min-height: min(100vh, 52rem); }
  .exit__photo { min-height: 0; }
  .exit__col { margin-left: 0; }
}

/* Cookie slip: #consent.slip is a narrow slip hung in the flow from the navigation's right end (on phones it keeps to the body column, clear of the rail); the opening moves down by its height. .slip__ask, then two equal ruled rows .slip__row. */
.slip { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); width: min(calc(100% - 2 * var(--gut) - var(--rail)), 19rem); margin: 0 var(--gut) 0 auto; background: var(--panel); border: var(--line); border-top: 0; border-bottom: 0.125rem dashed var(--rule); }
.slip__ask { grid-column: 1 / -1; padding: 0.4rem 0.75rem; font-size: var(--fs-label); line-height: 1.4; }
.slip__row { min-height: 2.75rem; padding: 0.35rem 0.75rem; border: 0; border-top: var(--line); background: none; color: var(--ink); font: 400 var(--fs-label)/1.3 var(--text); text-align: left; cursor: pointer; }
.slip__row + .slip__row { border-left: var(--line); }
.slip__row:hover, .slip__row:focus-visible { background: var(--second); }
.slip__row:focus-visible { outline-offset: -0.25rem; }
@media (min-width: 48rem) {
  .slip { display: block; width: clamp(17rem, 24vw, 21rem); margin: 0 max(var(--gut), calc((100% - var(--max)) / 2)) 0 auto; }
  .slip__row { display: block; width: 100%; }
  .slip__row + .slip__row { border-left: 0; }
}

/* Offer bar: #promo is a solid silver band pinned bottom-left that wipes in from the left edge (.is-in); only present when site.promo is set. */
#promo {
  position: fixed; left: 0; bottom: 0; z-index: 35; display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 1rem;
  max-width: min(100%, 44rem); max-height: 20vh; padding: 0.5rem 0.75rem 0.5rem var(--pad); background: var(--accent); color: var(--ground);
  font: 400 1.0625rem/1.3 var(--display); transform: translateX(-102%); opacity: 0; transition: transform 0.55s var(--ease), opacity 0.2s linear;
}
#promo.is-in { transform: none; opacity: 1; }
#promo p { flex: 1 1 14rem; }
#promo a { display: inline-flex; align-items: center; min-height: 2.75rem; color: inherit; }
#promo button { min-width: 2.75rem; min-height: 2.75rem; padding: 0 0.5rem; border: 0; border-left: 0.0625rem solid var(--ground); background: none; color: inherit; font: inherit; cursor: pointer; }

/* Reduced motion: every stroke, underline and band is shown finished at once. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .js .stroke[data-draw] { transform: none !important; }
  .js .draw[data-draw] :is(path, line, polyline, rect, circle) { stroke-dashoffset: 0 !important; }
}

/* Print: plain ink on white, no pinned pieces. */
@media print {
  body { background: #fff; color: #000; }
  .slip, #promo, .skip { display: none !important; }
  .mast, .exit__col, .row__label, .row__body, .opening, .strip__cap, .fig__cap { background: none; color: #000; }
}

/* A page never scrolls sideways. */
html, body { overflow-x: clip; }
/* Past a full-HD window the whole page grows with the window - type, gaps and pictures
   together - so a very wide screen (or a page zoomed far out) shows the same composition,
   not a small column of text lost in an enormous picture. */
@media (min-width: 1921px) { html { font-size: calc(100vw / 120); } }
/* What can be pressed in the chrome lies above the page: a huge headline's line box reaching
   into the navigation must not swallow the clicks meant for the links. */
header a, header button, nav a, nav button { position: relative; z-index: 2; }
/* A visitor who asked the system for less motion gets none, whatever a page forgot. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
