/*
 * The Cardigan header, wherever it is included.
 *
 * Until 2026-11-02 these rules lived inline in pages/home.php, so the shared partial
 * (partials/home_header.php) rendered as bare links on any other page. station-search was showing
 * exactly that in production. One stylesheet, loaded by the partial itself.
 *
 * Extracted verbatim from home.php. No token values are declared here on purpose: a page that defines
 * its own :root keeps its own palette, and a page that does not falls back to the literals already
 * written into these rules.
 *
 * Source of truth: this file. Do not add a second copy to a page.
 */

/* ── House faces ────────────────────────────────────────────
   Limerick Serial is a SANS display face, not a serif. Measured 2026-11-12: its cap I
   renders as a plain rectangle (18px wide at top, middle and bottom) where a serif gives
   crossbars (DejaVu Serif: 57 at top against 19 at the stem). It is the site's display face
   and the home page's body face, so the Georgia fallbacks that used to sit at the end of
   every --font-headline stack were turning a sans into a serif whenever the font did not
   load, which is exactly the serif that appeared in the header. Until 2026-11-11 the
   @font-face lived only inside pages/home.php, so every other page that named 'Limerick Serial'
   silently rendered Georgia instead, which is why the Data Integrity page looked like a different
   site. Declared here once, on the stylesheet the shared header already loads, so any page can name
   the family and get the real face. Two weights exist: 400 and 700. */
@font-face{font-family:'Limerick Serial';font-style:normal;font-weight:400;font-display:swap;src:url('/assets/fonts/limerick-serial-regular.ttf') format('truetype')}
@font-face{font-family:'Limerick Serial';font-style:normal;font-weight:700;font-display:swap;src:url('/assets/fonts/limerick-serial-bold.ttf') format('truetype')}

/* ── Header ─────────────────────────────────────────────── */
.home-header{position:sticky;top:0;z-index:9999;height:92px;background:var(--header-bg, rgba(14,23,36,.92));display:flex;align-items:center;justify-content:space-between;padding:0 1.5rem;border-bottom:1px solid var(--header-border, var(--line));backdrop-filter:blur(18px);box-shadow:0 14px 34px rgba(14,23,36,.18);transition:background .2s,border-color .2s}
.home-header::after{content:"";position:absolute;left:0;right:0;bottom:0;height:2px;background:#D4AF37;opacity:.6}
.home-brand{display:flex;align-items:center;gap:12px;color:var(--ink);text-decoration:none;font-size:20px;font-weight:800;font-family:"Inter Tight",system-ui,sans-serif;letter-spacing:-.5px;flex-shrink:0}
.home-brand svg{width:26px;height:26px}
.home-brand svg .ring-1{opacity:0;animation:ring-reveal 1.8s ease-in-out infinite;animation-delay:0s;transform-origin:10px 10px}
.home-brand svg .ring-2{opacity:0;animation:ring-reveal 1.8s ease-in-out infinite;animation-delay:.5s;transform-origin:10px 10px}
.home-brand svg .ring-3{opacity:0;animation:ring-reveal 1.8s ease-in-out infinite;animation-delay:1s;transform-origin:10px 10px}
@keyframes ring-reveal{0%{opacity:0;transform:scale(.3)}20%{opacity:1;transform:scale(1)}70%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(1)}}
.home-brand:hover{color:var(--accent)}
.home-nav{display:flex;align-items:center;gap:0;margin-right:24px}
.home-nav a{color:var(--nav-link, var(--ink-soft));font-size:13px;font-weight:600;text-decoration:none;padding:8px 14px;border-radius:6px;transition:color .15s,background .15s;white-space:nowrap}
.home-nav a:hover{color:var(--nav-link-hover, var(--ink));background:var(--surface-soft)}
.home-nav a.active{color:var(--gold)}
/* The gold in the light palette is #9a7028, which measures 4.03:1 on the cream bar,
   under the 4.5 the text needs. #7a5618 measures 6.01:1. Product pages already used
   this value locally; it lives here so every page gets the same one. */
