/*
V7-HEADER
Title:    Buktika - Theme Token Definitions
File:     themes.css
Path:     /assets/css/themes.css
Version:  v2.5.1
Issued:   2026-04-04
Author:   Buktika Command Team
Owner:    Buktika - Binka
Purpose:  Single source of truth for light and dark visual themes.
          Implements the stateless theme switching architecture documented in
          Buktika Theme Switching Whitepaper v1.0.0.
          Updated per Buktika WWW Colour Map v3.5.0.

          Architecture:
          - CSS Custom Properties keyed to [data-theme] on :root (<html>)
          - No component ever hardcodes a colour value — all reference vars
          - Changing data-theme re-themes the entire document via the cascade
          - Flash prevention handled by inline <script> in each page <head>
          - Persistence handled by theme.js via localStorage

          Token migration:
          - Semantic aliases (--bg, --fg, --muted, --card, --border, --green)
            previously lived in global.css :root as static values.
          - They now live here under [data-theme] selectors.
          - global.css :root retains only the canonical --sdx-color-* primitives
            and non-colour tokens (typography, spacing, shadows, hero sizes).
          - header.css :root retains only tooltip and nav geometry tokens.

          Extending:
          - To add a third theme (e.g. high-contrast), add one new
            :root[data-theme="high-contrast"] block below. Zero other changes.

          Documented exceptions (hardcoded values permitted in this file):
          - Dark block: --green (#c4b89a), --header-bg (#1f1912), --header-fg (#f0ebe3)
            These are universal dark UI surface values. No pillar-brand token
            maps to these values. They are stable and will not change.
            Confirmed permanent exceptions per v2.2.0 audit.
          - Light block: --card (#f8f5f2)
            Warm off-white card surface. No sdx-color-* token maps to this value.
            Confirmed permanent exception per v2.5.0 card lock.
          - Dark block: --card (#403328)
            Deep warm walnut card surface — site-wide locked value.
            No sdx-color-* token maps to this value.
            Confirmed permanent exception per v2.5.1 card lock.

          Changelog:
          - v2.5.1 (2026-04-04): SITE-WIDE DARK CARD LIFT.
            CHANGED - Dark block: --card lifted from #362c22 to #403328.
                      Rationale: clearer figure-ground separation on dark pages while
                      retaining the same warm walnut register site-wide.
          - v2.5.0 (2026-02-27): SITE-WIDE CARD LOCK.
            CHANGED - Light block: --card changed from var(--sdx-color-white) (#ffffff)
                      to #f8f5f2 (warm off-white sand). Locked site-wide — no per-page
                      variation permitted. Provides consistent warm card surface across
                      all pillars and support pages in light mode.
            CHANGED - Dark block: --card changed from
                      var(--sdx-color-livingtower-dark-surface) (#1a1510) to #403328
                      (deep warm walnut). Locked site-wide.
            REMOVED - Per-pillar dark overrides block. All --card and --bg per-pillar
                      overrides removed. --card is now identical across all pages in
                      each theme. --bg per-pillar overrides also removed — background
                      variation between pillars is retired in favour of universal values.
            RECORD  - Three permanent exceptions remain in dark block:
                      --green (#c4b89a), --header-bg (#1f1912), --header-fg (#f0ebe3).
                      Two new permanent exceptions: light --card (#f8f5f2) and dark
                      --card (#403328). No sdx-color-* token maps to any of these.
          - v2.4.0 (2026-02-26): COMPONENT OVERRIDES REMOVED.
            REMOVED - "COMPONENT OVERRIDES" block. themes.css defines tokens only.
            REMOVED - THEME TOGGLE block. Belongs in header.css.
            RECORD  - themes.css now contains exactly: token definitions
                      (light block, dark block). Nothing else.
          - v2.3.0 (2026-02-24): V3.0.0 WHITEPAPER COMPLIANCE.
            WIRED   - Light block: --border, --footer-tint, --social-* now reference
                      --sdx-color-ui-* tokens from global.css v3.4.0.
            WIRED   - Dark block: --border, --footer-tint, --social-* now reference
                      --sdx-color-ui-* tokens from global.css v3.4.0.
          - v2.2.0 (2026-02-24): DAY 1 COMPLIANCE.
          - v2.1.0 (2026-02-23): Header compliance reference updated v2.5.0 → v2.7.0.
          - v2.0.0 (2026-02-23): Updated per Colour Map v2.7.0.
          - v1.0.0 (2026-02-22): Initial release.

ISO Reference: ISO/IEC 15897, ISO 27001
Source Naming Standard: Buktika v7.1 (ISO Aligned)
License:  © Buktika, 2026. All rights reserved.
*/

