/*
 * EWCRC brand tokens (docs/BRAND.md). Washtenaw County Parks & Recreation, made
 * more modern. Contrast checked against WCAG 2.1 in BRAND.md.
 *
 * This file is the instance's whole look. The platform CSS uses only these
 * variables. Every token listed in REQUIRED_TOKENS (src/site.config.ts) must be
 * defined, or the server refuses to start.
 */
:root {
  /* Core */
  --color-primary: #235e38; /* Parks green: header, primary buttons, headings */
  --color-primary-strong: #1b4a2c; /* hover/pressed, footer */
  --color-primary-soft: #e7f0ea; /* tinted panels */
  --color-primary-line: #9db8a6; /* chip borders */
  --color-on-primary: #ffffff; /* text on primary */
  --color-accent: #6f7bc6; /* sign periwinkle: FILLS and LARGE type only (3.94:1) */
  --color-accent-text: #4f5ba6; /* periwinkle for links/small text on light bg (6.21:1) */
  --color-accent-deep: #454f96; /* Sample tags, preview bar */
  --color-accent-soft: #eef0fa; /* periwinkle tint panels */
  --color-accent-line: #c9ceea;
  --color-highlight: #f2b544; /* sun yellow: progress marker, "Today" pin. Never text */

  /* Fills behind white text. In light mode they match primary/primary-strong/accent-deep;
     in dark mode the text tokens go light and these stay dark. */
  --color-primary-fill: #235e38;
  --color-primary-fill-strong: #1b4a2c;
  --color-accent-fill: #454f96;
  --color-scrim: #14140c; /* dark ground behind photos: lightbox, camera frames, photo tags */
  --color-on-primary-soft: #e7f0ea; /* quieter text on a primary fill (hero kicker) */

  /* Neutrals */
  --color-ink: #14140c; /* body text (matches County) */
  --color-muted: #4b5148; /* secondary text */
  --color-surface: #ffffff;
  --color-canvas: #f6f3ec; /* warm sand section background */
  --color-line: #dedad0;

  /* Footer (dark ground: logos use their white versions) */
  --color-footer-bg: #1b4a2c;
  --color-footer-text: #ffffff;
  --color-footer-soft: #d7e6dc;
  --color-footer-rule: #3c6a4b;

  --color-focus: #454f96;

  /* Type: self-hosted by the platform (src/lib/fonts.ts) */
  --font-display: var(--font-oswald), "Oswald", "Arial Narrow", sans-serif; /* uppercase nav, eyebrows, big numbers */
  --font-body: var(--font-open-sans), "Open Sans", Arial, sans-serif;

  --radius: 14px;
}

/*
 * Dark mode (site.json brand.dark turns it on). The same tokens twice: from the
 * system setting unless the visitor chose light with the button, and from the button
 * (data-theme="dark" on <html>). Keep the two blocks identical; a test checks.
 * Text tokens go light; fills stay dark green and periwinkle so white text on them
 * keeps its contrast. Ratios are checked in docs/BRAND.md. Logos switch to their
 * white versions through site.json darkFile.
 */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --color-primary: #8ccfa2; /* light green: links, headings, nav (9.8:1 on surface) */
    --color-primary-strong: #b3e2c2;
    --color-primary-soft: #1b2b21;
    --color-primary-line: #4d7c62;
    --color-on-primary: #ffffff;
    --color-primary-fill: #235e38;
    --color-primary-fill-strong: #2c7347;
    --color-on-primary-soft: #c9dccf;
    --color-accent: #6f7bc6; /* fills and large type, as in light */
    --color-accent-text: #aeb6ee;
    --color-accent-deep: #bcc3f2; /* Sample tag text */
    --color-accent-fill: #454f96; /* preview bar, Sample badges */
    --color-accent-soft: #1f2340;
    --color-accent-line: #4c558f;
    --color-highlight: #f2b544;

    --color-ink: #e8ece6;
    --color-muted: #b3bcb4;
    --color-surface: #111813;
    --color-canvas: #18211b;
    --color-line: #34423a;

    --color-footer-bg: #0f2418;
    --color-footer-text: #ffffff;
    --color-footer-soft: #c9dccf;
    --color-footer-rule: #2c5139;

    --color-focus: #aeb6ee;
    --color-scrim: #070a08;
  }
}

:root[data-theme="dark"] {
  --color-primary: #8ccfa2; /* light green: links, headings, nav (9.8:1 on surface) */
  --color-primary-strong: #b3e2c2;
  --color-primary-soft: #1b2b21;
  --color-primary-line: #4d7c62;
  --color-on-primary: #ffffff;
  --color-primary-fill: #235e38;
  --color-primary-fill-strong: #2c7347;
  --color-on-primary-soft: #c9dccf;
  --color-accent: #6f7bc6; /* fills and large type, as in light */
  --color-accent-text: #aeb6ee;
  --color-accent-deep: #bcc3f2; /* Sample tag text */
  --color-accent-fill: #454f96; /* preview bar, Sample badges */
  --color-accent-soft: #1f2340;
  --color-accent-line: #4c558f;
  --color-highlight: #f2b544;

  --color-ink: #e8ece6;
  --color-muted: #b3bcb4;
  --color-surface: #111813;
  --color-canvas: #18211b;
  --color-line: #34423a;

  --color-footer-bg: #0f2418;
  --color-footer-text: #ffffff;
  --color-footer-soft: #c9dccf;
  --color-footer-rule: #2c5139;

  --color-focus: #aeb6ee;
  --color-scrim: #070a08;
}