:root[data-theme="light"] .home-nav a.active{color:#7a5618}
.home-header-actions{display:flex;align-items:center;gap:10px}
.btn-login{padding:8px 20px;border:1px solid var(--line);border-radius:8px;color:var(--ink);font-size:13px;font-weight:600;text-decoration:none;transition:all .15s;position:relative}
.btn-login:hover{border-color:var(--accent);color:var(--accent)}
/* innocuous new-message dot: nothing for a casual visitor to read */
.login-dot{position:absolute;top:5px;right:5px;width:8px;height:8px;border-radius:50%;background:#22c55e;box-shadow:0 0 0 2px var(--header-bg, var(--paper))}
.mobile-nav-sheet a,.footer-link{position:relative}

/* ── Toggle (sliding pill, ACADA pattern) ────────────── */
.theme-toggle{position:relative;display:grid;grid-template-columns:1fr 1fr;width:56px;height:28px;align-items:center;border:1px solid var(--border);border-radius:999px;background:var(--surface);color:var(--ink-soft);cursor:pointer;padding:3px;transition:background .2s,border-color .2s;flex-shrink:0}
.theme-toggle::before{content:"";position:absolute;top:3px;left:3px;width:22px;height:22px;border-radius:50%;background:var(--gold);transition:transform .2s cubic-bezier(.4,0,.2,1);pointer-events:none}
:root[data-theme="dark"] .theme-toggle::before{transform:translateX(0)}
:root[data-theme="light"] .theme-toggle::before{transform:translateX(28px)}
.theme-toggle-option{position:relative;z-index:1;display:grid;place-items:center;color:var(--ink-muted);transition:color .2s}
.theme-toggle-option svg{width:13px;height:13px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
:root[data-theme="dark"] .theme-toggle-option--moon{color:var(--paper)}
:root[data-theme="light"] .theme-toggle-option--sun{color:var(--paper)}
.mobile-menu-btn{display:none;align-items:center;justify-content:center;width:40px;height:40px;background:none;border:1px solid var(--border);border-radius:8px;color:var(--ink);cursor:pointer}

/* ── The mobile menu this header opens ───────────────── */
.mobile-nav-overlay{display:none;position:fixed;inset:0;background:rgba(10,22,40,.85);z-index:2000;backdrop-filter:blur(8px)}
.mobile-nav-overlay.open{display:flex;align-items:center;justify-content:center}
.mobile-nav-sheet{background:var(--paper);border-radius:16px;width:90%;max-width:360px;padding:32px 24px;text-align:left}
.mobile-nav-sheet a{display:block;padding:14px 0;font-size:16px;font-weight:600;color:var(--ink);text-decoration:none;border-bottom:1px solid var(--line)}
.mobile-nav-sheet a:last-child{border-bottom:none}
.mobile-nav-sheet a:hover{color:var(--gold)}
.mobile-nav-close{display:flex;align-items:center;justify-content:center;width:36px;height:36px;background:var(--surface-soft);border:none;border-radius:8px;cursor:pointer;margin-left:auto;margin-bottom:16px}

/* ── Breakpoint the header owns ───────────────────────── */
@media(max-width:768px){
  .home-header{padding:0 16px}
  .home-nav{display:none}
  .mobile-menu-btn{display:flex!important}
}

/* ── A page that draws its own palette ───────────────────
   The dealer page, the listener page and a model front door draw their own canvas and mark
   <body data-theme-locked>. The header still follows the saved theme, through tokens that live
   on the header itself so they never leak into the page underneath (2026-11-09). */
body[data-theme-locked] .home-header{
  --header-bg:rgba(250,243,232,.94);
  /* 2026-11-16: without these two the brand fell through to the near-white default and
     measured white on cream on every theme-locked page. The ink follows the bar. */
  --header-ink:#2d1f14;
  --header-ink-hover:#7a5618;
  --header-border:rgba(45,31,20,.1);
  --nav-link:#6b5040;
  --nav-link-hover:#9a7028;
  --ink:#2d1f14;
  --ink-soft:#475569;
  --line:rgba(45,31,20,.1);
  --surface:#f5ede0;
  --border:rgba(45,31,20,.1);
  --gold:#9a7028;
  --paper:#faf3e8;
}
:root[data-theme="dark"] body[data-theme-locked] .home-header{
  --header-bg:rgba(14,23,36,.92);
  --header-ink:#f8f5ef;
  --header-ink-hover:#ffffff;
  --header-border:rgba(255,255,255,.1);
  --nav-link:#CBD5E1;
  --nav-link-hover:#F8FAFC;
  --ink:#F8FAFC;
  --ink-soft:#CBD5E1;
  --line:rgba(255,255,255,.14);
  --surface:rgba(255,255,255,.06);
  --border:rgba(255,255,255,.16);
  --gold:#EF4444;
  --paper:#0F172A;
}

/* A nav item that reads as a button: Station Research, the one destination in the header that is a
   tool rather than a product story (Jason, 2026-11-10). Gold outline so it stands apart without
   shouting, and it inherits the header's own accent in either theme. */
/* No colour of its own on purpose: the outline is currentColor, so the pill always matches the nav
   link colour whatever palette that header is running (home's dark bar, the product cream bar, the
   engagement pages' forced dark bar). A fixed gold failed on one of them every time. */
.home-nav a.nav-cta{border:1px solid currentColor;border-radius:999px;padding:6px 14px;margin-left:10px;font-weight:700;opacity:.92}
.home-nav a.nav-cta:hover{background:rgba(127,127,127,.18);opacity:1}
.home-nav a.nav-cta.active{background:rgba(127,127,127,.22);opacity:1}
@media (max-width:900px){.home-nav a.nav-cta{display:none}}

/* ══════════════════════════════════════════════════════════════════════════════
   HEADER INK DOES NOT FOLLOW THE THEME, 2026-11-11
   The bar is a fixed dark surface in BOTH themes (rgba(14,23,36,.92)), but its ink was
   var(--ink), which flips to near-black in light mode. That left the brand and the login
   link at 1.12:1 against their own bar, on every page of the site in light mode.
   ══════════════════════════════════════════════════════════════════════════════ */
.home-header .home-brand,
.home-header .home-brand:hover,
.home-header .btn-login,
.home-header .mobile-menu-btn { color: var(--header-ink, #f8f5ef); }
.home-header .btn-login:hover { border-color: var(--header-ink-hover, #a9b6c6); color: var(--header-ink, #ffffff); }
