/*
 * shared/theme.css — EVERY colour the public pages use, in one place.
 *
 * Loaded first by every generated page (crossing, coming-soon, county, homepage), before the
 * page's own stylesheets, which refer to these names and never to a colour directly. Change the
 * look of the site here and nowhere else.
 *
 * The look (2026-11 rebrand, "Seaside"): warm sand ground, white cards, one sea blue for the
 * brand, and the barrier states as soft tints — red, amber and green are reserved for the
 * barrier and never used for anything else. The design system that describes it, and the
 * decisions behind it, is linked from CLAUDE.md ("The design system").
 *
 * TWO LAYERS (2026-11-25, Rich):
 *   1. THE PALETTE: every solid colour the site uses, once, in six families (sand, slate, sea,
 *      red, amber, green): 29 colours. A new colour is added here only if no palette colour will
 *      do. Three near-duplicates were folded in on 2026-11-25 (the road line, the coming-soon pin
 *      and the closing-soon stripes); keep it from growing back.
 *   2. THE JOBS: the --rc-* names. Each says what a colour is FOR and points at the palette, so
 *      one job can change without touching the others. Stylesheets and code use only these.
 *      See-through values stay written out (rgba), each noting the palette colour it thins.
 *
 * Also read from code (each resolves var() through the palette):
 *   - shared/home.js reads the --rc-pin-* and --rc-map-* values for the homepage map, which
 *     MapLibre draws itself and CSS cannot reach.
 *   - scripts/build-crossings.js reads --rc-browser-bar and --rc-app-splash into each page's
 *     <meta name="theme-color"> and the web-app manifests, which cannot refer to CSS.
 *   - scripts/render-local-maps.mjs reads the map and text colours for the local map pictures.
 *
 * NOT here, on purpose:
 *   - The observer app (portslade/observe/) has its own look in observe.css. It shares
 *     closure-card.css, which falls back to the observer's dark values when this file is absent.
 *   - The live train map (/map/) has its own light and dark tokens in map/map.css.
 *   - The logo (shared/icon.svg) and the app icons are artwork, drawn in their own files.
 */
@font-face{font-family:'Schibsted Grotesk';font-style:normal;font-weight:400 900;font-display:swap;
  src:url(fonts/schibsted-grotesk-latin.woff2) format('woff2');
  unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:'Schibsted Grotesk';font-style:normal;font-weight:400 900;font-display:swap;
  src:url(fonts/schibsted-grotesk-latin-ext.woff2) format('woff2');
  unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C4,U+2113,U+2C60-2C7F,U+A720-A7FF}

