/* Shared by the map (style.css) and the road/about pages (page.css): colour tokens, the brand and type badges. */
:root {
  color-scheme: light;
  --page: #f9f9f7;
  --surface: #fcfcfb;
  --surface-2: #f2f1ed;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #6f6d68;
  --hairline: #e1e0d9;
  --border: rgba(11, 11, 11, 0.1);
  --accent: #2a78d6;
  --good: #0ca30c;
  --critical: #d03b3b;
  --bar: #2a78d6;
  --bar-soft: #cde2fb;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 4px 16px rgba(0, 0, 0, 0.06);

  /* Incident types. The glyph on each marker carries the type too, so colour is never the only cue. */
  --t-collision: #e34948;
  --t-breakdown: #eda100;
  --t-hazard: #1baf7a;
  --t-closure: #4a3aa7;
  --t-slowdown: #2a78d6;
  --t-congestion: #eb6834;
  --t-roadworks: #898781;
  --t-other: #898781;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #0d0d0d;
    --surface: #1a1a19;
    --surface-2: #242423;
    --ink: #ffffff;
    --ink-2: #c3c2b7;
    --muted: #9a988f;
    --hairline: #2c2c2a;
    --border: rgba(255, 255, 255, 0.1);
    --accent: #3987e5;
    --bar: #3987e5;
    --bar-soft: #184f95;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 4px 16px rgba(0, 0, 0, 0.4);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d0d0d;
  --surface: #1a1a19;
  --surface-2: #242423;
  --ink: #ffffff;
  --ink-2: #c3c2b7;
  --muted: #9a988f;
  --hairline: #2c2c2a;
  --border: rgba(255, 255, 255, 0.1);
  --accent: #3987e5;
  --bar: #3987e5;
  --bar-soft: #184f95;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 4px 16px rgba(0, 0, 0, 0.4);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

/* ---- Brand ---- */
.brand { display: flex; align-items: center; gap: 10px; }
.brand h1 { font-size: 17px; font-weight: 650; letter-spacing: -0.01em; }
.brand h1 .tld { color: var(--muted); font-weight: 500; }
/* The logo's triangle is white: on the light header it needs a faint edge to show; on dark it stands out as is. */
.brand-logo { display: block; width: 31px; height: 27px; filter: drop-shadow(0 0 0.6px rgba(11, 11, 11, 0.55)) drop-shadow(0 1px 1.5px rgba(11, 11, 11, 0.18)); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .brand-logo { filter: none; }
}
:root[data-theme="dark"] .brand-logo { filter: none; }

/* ---- Glyph (type badge, used in chips, feed and on the map) ---- */
.glyph {
  --c: var(--t-other);
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--c); color: #fff;
  display: inline-grid; place-items: center; flex: none;
  font: 800 11px/1 system-ui, sans-serif;
}
.glyph.dark-ink { color: #0b0b0b; }
.glyph.hollow { background: var(--surface); color: var(--c); border: 2px dashed var(--c); }
