/* ============================================================
   /warnings/ — design tokens and section styles
   HurriTrack Global Warnings v1

   R10: this file EXTENDS hurritrack.com's existing design
   system. Every colour, radius, shadow and font below is a
   copy of a custom property already defined in /styles.css
   (:root, 37 tokens). Nothing here is imported from an
   external template and /styles.css is NOT modified.

   PLACEMENT DEVIATION (see RELEASE_NOTES.md "Deviations"):
   the spec asked for SITE_DIR/assets/warnings-tokens.css.
   The site is Workers + Static Assets with assets.directory
   = ./public (sites/stormwatch/wrangler.jsonc), so only
   files under public/ are reachable over HTTP. The file
   lives at public/warnings-tokens.css and is served as
   /warnings-tokens.css.

   The :root block below re-declares the inherited tokens so
   this stylesheet is self-documenting and so a future
   palette change has one obvious home. Because every value
   matches /styles.css exactly, the redeclaration is a no-op
   at runtime: styles.css is always loaded first.
   ============================================================ */

:root {
  /* ---- copied verbatim from /styles.css :root ---- */
  --bg:   #070c15;
  --s1:   #0c1421;
  --s2:   #121d2c;
  --s3:   #1a2738;
  --line: rgba(255,255,255,.085);
  --line-2: rgba(255,255,255,.14);
  --ink:    #e9eff7;
  --muted:  #9fb2c8;
  --dim:    #7d90a6;
  --strong: #ffffff;
  --accent:   #3fbaf7;
  --accent-2: #0e8fdc;
  --on-accent:#04121d;
  --gold:   #f5a524;
  --gold-2: #f7b733;
  --on-gold:#16100a;
  --major: #ff4d5e;
  --hur:   #ff9e42;
  --ts:    #25d6c0;
  --td:    #5ec8ee;
  --ex:    #93a3b4;
  --cat5:  #b07bff;
  --ok:    #34d39a;
  --alert: #ff3b4e;
  --watch: #ffb020;
  --live:  #ff4d5e;
  --r:    14px;
  --r-sm: 10px;
  --r-lg: 22px;
  --shadow:    0 22px 50px -24px rgba(0,0,0,.78);
  --shadow-sm: 0 10px 26px -16px rgba(0,0,0,.66);
  --font-display: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* ---- section-local additions, all built from the above ---- */

  /* CAP severity ramp (R3). Ordered coldest-to-hottest so a
     screen reader reading the class list in source order hits
     the mild end first; every chip also carries a text label,
     so colour is never the only signal (R9). */
  --cap-extreme:  var(--alert);
  --cap-severe:   var(--major);
  --cap-moderate: var(--watch);
  --cap-minor:    var(--td);
  --cap-unknown:  var(--ex);

  /* R1 status triad. NO DATA is deliberately grey, not green:
     "we could not fetch this" must never look like "all clear". */
  --st-active: var(--alert);
  --st-none:   var(--ok);
  --st-nodata: var(--dim);
}

/* ============================================================
   Section shell
   ============================================================ */
.w-wrap { max-width: 1080px; margin: 0 auto; padding: 0 22px; }

/* R5 — persistent, non-collapsible disclaimer. It is a
   <aside role="note"> in the DOM on every /warnings/ page,
   styled here; there is no dismiss control and no JS that can
   hide it. It sits above <main> so it is the first thing read. */
.w-banner {
  background: linear-gradient(90deg, rgba(255,59,78,.14), rgba(255,59,78,.05));
  border-bottom: 1px solid rgba(255,59,78,.3);
  padding: 11px 0;
  font-size: .84rem;
  color: #ffd9dc;
}
.w-banner strong { color: #fff; }
.w-banner .w-banner-inner { display: flex; gap: 10px; align-items: flex-start; }
.w-banner .w-banner-tag {
  font-family: var(--mono); font-size: .58rem; letter-spacing: .16em;
  text-transform: uppercase; color: var(--alert);
  border: 1px solid rgba(255,59,78,.45); border-radius: 999px;
  padding: 2px 8px; white-space: nowrap; flex: none; margin-top: 1px;
}

/* ============================================================
   Hero
   ============================================================ */
.w-hero { padding: 46px 0 30px; border-bottom: 1px solid var(--line); }
.w-hero .eyebrow { font-family: var(--mono); font-size: .62rem; letter-spacing: .18em;
  text-transform: uppercase; color: var(--accent); margin: 0 0 12px; }
.w-hero h1 { font-family: var(--font-display); font-size: clamp(1.9rem, 4.4vw, 3rem);
  line-height: 1.08; letter-spacing: -.02em; margin: 0 0 12px; color: var(--strong); }
.w-hero .w-sub { color: var(--muted); font-size: 1.03rem; margin: 0; max-width: 66ch; }

/* ============================================================
   Region tabs (hub) — R9: list before map, no colour-only cues
   ============================================================ */
.w-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 0; padding: 0; list-style: none; }
.w-tabs a {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 13px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--s2); color: var(--muted); text-decoration: none;
  font-size: .82rem; font-weight: 600;
}
.w-tabs a:hover { border-color: var(--line-2); color: var(--ink); }
.w-tabs .w-tab-count { font-family: var(--mono); font-size: .7rem; color: var(--dim); }

