/* ============================================================
   GoGoVie theme layer. Loaded after public/base/ggv-base.css (the design's
   global rules) and before any section CSS.
   Everything here connects a theme or section setting to the design. With
   every setting at its default the computed result equals the design.
   ============================================================ */

/* ---------- TOKENS FROM SETTINGS ----------
   components/ggv/css-vars.html emits --brand-*, --paper, --surface-2 and
   --line from GoGoVie · Colors on html:root, which beats the :root literals
   in ggv-base.css. The working tokens below were literal copies of the brand
   values in styles.css; pointing them at the brand variables makes them follow
   the settings, and with defaults they resolve to the same hex.
   The hand-tuned shades (--teal-mid, --teal-deep, --teal-200, --orange-lt,
   --orange-ink, ...) and the hexagon SVG data URIs stay literal: they were
   tuned for contrast against these exact brand values (see HANDOVER). */
:root{
  --ink:var(--brand-black);
  --teal:var(--brand-teal);
  --orange:var(--brand-orange);
  --spec-1:var(--brand-orange);
  --spec-2:var(--brand-yellow);
  --spec-3:var(--brand-green);
  --spec-4:var(--brand-teal);
  --spec-5:var(--brand-blue);
  --spec-6:var(--brand-magenta);

  /* Section surfaces and overlays that were literal hex in sections/ggv-* CSS
     (2026-10-23). Same names as htmldesignfixed (docs/html-handoff.md 3),
     same values, so nothing renders differently. */
  --white:#fff;
  --neutral-0:#fbfaf7;
  --neutral-50-c:#f4f2ec;
  --neutral-150:#e4e0da;
  --teal-800:#035862;
  --teal-800-b:#01515c;
  --teal-800-b-rgb:1,81,92;
  --teal-800-c:#005761;
  --green-850:#143a28;
  --red-600:#b3261e;

  /* GoGoVie · Typography. Unset custom fonts fall back to the design's stack. */
  --f-disp:var(--ggv-f-heading,"Century Gothic"),Questrial,"URW Gothic","Muli",Futura,-apple-system,BlinkMacSystemFont,sans-serif;
  --f-ui:var(--ggv-f-body,"Century Gothic"),Questrial,"URW Gothic",-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}

/* body typography. layout/theme.html puts the stock .body0 class on <body>,
   and .body0 (0,1,0) in public/base/index.css sets font-family, size, weight,
   line-height and letter-spacing from the stock typography settings, beating
   the design's body{} (0,0,1). body.body0 (0,1,1) restores the design's values,
   with the size from GoGoVie · Typography (17px / 16.5px when unset). */
body.body0{
  font-family:var(--f-ui);
  font-size:var(--ggv-base-size,17px);
  font-style:normal;
  font-weight:400;
  line-height:1.62;
  letter-spacing:normal;
  word-break:normal;
}
@media (max-width:640px){
  body.body0{font-size:var(--ggv-base-size-mobile,16.5px)}
}

/* stock h1-h6 rules (public/base/index.css, specificity (0,0,1)) set font-size
   from the stock typography settings; the design sets no size on a bare
   heading. Inside GoGoVie sections this puts the browser default back at
   (0,0,1), later in the cascade than stock, and below every design rule that
   sizes a heading by class (.h-md, .poscard-b h3, ...). */
:where(.ggv-sec) :is(h1,h2,h3,h4,h5,h6){font-size:revert}

/* accent font: ggv-base sets no font-family on .headline-accent (it inherits)
   and var(--f-disp) on .serif-it; both fallbacks repeat exactly that */
.headline-accent{font-family:var(--ggv-f-accent,inherit)}
/* "Headline accent colour" (ggv_color_headline_accent). Unset: the design's brand orange. Same (0,1,0)
   as the design rule and loaded after it; the dark-section variants (.teal/.deep/.hero-home, (0,2,0))
   still win, so they keep their light orange. */
.headline-accent{color:var(--ggv-headline-accent,var(--brand-orange))}
.serif-it{font-family:var(--ggv-f-accent,var(--f-disp))}

/* ---------- SECTION CONTRACT (decision D3) ----------
   Root classes come from components/ggv/section-attrs.html.
   Precedence, lowest to highest:
     1 design surface classes (.teal, .surface2, .deep, ...)  specificity (0,1,0)
     2 colour scheme: .ggv-sec.ggv-scheme, only when changed   (0,2,0)
     3 bg_color: .ggv-has-bg, only when the custom pair is off  (0,3,0)
     4 custom pair: .ggv-custom                                (0,3,0)+
   3 and 4 never both match (section-attrs drops ggv-has-bg when the custom
   pair is on), so neither depends on source order (instructions 4.2). */

/* 2. a scheme other than the section's design default paints the section.
   (The default scheme does not paint: the design's own colours, including the
   breakpoint-specific ones, stay exactly as designed.) --color-background /
   --color-text are "r, g, b" triplets from components/theme-css-var.html. */
.ggv-sec.ggv-scheme{
  background-color:rgb(var(--color-background));
  color:rgb(var(--color-text));
}

/* 3. a set Background color overrides the scheme */
.ggv-sec.ggv-sec.ggv-has-bg{background-color:var(--ggv-sbg)}

/* background image, any level */
.ggv-sec.ggv-sec.ggv-has-bgimg{
  background-image:var(--ggv-sbg-img);
  background-position:center;
}
.ggv-sec.ggv-sec.ggv-bgfit-cover{background-size:cover;background-repeat:no-repeat}
.ggv-sec.ggv-sec.ggv-bgfit-contain{background-size:contain;background-repeat:no-repeat}
.ggv-sec.ggv-sec.ggv-bgfit-repeat{background-size:auto;background-repeat:repeat}

