/* ═══════════════════════════════════════════════════════════════════════════════
   VSG SHARED THEME LAYER                                    /assets/vsg-theme.css
   ─────────────────────────────────────────────────────────────────────────────
   Single source of truth for the VSG palette and every site theme.
   Linked by:  /index.html  ·  /catalogue/index.html  ·  /stones/index.html

   HOW IT WORKS
   Colours are declared as custom properties on :root. Each theme is a
   body[data-theme="…"] block that re-declares a subset of those properties.
   Because <body> is a CLOSER ancestor than :root for every element in the page,
   a value declared on body[data-theme=…] always wins over the :root value —
   regardless of stylesheet source order. That is what lets this file be loaded
   AFTER a page's own stylesheet (e.g. /stones/stones-shared.css) and still
   override its :root palette.

   Corollary, and the one thing to watch: a literal hardcoded hex in a page's
   own CSS (a colour NOT routed through a var) cannot be themed. If a section
   refuses to change theme, that is the reason — route it through a var.

   ADDING A THEME
   1. Add a body[data-theme="your-name"] block here.
   2. Add a matching <option value="your-name"> to the Site Theme select in the
      admin panel in /index.html.
   Nothing else. All three pages pick it up.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── BASE PALETTE (dark / charcoal — the default) ──────────────────────────── */
:root{
  --cream:#F5F0E8;--warm-white:#FAF8F4;--stone:#C8B89A;--stone-dark:#A09070;
  --charcoal:#2A2620;--mid:#6B6358;--gold:#B8963C;--gold-light:#D4AF6A;--black:#1A1714;
  --surface-dark:#1A1714;--surface-dark-alt:#13110d;--surface-dark-alt2:#0f0d0b;
  --surface-nav:rgba(15,13,11,.95);--surface-dark-text:#F5F0E8;
  --surface-card-dark:#111111;--surface-card-img-dark:#141210;--surface-card-dark-hover:#161310;
  --surface-dark-text-secondary:rgba(200,184,154,.82);
  --surface-dark-text-muted:rgba(200,184,154,.80);
  --surface-dark-text-faint:rgba(200,184,154,.5);
  /* Second stop of the .article-cta gradient on /stones/ pages. It used to be a
     literal #231f1a, which meant the CTA block stayed warm-brown under navy. */
  --surface-dark-cta2:#231f1a;
  /* OVERLAY CHROME — the stone modal, the shortlist drawer and the client image
     picker. Deliberately a SEPARATE group from --surface-*: these panels are read
     over a near-black backdrop and their text is var(--cream)/var(--stone-dark),
     which no theme remaps. Flipping them to a light surface would put cream text
     on a cream panel. So the navy themes remap these and LIGHT DOES NOT — see the
     "deliberately not themed" note at the foot of this file. */
  --surface-overlay:#18160f;       /* modal + shortlist drawer body           */
  --surface-overlay-alt:#1f1c18;   /* raised chrome: picker, card placeholder */
  --surface-overlay-deep:#0e0c09;  /* image well behind slab photography      */
}

/* ── LIGHT ─────────────────────────────────────────────────────────────────────
   Flips every dark-brand surface to the warm cream palette. Nav stays dark
   (see the nav overrides below) so the logo and links keep their contrast. */