/* ============================================================
   Section + card
   ============================================================ */
.w-section { padding: 34px 0; border-bottom: 1px solid var(--line); }
.w-section:last-of-type { border-bottom: 0; }
.w-h2 { font-family: var(--font-display); font-size: 1.28rem; margin: 0 0 4px; color: var(--strong); }
.w-h2-note { color: var(--dim); font-size: .86rem; margin: 0 0 18px; }

.w-card {
  background: var(--s2); border: 1px solid var(--line); border-radius: var(--r);
  padding: 18px 20px; box-shadow: var(--shadow-sm);
}
.w-grid { display: grid; gap: 14px; }
.w-grid.c2 { grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); }
.w-grid.c3 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.w-grid.c4 { grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); }

/* ============================================================
   R1 — the status triad. Exactly one of these renders per block.
   ============================================================ */
.w-status {
  border: 1px solid var(--line); border-radius: var(--r);
  background: var(--s2); padding: 16px 18px;
}
.w-status-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.w-status-label {
  font-family: var(--mono); font-size: .62rem; letter-spacing: .15em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 999px; border: 1px solid currentColor;
}
.w-status[data-state="active"] .w-status-label { color: var(--st-active); }
.w-status[data-state="none"]   .w-status-label { color: var(--st-none); }
.w-status[data-state="nodata"] .w-status-label { color: var(--st-nodata); }
.w-status-msg { color: var(--muted); font-size: .9rem; margin: 0; }

/* R2 — every data block carries its own fetched_at and a STALE badge. */
.w-asof { font-family: var(--mono); font-size: .74rem; color: var(--dim); margin: 6px 0 0; }
.w-stale {
  font-family: var(--mono); font-size: .58rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--watch); border: 1px solid rgba(255,176,32,.45);
  border-radius: 999px; padding: 2px 8px;
}

/* ============================================================
   R3 — severity chips. Native label FIRST, CAP mapping in
   parentheses. Text label is always present (R9).
   ============================================================ */
.w-chip {
  display: inline-flex; align-items: baseline; gap: 7px;
  font-size: .78rem; font-weight: 700; color: var(--ink);
  border: 1px solid var(--line-2); border-left-width: 3px;
  border-radius: var(--r-sm); padding: 3px 10px; background: var(--s3);
}
.w-chip .w-chip-cap { font-family: var(--mono); font-size: .66rem; font-weight: 500; color: var(--dim); }
.w-chip[data-sev="Extreme"]  { border-left-color: var(--cap-extreme); }
.w-chip[data-sev="Severe"]   { border-left-color: var(--cap-severe); }
.w-chip[data-sev="Moderate"] { border-left-color: var(--cap-moderate); }
.w-chip[data-sev="Minor"]    { border-left-color: var(--cap-minor); }
.w-chip[data-sev="Unknown"]  { border-left-color: var(--cap-unknown); }

/* R6 — attribution always names the agency and deep-links the product. */
.w-attr { font-size: .78rem; color: var(--dim); margin: 10px 0 0; }
.w-attr a { color: var(--muted); }

/* ============================================================
   Event / alert list rows
   ============================================================ */
.w-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line);
  border-radius: var(--r); overflow: hidden; }
.w-row { display: grid; gap: 4px 14px; padding: 14px 16px; border-bottom: 1px solid var(--line);
  background: var(--s2); }
.w-row:last-child { border-bottom: 0; }
.w-row-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.w-row-title { font-weight: 700; font-size: .95rem; color: var(--ink); margin: 0; }
.w-row-meta { font-family: var(--mono); font-size: .72rem; color: var(--dim); margin: 0; }
.w-row-geo { color: var(--muted); font-size: .84rem; margin: 0; }

/* observed vs forecast kept visually separate (event page) */
.w-obs, .w-fc { border-radius: var(--r-sm); padding: 12px 14px; margin: 0 0 14px; border: 1px solid var(--line); }
.w-obs { background: rgba(52,211,154,.06); border-left: 3px solid var(--ok); }
.w-fc  { background: rgba(63,186,247,.06); border-left: 3px solid var(--accent); }
.w-obs h3, .w-fc h3 { font-family: var(--mono); font-size: .64rem; letter-spacing: .16em;
  text-transform: uppercase; margin: 0 0 8px; color: var(--muted); }

/* ============================================================
   Tables (event timeline, methodology, status)
   ============================================================ */
.w-table { width: 100%; border-collapse: collapse; font-size: .86rem; }
.w-table th, .w-table td { text-align: left; padding: 9px 11px; border-bottom: 1px solid var(--line); vertical-align: top; }
.w-table th { font-family: var(--mono); font-size: .62rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--dim); font-weight: 600; }
.w-table td { color: var(--muted); }
.w-table td:first-child { color: var(--ink); font-weight: 600; }
.w-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ============================================================
   Coverage gaps (rendered near the top of census pages)
   ============================================================ */