/* 4. custom colours: re-skin the section and derive every other surface from
   the pair (instructions 4.4) so it reads whichever way round it is set.
   Text rules in the design reach (0,3,1) at most inside a section; these are
   (0,4,0) and up. Buttons keep the brand fills on purpose. */
.ggv-sec.ggv-sec.ggv-custom{
  --ggv-c-muted:color-mix(in srgb,var(--ggv-cfg) 74%,var(--ggv-cbg));
  --ggv-c-line:color-mix(in srgb,var(--ggv-cbg) 62%,var(--ggv-cfg) 38%);
  --ggv-c-raise:color-mix(in srgb,var(--ggv-cbg) 90%,var(--ggv-cfg) 10%);
  background-color:var(--ggv-cbg);
  color:var(--ggv-cfg);
}
.ggv-sec.ggv-custom.ggv-custom :is(h1,h2,h3,h4,h5,h6,blockquote,figcaption,dt,dd,li,p,.lede,.h-xl,.h-lg,.h-md,.h-sm){color:var(--ggv-cfg)}
.ggv-sec.ggv-custom.ggv-custom :is(.muted,.kicker,.revnote,.railhint){color:var(--ggv-c-muted)}
.ggv-sec.ggv-custom.ggv-custom .tlink{color:var(--ggv-cfg)}
.ggv-sec.ggv-custom.ggv-custom .stitch{border-top-color:var(--ggv-c-line)}

/* custom spacing: off keeps the design's responsive padding untouched */
.ggv-sec.ggv-sec.ggv-pad{padding-top:var(--ggv-pt);padding-bottom:var(--ggv-pb)}
@media (max-width:640px){
  .ggv-sec.ggv-sec.ggv-pad{padding-top:var(--ggv-pt-m);padding-bottom:var(--ggv-pb-m)}
}

/* visibility: the design's own phone / desktop split is 920 / 921px
   (sticky buy bar, accordions open, spec table open) */
@media (max-width:920px){
  .ggv-sec.ggv-hide-mobile{display:none !important}
}
@media (min-width:921px){
  .ggv-sec.ggv-hide-desktop{display:none !important}
}

/* section graphic (baseline "graphic" image), rendered by components/ggv/section-head.html */
.ggv-graphic{display:block;max-width:140px;height:auto;margin-bottom:var(--sp-4)}
.ggv-head-left{display:flex;align-items:flex-start;gap:var(--sp-5)}
.ggv-head-left .ggv-graphic{margin-bottom:0;flex:none}

/* ---------- PRODUCT IMAGES (GoGoVie · Product images) ----------
   ggv-base sets .ptile-img / .gal-main / .gal-thumb backgrounds to
   var(--surface-2) at (0,1,0); this loads later at the same specificity and
   resolves to the same value when the setting is at its default. */
.ptile-img,.gal-main,.gal-thumb{
  background-color:var(--ggv-product-image-bg,var(--surface-2));
  background-image:var(--ggv-product-image-texture,none);
  background-size:var(--ggv-product-image-texture-size,cover);
}
/* ws-art and soon-img (dark tiles) set their own background in section CSS,
   which loads after this file and wins at equal specificity, as in the design */

/* ggv-base.css .plate-mark used url("../gogovie-logo-rev.png"); relative URLs are not
   proven on the asset CDN, so the same file arrives through asset_url() (css-vars.html).
   Same specificity, loaded later. */
.plate-mark{background-image:var(--ggv-asset-logo-rev)}

/* GoGoVie · Product cards "Image fit": contain beats .ptile-img img{object-fit:cover} (0,1,1) with (0,2,1) */
.ptile-img.ggv-fit-contain img{object-fit:contain}
.ptile.ggv-soldout .ptile-img img{opacity:.6}

/* age chart bars: the design set left/width inline from months of 36; ggv/position-item
   passes the months as --ggv-from / --ggv-to and the geometry is computed here */
.agebar i{left:calc(var(--ggv-from,0) * 100% / 36);width:calc((var(--ggv-to,0) - var(--ggv-from,0)) * 100% / 36)}

/* One-pager form (components/ggv/onepager-form.html): the fields sit in one wrapper so
   public/base/ggv-forms.js can show or hide them together; display:contents keeps them direct
   children of the design's .hero-onepager-form / .onepager-form layout. */
.ggv-op-fields{display:contents}

/* In-page jumps (Phase 8). The design needed a data-scroll click handler because its hash router
   owned every "#..." link. On real pages "#apply", "#reviews", "#onepager" are plain anchors the
   browser follows, so the handler is dropped and the smooth motion is CSS. Stock
   public/base/index.css already turns scroll-behavior off for prefers-reduced-motion; this only
   turns it on otherwise. The margin keeps a jumped-to section clear of the sticky header;
   :where() keeps it at (0,1,0) so the design's own scroll-margin rules (.help-body .h-sm) win. */
@media (prefers-reduced-motion: no-preference){html:focus-within{scroll-behavior:smooth}}
:where(#MainContent) [id]{scroll-margin-top:calc(var(--hdr-h) + 16px)}

/* "Built-in icon colour" (ggv_icon_tint, done-point 8). Unset: no ggv-icon-tinted class and no
   --ggv-icon-tint, so every icon keeps the design's own colour (.promo-item svg orange etc.).
   Set: ggv/icon adds ggv-icon-tinted and this wins over those per-place rules ((0,1,1)) at (0,2,0). */
.ggv-icon-tinted.ggv-icon-tinted{color:var(--ggv-icon-tint)}

/* Press feature photos: the stock image component prints a height attribute, and the design rule
   (.press-feature img, aspect-ratio + object-fit) sets no height, so the attribute won and uploaded
   photos rendered at their full height. height:auto hands the box back to aspect-ratio. */
.press-feature img{height:auto}