:root{
  /* type: Schibsted Grotesk, served from shared/fonts (SIL Open Font Licence, OFL.txt beside it) */
  --rc-font:'Schibsted Grotesk',-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,system-ui,sans-serif;

  /* ==== 1. THE PALETTE ===================================================================== */
  /* sand: warm neutrals (page, cards, lines, the barrier drawing) */
  --white:#FFFFFF;
  --sand-50:#FBF7F0;
  --sand-100:#F3ECE0;
  --sand-200:#ECE3D4;
  --sand-300:#DDD2BF;
  --sand-400:#C9BFAE;
  --sand-600:#A39A8B;
  --sand-700:#8A8170;
  /* slate: text */
  --slate-500:#6A717A;
  --slate-600:#4F5966;
  --slate-700:#36404C;
  --slate-900:#1D2733;
  /* sea: the brand (plus the you-are-here cyan and the map's own ground) */
  --sea-50:#DCEEF2;
  --sea-100:#CFE4EA;
  --sea-700:#0B5C78;
  --sea-800:#084A61;
  --cyan-600:#0891B2;
  --map-ground:#F1F2EE;
  /* red: barriers down */
  --red-100:#FBE2DF;
  --red-600:#DC2626;
  --red-800:#991B1B;
  /* amber: closing soon */
  --amber-100:#FDF0CF;
  --amber-500:#F59E0B;
  --amber-700:#B45309;
  --amber-900:#7C3F06;
  /* green: crossing clear */
  --green-100:#E2F4E7;
  --green-600:#16A34A;
  --green-700:#15803D;
  --green-900:#14532D;

  /* ==== 2. THE JOBS ======================================================================== */
  /* page */
  --rc-bg:var(--sand-50);               /* page ground: sand */
  --rc-panel:var(--white);              /* menu drawer, search results, pop-ups */
  --rc-surface:var(--white);            /* cards and sections */
  --rc-line:var(--sand-300);            /* borders on buttons, pills and inputs */
  --rc-line-soft:var(--sand-200);       /* hairlines between rows, card edges, picture frames */
  --rc-press:var(--sand-100);           /* background of a button or row while pressed */
  --rc-text:var(--slate-900);           /* main text */
  --rc-text-2:var(--slate-700);         /* body copy and secondary values */
  --rc-dim:var(--slate-600);            /* labels and captions */
  --rc-faint:var(--slate-500);          /* the quietest text (4.6:1 on sand) */
  --rc-fainter:var(--slate-500);        /* footer small print */
  --rc-strong:var(--slate-900);         /* emphasis inside a note */
  --rc-color-scheme:light;              /* form controls and scrollbars */

  /* the sea-blue header panel at the top of every page */
  --rc-hero:var(--sea-700);
  --rc-on-hero:var(--sand-50);
  --rc-on-hero-dim:var(--sea-50);       /* the line under a title in the header */
  --rc-hero-line:rgba(251,247,240,.55);   /* sand-50 at 55%: outline buttons in the header */
  --rc-status-idle:rgba(251,247,240,.14); /* sand-50 at 14%: the status box before there is data */
  --rc-hero-press:rgba(251,247,240,.14);  /* sand-50 at 14%: a header button while pressed */

  /* brand */
  --rc-accent:var(--sea-700);           /* sea blue: buttons, live pins, focus rings */
  --rc-accent-press:var(--sea-800);
  --rc-on-accent:var(--white);
  --rc-link:var(--sea-700);             /* links inside copy */
  --rc-info:var(--sea-700);             /* a train's position; the share icon in Add as app */
  --rc-warn:var(--amber-700);           /* warnings and "your guess" highlights (amber, dark enough to read) */
  --rc-donate:var(--sea-50);            /* Support on GoFundMe: sea glass, not yellow (amber means closing soon) */
  --rc-donate-press:var(--sea-100);
  --rc-on-donate:var(--sea-700);

  /* tags and pills */
  --rc-pill-bg:var(--sand-100);         /* "In 8 min" */
  --rc-pill-ink:var(--slate-700);
  --rc-tag-bg:var(--sea-50);            /* "Coming soon", "Live" and similar badges */
  --rc-tag-ink:var(--sea-700);
  --rc-soon-stripe:rgba(29,39,51,.035);   /* slate-900 at 3.5%: the faint hatching on a coming-soon row */

  /* barrier status box: soft tints, dark text (no glow on a light page) */
  --rc-closed:var(--red-100);      --rc-on-closed:var(--red-800);      --rc-closed-glow:none;
  --rc-closing:var(--amber-100);   --rc-on-closing:var(--amber-900);   --rc-closing-glow:none;
  --rc-open:var(--green-100);      --rc-on-open:var(--green-900);      --rc-open-glow:none;
  --rc-unknown:var(--sand-200);    --rc-on-unknown:var(--slate-700);   /* NO LIVE DATA */

  /* countdown values on the Next open / Next close figures */
  --rc-open-text:var(--green-700);
  --rc-close-text:var(--amber-700);
  --rc-held-text:var(--slate-500);      /* a held train: the number is a lower bound */
  --rc-idle-text:var(--sand-600);       /* "--" before there is data */

  /* soft state fills: the current closure, the error box, the feedback buttons */
  --rc-closed-soft:var(--red-100);      --rc-on-closed-soft:var(--red-800);
  --rc-open-soft:var(--green-100);      --rc-on-open-soft:var(--green-900);
  --rc-ok-line:var(--green-700);        /* Refresh button once a refresh has landed */

  /* the barrier drawing (the booms stay the real colours: red and white, amber, green) */
  --rc-post:var(--sand-600);
  --rc-road:var(--sand-600);            /* the dashed road line: the post colour, so the drawing is one grey */
  --rc-lamp:var(--red-600);             /* the flashing lights */
  --rc-arm-idle:var(--sand-400);        --rc-stripe-idle:var(--sand-100);    /* before there is data */
  --rc-arm-closed:var(--red-600);       --rc-stripe-closed:var(--white);
  --rc-arm-closing:var(--amber-500);    --rc-stripe-closing:var(--slate-900);
  --rc-arm-open:var(--green-600);       --rc-stripe-open:var(--green-700);

  /* overlays and shadows (warm and light) */
  --rc-scrim:rgba(29,39,51,.45);          /* slate-900 at 45%: behind the crossing page's pop-up */
  --rc-backdrop:rgba(29,39,51,.35);       /* slate-900 at 35%: behind the menu drawer */
  --rc-backdrop-strong:rgba(29,39,51,.45);/* slate-900 at 45%: behind the homepage's pop-up */
  --rc-shadow-dropdown:0 18px 40px rgba(60,40,10,.18);
  --rc-shadow-app:0 4px 14px rgba(60,40,10,.18);
  --rc-shadow-sheet:0 -6px 30px rgba(60,40,10,.16);
  --rc-shadow-num:0 2px 6px rgba(0,0,0,.25);

  /* the homepage map (shared/home.js reads the pin and map values) */
  --rc-map-base:positron;                 /* OpenFreeMap style name */
  --rc-map-plan:light;                    /* map/style.js planStyle theme: light or dark */
  --rc-map-sea:var(--map-ground);         /* behind the map before its tiles arrive */
  --rc-map-glass:rgba(255,255,255,.92);   /* white at 92%: the legend over the map */
  --rc-map-attrib:rgba(255,255,255,.8);   /* white at 80%: the OpenStreetMap credit */
  --rc-map-attrib-invert:0;               /* 1 = flip the credit's (i) icon for a dark map */
  --rc-pin-live:var(--sea-700);
  --rc-pin-live-ring:var(--white);
  --rc-pin-live-halo:rgba(11,92,120,0.22);  /* sea-700 at 22% */
  --rc-pin-soon:var(--sand-600);
  --rc-pin-soon-ring:var(--white);
  --rc-pin-selected:var(--slate-900);
  --rc-pin-selected-ring:var(--white);
  --rc-pin-label:var(--slate-900);
  --rc-pin-label-halo:var(--white);
  --rc-pin-you:var(--cyan-600);
  --rc-pin-you-ring:var(--white);
  --rc-pin-you-halo:rgba(8,145,178,.2);   /* cyan-600 at 20% */
  --rc-num-bg:var(--sea-700);             /* numbered circles for Nearby */
  --rc-num-ink:var(--white);
  --rc-num-soon-bg:var(--sand-700);

  /* the browser bar matches the sea-blue header; the app's loading screen is sand
     (read by scripts/build-crossings.js) */
  --rc-browser-bar:var(--sea-700);
  --rc-app-splash:var(--sand-50);

  /* the debug panel (?debug=1, internal) */
  --rc-debug-bg:var(--sand-100);
  --rc-debug-line:var(--sand-200);
  --rc-debug-text:var(--slate-600);
  --rc-debug-faint:var(--sand-700);
}