.w-gaps { border: 1px solid rgba(255,176,32,.3); background: rgba(255,176,32,.05);
  border-radius: var(--r); padding: 14px 16px; }
.w-gaps h2 { font-family: var(--font-display); font-size: 1rem; margin: 0 0 6px; color: var(--watch); }
.w-gaps ul { margin: 8px 0 0; padding-left: 20px; color: var(--muted); font-size: .86rem; }
.w-gaps li { margin-bottom: 4px; }

/* ============================================================
   R11 — reserved ad slots. EMPTY. No ad code anywhere in this
   section. The site already styles .ad-slot (styles.css:767);
   we reuse that class and add data-slot for the reserved name.
   [data-empty] collapses the slot, per the existing stylesheet.
   ============================================================ */
.ad-slot[data-slot] { margin: 30px auto; }

/* ============================================================
   Draft marker for seeded content awaiting human review
   ============================================================ */
.w-draft { font-family: var(--mono); font-size: .68rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--gold);
  border: 1px solid rgba(245,165,36,.4); border-radius: 999px; padding: 3px 10px;
  display: inline-block; margin-bottom: 12px; }
.w-prose { color: var(--muted); line-height: 1.62; }
.w-prose h2 { font-family: var(--font-display); color: var(--ink); font-size: 1.15rem; margin: 26px 0 8px; }
.w-prose h3 { font-family: var(--font-display); color: var(--ink); font-size: 1rem; margin: 20px 0 6px; }
.w-prose p { margin: 0 0 12px; }
.w-prose ul { margin: 0 0 12px; padding-left: 20px; }
.w-prose li { margin-bottom: 5px; }
.w-note { font-size: .8rem; color: var(--dim); border-left: 2px solid var(--line-2);
  padding-left: 11px; margin: 14px 0; }

.w-crumb { font-size: .8rem; color: var(--dim); margin: 20px 0 0; }
.w-crumb a { color: var(--muted); }
.w-updated { font-family: var(--mono); font-size: .74rem; color: var(--dim); margin: 10px 0 0; }
.w-sitemap { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.w-sitemap a { color: var(--muted); font-size: .88rem; }

/* The bulletin's separate clocks (report date, window, retrieval,
   editor review). Kept as a labelled grid so no one clock can be
   mistaken for another. */
.w-clocks { display: grid; gap: 10px; margin: 0;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.w-clocks div { border: 1px solid var(--line); border-radius: 12px;
  background: var(--s2); padding: 10px 14px; }
.w-clocks dt { font-family: var(--mono); font-size: .62rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--dim); }
.w-clocks dd { margin: 4px 0 0; color: var(--ink); font-size: .9rem; }

/* A failed poll (e.g. an NWS 403) — red, named, never a quiet NO DATA. */
.w-status-error { color: var(--alert); font-weight: 600; }

/* Bulletin table of contents and source links. */
.w-toc ul { list-style: none; padding: 0; margin: 0 0 18px; display: flex; flex-wrap: wrap; gap: 8px; }
.w-toc a { display: inline-block; padding: 5px 11px; border: 1px solid var(--line);
  border-radius: 999px; font-size: .8rem; color: var(--muted); text-decoration: none; }
.w-toc a:hover { border-color: var(--line-2); color: var(--ink); }
.w-bulletin h2 { scroll-margin-top: 80px; }
.w-src { font-family: var(--mono); font-size: .78em; }
.w-h3 { font-family: var(--font-display); color: var(--ink); font-size: 1rem; margin: 20px 0 8px; }
.w-unlinked { color: inherit; }
.w-foot-note { font-size: .8rem; color: var(--dim); margin: 0 0 14px; }

/* Long agency URLs must never widen the page at 390px.
   `anywhere` rather than `break-word` is deliberate: `break-word`
   only fixes the break after a line has already overflowed, while
   `anywhere` also lowers the element's min-content width, which is
   what actually stops the document from scrolling. A URL with no
   spaces — https://www.dwd.de/EN/warnings/warnings_node.html — is
   otherwise unbreakable. */
.w-wrap a, .w-prose, .w-note, .w-card, .w-list, .w-row-meta, .w-attr,
.w-status-msg, .w-row-geo, .w-row-title, .w-table td, .w-clocks dd, code {
  overflow-wrap: anywhere;
}

/* ============================================================
   R9 — mobile first at 390px. Verified at 1440 and 390.
   No horizontal scroll: tables scroll inside .w-scroll only.
   ============================================================ */
@media (max-width: 720px) {
  .w-wrap { padding: 0 16px; }
  .w-hero { padding: 32px 0 22px; }
  .w-row { padding: 12px 13px; }
  .w-status { padding: 14px; }
  .w-chip { font-size: .74rem; }
  .w-hero h1 { font-size: clamp(1.55rem, 7.4vw, 2.1rem); }
}