/* ============================================================================
   PREVIOUSLY — D3 CONVERSION LAYER (#262, 2026-10-21)
   ----------------------------------------------------------------------------
   Shared conversion layer for families opting into the canonical dark theme
   (James brief #262; canonical values: ~/workspace/dark-theme-restore-2026-10-21/
   CANONICAL-THEME.md — the homepage's measured computed theme).

   A page converts with THREE head moves:
     1. <html lang="en" data-theme="d3">
     2. /css/design-tokens-d3.css linked after fonts.css
     3. this file linked after design-tokens-d3.css
   Every rule below is scoped under html[data-theme="d3"]: unconverted pages
   are byte-for-byte unaffected.

   Strategy (mirrors the homepage conversion, home-v2.css L815+): REMAP the
   variables the existing component systems already consume (--desert-*,
   --bible-*, --brand-*, --color-*, --pv-*) to the canonical dark values, so
   components and JS-rendered modules inherit the conversion with zero markup
   changes. Component sheets keep their structure; only the palette flips.
   LIVE is pinned to its family color (coral #F46B62) and is NEVER the accent.
   ========================================================================== */

html[data-theme="d3"]{
  /* ---- desert chain (theme-desert.css / design-tokens.css consumers) ---- */
  --desert-bg:#0C121B; --desert-bg-rgb:12,18,27;
  --desert-card:#141F2C; --desert-card-rgb:20,31,44;
  --desert-pressed:#1B2A3B; --desert-pressed-rgb:27,42,59;
  --desert-ink:#C7D0DA; --desert-ink-rgb:199,208,218;
  --desert-ink-dim:#A4B3C2; --desert-ink-faint:#8FA3B5;
  --desert-rule:#223343;
  --desert-accent:#F2BC68; --desert-accent-rgb:242,188,104;
  --desert-accent-deep:#B07E2E; --desert-accent-deep-rgb:176,126,46;
  --desert-accent-soft:rgba(242,188,104,.12);
  --desert-accent-faint:rgba(242,188,104,.08);
  --desert-accent-ember:#F2BC68;
  --desert-accent-glow:rgba(242,188,104,.35); --desert-accent-glow-lg:rgba(242,188,104,.55);
  --desert-glass:rgba(12,18,27,.92);
  --desert-shadow:rgba(0,0,0,.45); --desert-shadow-rgb:0,0,0;
  --desert-scrim-strong:rgba(12,18,27,.95); --desert-scrim-mid:rgba(12,18,27,.55); --desert-scrim-soft:rgba(12,18,27,.35);
  --desert-win-wash:rgba(242,188,104,.08);

  /* ---- brand chain (drift red retired; gold is the accent) ---- */
  --brand-red:#F2BC68; --brand-red-deep:#B07E2E; --brand-red-rgb:242,188,104; --brand-red-ember:#F2BC68;
  --brand-action:#F2BC68; --brand-bg:#0C121B; --brand-ink:#C7D0DA; --brand-secondary:#A4B3C2;

  /* ---- color chain ---- */
  --color-bg:#0C121B; --color-surface:#141F2C; --color-surface-deep:#0A0F16;
  --color-text:#C7D0DA; --color-text-dim:#A4B3C2; --color-text-faint:#8FA3B5;
  --color-line:#223343; --color-accent:#F2BC68; --color-accent-deep:#B07E2E; --color-on-accent:#0C121B;
  --color-live:#F46B62;

  /* ---- bible chain (mirrors home-v2.css D3 remap, same values) ---- */
  --bible-bg:#0C121B; --bible-card:#141F2C;
  --bible-ink:#C7D0DA; --bible-ink-soft:#A4B3C2; --bible-ink-dim:#8FA3B5;
  --bible-red:#F2BC68; --bible-red-deep:#B07E2E; --bible-rule:#223343;
  --bible-minibar:rgba(12,18,27,.97); --bible-indexbar:rgba(12,18,27,.96); --bible-tabbar:rgba(12,18,27,.97);
  --bible-white:#F9F8F3; --bible-cream:#F9F8F3; --bible-cream-dim:rgba(249,248,243,.82);
  --bible-serif:'Previously Display',Georgia,serif;
  --bible-hero-a:#1B2A3B; --bible-hero-b:#0C121B; --bible-hero-c:#0A0F16; --bible-hero-d:#0A0F16;
  --bible-art-a:#223343; --bible-art-b:#141F2C; --bible-art-c:#0A0F16;

  /* ---- sports pv chain: display face + the LIVE pin ---- */
  --pv-serif:'Previously Display',Georgia,serif;
  --pv-live:#F46B62;
  --font-serif:'Previously Display',Georgia,serif;

  /* ---- d3 display face: the house display stack, not the token's Fraunces.
          (home-v2 makes the same re-point for the homepage via --hp-font-display.
          Scoped to pages that link THIS file only.) ---- */
  --d3-font-display:'Previously Display',Georgia,serif;
}

/* ---- component heals the var remap cannot reach ---- */

/* The masthead dek is a lead paragraph, not a display face: Inter, upright
   (homepage deks/leads are Inter; the serif-italic dek is the retired shell). */
html[data-theme="d3"] .b-scope .b-masthead .b-dek{ font-family:var(--d3-font-ui); font-style:normal; }

/* Bible masthead top bar: the 14px brick slab is retired. The dept band above
   carries the identity; the masthead keeps a single gold rule. */