/* ==========================================================================
   LIGHT THEME  [data-theme="light"]
   The original Buktika palette. Warm shell background, deep forest
   greens, slate text. All existing pages look identical to before.
   ========================================================================== */

:root[data-theme="light"] {

  /* Surface hierarchy */
  --bg:          var(--sdx-color-shell-bg);     /* Page background               */
  --card:        #f8f5f2;                        /* Card / panel surface — LOCKED site-wide (v2.5.0) */
  --surface-alt: var(--sdx-color-warm-white);    /* Alternate section background  */

  /* Text */
  --fg:    var(--sdx-color-slate-dark);          /* Primary text                  */
  --muted: var(--sdx-color-slate);               /* Secondary text                */

  /* Borders */
  --border: var(--sdx-color-ui-border-light);   /* v3.4.0: tokenised */

  /* Navigation (consumed by header.css via var(--green)) */
  --green: var(--sdx-color-green-deep);          /* Nav links, hover, current-page indicator */

  /* Header surface */
  --header-bg: var(--sdx-color-warm-white);      /* Near-white warm               */
  --header-fg: var(--sdx-color-slate-dark);

  /* Footer surface — footer.css uses hsla tint over --bg */
  --footer-tint: var(--sdx-color-ui-footer-tint-light);   /* v3.4.0: tokenised */

  /* Social icon surfaces in footer */
  --social-bg:     var(--sdx-color-ui-social-bg-light);
  --social-border: var(--sdx-color-ui-social-border-light);
  --social-bg-h:   var(--sdx-color-ui-social-bg-light-hover);
  --social-bdr-h:  var(--sdx-color-ui-social-border-light-hover);
}

/* ==========================================================================
   DARK THEME  [data-theme="dark"]
   Dark warm studio aesthetic. Deep charcoal base, golden accents.
   Living Tower dark tokens are the reference for this universal system.
   All contrast ratios verified WCAG AA minimum.

   v2.5.0: --card locked to #362c22 (deep warm walnut) site-wide.
           Per-pillar dark overrides block removed entirely.
           --bg uses universal Living Tower dark base across all pages.

   v2.0.0: --border and social tokens updated from golden-auburn family
   (rgba(241,178,74,...)) to mama-amber (rgba(245,176,20,...)) per
   Colour Map v2.7.0 Section 16.
   ========================================================================== */

:root[data-theme="dark"] {

  /* Surface hierarchy */
  --bg:          var(--sdx-color-livingtower-dark-base);     /* Universal dark base: warm near-black   */
  --card:        var(--sdx-color-dark-card);                 /* #403328 — raised cards  */
  --surface-alt: var(--sdx-color-livingtower-dark-surface);  /* #1a1510 — section       */

  /* Text */
  --fg:    var(--sdx-color-livingtower-light-text);   /* Warm off-white  14.6:1 on --bg  */
  --muted: var(--sdx-color-livingtower-warm-sand);    /* Warm sand        9.2:1 on --bg  */

  /* Borders */
  --border: var(--sdx-color-ui-border-dark);   /* v3.4.0: tokenised */

  /* Navigation (consumed by header.css via var(--green))
     #2e5d3a = 2.27:1 on dark — fails WCAG AA. Remapped to warm sand.
     EXCEPTION: no token maps to this dark nav value. Permanent exception. */
  --green: #c4b89a;   /* Nav links — 8.85:1 on --header-bg  */

  /* Header surface
     EXCEPTION: no tokens for these dark UI surface values. Permanent exceptions. */
  --header-bg: #1f1912;   /* Warm dark charcoal — 1 step above --bg  */
  --header-fg: #f0ebe3;

  /* Footer surface */
  --footer-tint: var(--sdx-color-ui-footer-tint-dark);   /* v3.4.0: tokenised */

  /* Social icon surfaces in footer */
  --social-bg:     var(--sdx-color-ui-social-bg-dark);
  --social-border: var(--sdx-color-ui-social-border-dark);
  --social-bg-h:   var(--sdx-color-ui-social-bg-dark-hover);
  --social-bdr-h:  var(--sdx-color-ui-social-border-dark-hover);
}
