/*
 * Design tokens: colours for light and dark themes, fonts and radii.
 * Every colour is defined on :root first; dark values only redefine tokens, both for
 * the OS setting (prefers-color-scheme) and for an explicit data-theme="dark".
 * Map canvas layers read these values through js/ui/theme.js.
 */
:root {
  --bg: #eef1f4;
  --panel: #ffffff;
  --fg: #17202b;
  --muted: #5a6575;
  --line: #dbe0e6;
  --soft: #f2f4f7;
  --accent: #0b4ea2;          /* Finnish road-sign blue */
  --accent-fg: #ffffff;
  --selection: #17202b;

  --map-ground: #e7ebef;
  --map-water: #bcd3e6;
  --map-street: #ffffff;
  --map-major: #fdfcf7;
  --map-casing: #c5ccd5;
  --map-label: #4d5868;
  --map-halo: #f4f6f8;

  /* rule statuses ("Säännöt" colouring) */
  --status-free: #15884a;
  --status-disc: #2a78d4;
  --status-paid: #df8600;
  --status-banned: #d23a2f;
  --status-permit: #8a92a0;   /* grey: permit holders or other vehicles only */
  --status-garage: #0b3d8c;
  --status-unknown: #9a86c8;  /* price list not known */

  /* cost tiers ("Hinta" colouring): one-hue ordinal ramp, cheap = light, expensive = dark.
     Validated against --map-ground with the dataviz palette checker. */
  --cost-1: #6da7ec;
  --cost-2: #2a78d6;
  --cost-3: #184f95;
  --cost-4: #0d366b;

  /* physical traffic signs keep their real colours in both themes */
  --sign-plate: #ffffff;
  --sign-ink: #111418;
  --sign-red: #c8102e;
  --sign-blue: #0b4ea2;

  --font-ui: "Overpass", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-num: "Overpass Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --radius: 10px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1217; --panel: #141920; --fg: #e7ebf0; --muted: #97a2b0; --line: #28303b; --soft: #1b222b;
    --accent: #4d8fe0; --accent-fg: #0b1220; --selection: #ffffff;
    --map-ground: #11161c; --map-water: #16304a; --map-street: #2a323d; --map-major: #36414f; --map-casing: #0c1015;
    --map-label: #a9b3bf; --map-halo: #11161c;
    --status-free: #2fbf6c; --status-disc: #4f9df0; --status-paid: #f2a33a; --status-banned: #f0584c; --status-permit: #717b89; --status-garage: #5f9bf0; --status-unknown: #a596dc;
    --cost-1: #184f95; --cost-2: #2a78d6; --cost-3: #6da7ec; --cost-4: #cde2fb;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1217; --panel: #141920; --fg: #e7ebf0; --muted: #97a2b0; --line: #28303b; --soft: #1b222b;
  --accent: #4d8fe0; --accent-fg: #0b1220; --selection: #ffffff;
  --map-ground: #11161c; --map-water: #16304a; --map-street: #2a323d; --map-major: #36414f; --map-casing: #0c1015;
  --map-label: #a9b3bf; --map-halo: #11161c;
  --status-free: #2fbf6c; --status-disc: #4f9df0; --status-paid: #f2a33a; --status-banned: #f0584c; --status-permit: #717b89; --status-garage: #5f9bf0; --status-unknown: #a596dc;
  --cost-1: #184f95; --cost-2: #2a78d6; --cost-3: #6da7ec; --cost-4: #cde2fb;
  color-scheme: dark;
}