html[data-theme="d3"] .b-masthead{ border-top:3px solid var(--d3-accent); }

/* ---- body-level desert re-anchor (#262) ----------------------------------
   theme-desert.css defines the whole --desert-* palette ON body (its
   "default theme foundation"). Custom properties resolve from the CLOSEST
   ancestor, so an html-level remap alone cannot reach elements inside body
   on pages that link theme-desert.css — the cream anchors shadow it. This
   block re-anchors the same canonical values at body level, where
   html[data-theme="d3"] body (0,1,2) outranks the desert body rule (0,0,1).
   The homepage never links theme-desert.css, which is why its html-level
   remap sufficed there and the Sports bodies stayed cream. ---- */
html[data-theme="d3"] body{
  font-family: var(--d3-font-ui);
  color-scheme: dark;
  --desert-bg:#0C121B; --desert-bg-rgb:12,18,27;
  --desert-card:#141F2C; --desert-card-rgb:20,31,44;
  --desert-pressed:#1B2A3B; --desert-pressed-rgb:27,42,59;
  --desert-ink:#C7D0DA; --desert-ink-rgb:199,208,218;
  --desert-ink-dim:#A4B3C2; --desert-ink-faint:#8FA3B5;
  --desert-rule:#223343;
  --desert-accent:#F2BC68; --desert-accent-rgb:242,188,104;
  --desert-accent-deep:#B07E2E; --desert-accent-deep-rgb:176,126,46;
  --desert-accent-soft:rgba(242,188,104,.12);
  --desert-accent-faint:rgba(242,188,104,.08);
  --desert-accent-ember:#F2BC68;
  --desert-accent-glow:rgba(242,188,104,.35); --desert-accent-glow-lg:rgba(242,188,104,.55);
  --desert-glass:rgba(12,18,27,.92);
  --desert-shadow:rgba(0,0,0,.45); --desert-shadow-rgb:0,0,0;
  --desert-scrim-strong:rgba(12,18,27,.95); --desert-scrim-mid:rgba(12,18,27,.55); --desert-scrim-soft:rgba(12,18,27,.35);
  --desert-win-wash:rgba(242,188,104,.08);
}

/* ---- Ticket promo band on the sports front (sports.css .pp-promo pairs its
   title color with the surface var — under the flip both would go slate).
   Canonical treatment: slate band, display title, gold kicker + CTA. ---- */
html[data-theme="d3"] .pp-promo{ background:var(--d3-surface-1); border-top:1px solid var(--d3-line); border-bottom:1px solid var(--d3-line); }
html[data-theme="d3"] .pp-promo__title{ color:var(--d3-text); font-family:var(--d3-font-display); }
html[data-theme="d3"] .pp-promo__kicker{ color:var(--d3-accent-text); }
html[data-theme="d3"] .pp-promo__cta{ background:var(--d3-accent); color:var(--d3-on-accent); }
html[data-theme="d3"] .pp-promo__cta:hover, html[data-theme="d3"] .pp-promo__cta:focus-visible{ background:var(--d3-accent-deep); color:#FFFFFF; }

/* #273 (James 2026-10-21): slim one-line Ticket entry, low on the sports front.
   The full Ticket card lives only on /sports/the-ticket/. */
html[data-theme="d3"] .tt-slim { max-width: 1180px; margin: 26px auto 6px; padding: 0 16px; }
html[data-theme="d3"] .tt-slim__link { display: flex; align-items: baseline; gap: 9px; border-top: 1px solid var(--d3-line); padding: 14px 2px 4px; text-decoration: none; }
html[data-theme="d3"] .tt-slim__name { font-family: var(--d3-font-display); letter-spacing: .05em; color: var(--d3-accent); font-size: 15px; white-space: nowrap; }
html[data-theme="d3"] .tt-slim__meta { color: var(--d3-text-2); font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html[data-theme="d3"] .tt-slim__meta::before { content: "\00b7  "; color: var(--d3-text-3); }
html[data-theme="d3"] .tt-slim__go { margin-left: auto; color: var(--d3-accent); font-weight: 700; font-size: 13.5px; white-space: nowrap; }

/* pv-masthead (retired shell, #240 residual) on d3 surfaces: display face for
   the title, Inter upright for the dek — pv-masthead.css itself is untouched
   for the non-sports families that still consume it (#259). */
html[data-theme="d3"] .pv-masthead h1 { font-family: var(--d3-font-display); }
html[data-theme="d3"] .pv-masthead .dek { font-family: var(--d3-font-ui); font-style: normal; }

/* Font-token re-point at :root specificity (ties the token sheet, wins by
   load order on converted pages): the shipped --d3-font-display still names
   Fraunces; the canonical display stack is 'Previously Display' (genuine
   Marathon binary pending #263). Mirrors home-v2.css's local re-point. */
:root[data-theme="d3"] { --d3-font-display: 'Previously Display', 'Inter', sans-serif; }

/* Inverted-band heal: components that painted background:var(--bible-ink)
   (dark in the light theme) invert to light slabs under the remap. Pin them
   to the dark step; their cream text vars already resolve light. */
html[data-theme="d3"] .tt-oddsband, html[data-theme="d3"] .tally { background: var(--d3-surface-2); }
html[data-theme="d3"] .b-ticker, html[data-theme="d3"] .b-odds-pill, html[data-theme="d3"] .b-mocktag { background: var(--d3-surface-2); color: var(--d3-text); }