body[data-theme="light"]{--surface-dark:#F5F0E8;--surface-dark-alt:#EDE8DF;--surface-dark-alt2:#E8E2D8;--surface-nav:rgba(250,248,244,.95);--surface-dark-text:#2A2620;--surface-card-dark:#FAF8F4;--surface-card-img-dark:#EDE8DF;--surface-card-dark-hover:#F0EBE3;--surface-dark-text-secondary:rgba(42,38,32,.85);--surface-dark-text-muted:rgba(42,38,32,.70);--surface-dark-text-faint:rgba(42,38,32,.55);}
/* Light theme: gallery grid — warm gap + lifted cards */
body[data-theme="light"] .stone-grid{gap:8px;}
body[data-theme="light"] .stone-card{box-shadow:0 2px 8px rgba(42,38,32,.07);}
/* Light theme: restore contrast break after gallery — about/why step up to near-white */
body[data-theme="light"] #about{background:#FAF8F4;}
body[data-theme="light"] .about-img-accent{border-color:#FAF8F4;}
body[data-theme="light"] #why{background:#FAF8F4;}
/* Light theme: keep nav dark, logo and links light. .nav-burger is the
   Stone Knowledge page's class name for the same control as .nav-hamburger. */
body[data-theme="light"] nav{background:rgba(15,13,11,.95)!important;border-bottom-color:rgba(200,184,154,.12)!important;}
body[data-theme="light"] .vsg-logo-svg.nav-logo-svg{color:#F5F0E8!important;}
/* :not() exclusions matter — this selector is (0,3,1) with !important, so without
   them it beats .nav-shortlist-btn and .nav-cta and repaints the gold shortlist
   button and the gold Contact CTA as plain stone-coloured nav links. */
body[data-theme="light"] .nav-links a:not(.nav-shortlist-btn):not(.nav-cta){color:rgba(200,184,154,.82)!important;}
body[data-theme="light"] .nav-links a:not(.nav-shortlist-btn):not(.nav-cta):hover{color:#D4AF6A!important;}
body[data-theme="light"] .nav-hamburger span,body[data-theme="light"] .nav-burger span{background:#F5F0E8!important;}

/* ── LIGHT GALLERY VARIANTS ───────────────────────────────────────────────────
   Shared by "dark-light-gallery" and "navy-light-gallery": dark site, warm cream
   gallery section. The [data-theme$="light-gallery"] ends-with selector matches
   both, so these rules are written once. Does NOT match plain "light" — that
   value doesn't end in "light-gallery". Same specificity as an exact = match,
   so cascade behaviour is unchanged. Any future "<name>-light-gallery" theme
   inherits this block automatically.

   On /catalogue/ and /stones/ there is no #gallery section, so these rules are
   inert there and the page correctly renders as its dark or navy base. That is
   intended — the light gallery is a treatment for slab photography, which only
   appears on the main page. */
body[data-theme$="light-gallery"] #gallery{
  --surface-dark-text:#2A2620;
  --surface-dark-text-secondary:rgba(42,38,32,.85);
  --surface-dark-text-muted:rgba(42,38,32,.70);
  --surface-dark-text-faint:rgba(42,38,32,.55);
  --surface-card-dark:#FAF8F4;
  --surface-card-img-dark:#EDE8DF;
  --surface-card-dark-hover:#F0EBE3;
  background:#F5F0E8;
}
body[data-theme$="light-gallery"] .stone-grid{gap:2px;}
body[data-theme$="light-gallery"] .stone-card{box-shadow:0 2px 8px rgba(42,38,32,.07);}
body[data-theme$="light-gallery"] .search-box input{background:rgba(255,255,255,.7);border-color:rgba(42,38,32,.18);}
body[data-theme$="light-gallery"] .filter-btn:not(.active){border-color:rgba(42,38,32,.18);}
body[data-theme$="light-gallery"] .sort-select{border-color:rgba(42,38,32,.18);}
body[data-theme$="light-gallery"] .min-slabs-input{border-color:rgba(42,38,32,.18);}
body[data-theme$="light-gallery"] .finish-pill:not(.active){border-color:rgba(42,38,32,.18);}
body[data-theme$="light-gallery"] .colour-filter-row.style-names .colour-pill:not(.active){border-color:rgba(42,38,32,.18);}
/* Light/light-gallery: live count badge adapts to cream background */
body[data-theme="light"] .live-count-num,body[data-theme$="light-gallery"] .live-count-num{color:#3a7a3a;}
body[data-theme="light"] .live-count-label,body[data-theme$="light-gallery"] .live-count-label{color:rgba(40,90,40,.7);}
body[data-theme="light"] .live-count-badge,body[data-theme$="light-gallery"] .live-count-badge{background:rgba(60,130,60,.06);border-color:rgba(60,130,60,.2);}
/* Light-gallery: restore contrast break — about/why step up to near-white */
body[data-theme$="light-gallery"] #about{background:#FAF8F4;}
body[data-theme$="light-gallery"] .about-img-accent{border-color:#FAF8F4;}
body[data-theme$="light-gallery"] #why{background:#FAF8F4;}

/* "Present Collection" — the button that launches the gallery presentation. It
   sits in the gallery toolbar alongside .filter-btn and .sort-select, so when
   #gallery goes cream it needs the same treatment they get above. It was missed:
   its default var(--gold-light) #D4AF6A on the cream #F5F0E8 gallery background
   is 1.83:1, and its rgba(184,150,60,.4) border is all but invisible. Even the
   darker var(--gold) #B8963C only reaches 2.48:1. #6E5518 gives 5.6:1, which
   clears WCAG AA for this 10px uppercase label.
   NOTE: this restyles the LAUNCH button only. The presentation itself stays
   black under every theme — see the foot of this file. */
body[data-theme="light"] .gp-launch-btn,
body[data-theme$="light-gallery"] .gp-launch-btn{color:#6E5518;border-color:rgba(110,85,24,.45);}
body[data-theme="light"] .gp-launch-btn:hover,
body[data-theme$="light-gallery"] .gp-launch-btn:hover{background:rgba(110,85,24,.10);border-color:#6E5518;}

/* ── NAVY THEMES ──────────────────────────────────────────────────────────────
   NOTE: #0e1b2e / #1a2b45 are approximations of the VSG brand navy, pending the
   exact hex from the brand assets. Changing those two values here updates all
   three pages at once.

   Navy Accent — topbar + nav + footer in navy; body sections stay charcoal. */
body[data-theme="navy-accent"]{--black:#0e1b2e;--surface-nav:rgba(11,21,36,.97);--surface-dark-cta2:#16273d;}
body[data-theme="navy-accent"] footer{background:#0e1b2e;}
/* Overlay chrome follows navy on all three navy themes, including navy-accent:
   the modal and drawer read as part of the nav/footer frame, not as body sections,
   so leaving them warm brown against a navy topbar is the visible mismatch. */
body[data-theme="navy-accent"],
body[data-theme="navy-full"],
body[data-theme="navy-light-gallery"]{--surface-overlay:#101f33;--surface-overlay-alt:#16273d;--surface-overlay-deep:#0a1526;}
/* Navy Full — all dark surfaces navy. "navy-light-gallery" takes the same navy
   base, then the light-gallery block above re-scopes #gallery to cream. Those
   overrides are declared ON #gallery, so they beat these body-level values for
   anything inside the gallery regardless of source order. */
body[data-theme="navy-full"],body[data-theme="navy-light-gallery"]{--black:#0e1b2e;--surface-dark:#1a2b45;--surface-dark-alt:#132138;--surface-dark-alt2:#0e1b2e;--surface-nav:rgba(11,21,36,.97);--surface-card-dark:#0f1e35;--surface-card-img-dark:#0b1828;--surface-card-dark-hover:#122035;--surface-dark-cta2:#16273d;}

/* ── /stones/ pages ───────────────────────────────────────────────────────────
   The Stone Knowledge pages take their base palette from
   /stones/stones-shared.css and use var(--black) for the hero, topbar and
   footer, so navy reaches them through the --black override above with nothing
   extra needed. Light is the exception: it only remaps the --surface-* group,
   which those pages barely use, so the article hero would stay dark while the
   body went cream. Pin it explicitly rather than leave it half-applied. */
body[data-theme="light"] .article-hero,
body[data-theme="light"] .hub-hero{background:#2A2620;}
/* .callout is a mid-tone charcoal panel; under navy it should follow the navy
   mid-tone instead of staying warm brown. */
body[data-theme="navy-full"] .callout,
body[data-theme="navy-light-gallery"] .callout,
body[data-theme="navy-accent"] .callout{background:#1a2b45;}

/* ── DELIBERATELY NOT THEMED ───────────────────────────────────────────────────
   These surfaces keep their literal colours on purpose. If a future change makes
   them "follow the theme", that is a regression, not a fix.

   1. THE PRESENTATION MODES — .sm-ov (per-stone "View Room Scenes") and .gp-ov
      (collection-wide "Present Collection"), plus their .sm-thumbs / .gp-strip
      filmstrips and .gp-header bar. These are full-screen lightboxes, and /?showroom
      runs .gp-ov as an iPad kiosk. A pure-black surround is what lets a customer
      judge the actual colour of a slab: a navy surround pushes the perceived hue of
      warm stone, and a cream one washes out the whites, which for a stone
      wholesaler is a commercial problem, not a cosmetic one. Black in all six
      themes. The one thing that DOES theme is .gp-launch-btn, the button on the
      page that opens the presentation — see the light-gallery block above.

   2. LIGHT THEME LEAVES THE OVERLAY CHROME DARK. --surface-overlay* is remapped by
      the navy themes only. The modal and shortlist drawer are read over a
      rgba(10,8,6,.92) backdrop and their text is var(--cream) / var(--stone-dark),
      neither of which any theme remaps — so a cream panel would mean cream text on
      cream. Making these themeable under Light means first routing every text
      colour inside them through the --surface-dark-text-* group. Worth doing; not
      worth doing halfway.

   3. #adminBar / .admin-panel — staff-only chrome behind the password. Visually
      distinct from the public site is the desired outcome.
   ═══════════════════════════════════════════════════════════════════════════ */
