/* Louisiana Burn Conditions
   Design rules:
   - White background, near-black ink: maximum legibility in direct sunlight.
   - Okabe-Ito colorblind-safe palette. Color is NEVER the only signal:
     every rating also has a word and an icon, and DO NOT BURN is black,
     so the scale survives full grayscale.
   - System fonts: fastest possible render on cheap rural Android phones.
   - No third-party map tiles: the parishes ARE the map. Faster, works
     offline, no watermark, no outside dependency that can break. */

:root {
  --ink: #1A1A1A;
  --paper: #FFFFFF;
  --line: #D9D4CC;
  --water: #DCE9F2;
  /* Official "Smoke Category Days Defined" colors (LA Office of State
     Climatology / American Sugar Cane League). Category 5 is yellow, not
     green, because of unstable and windy conditions. */
  --no:      #E8112D;  /* Category 1 */
  --caution: #FFE800;  /* Categories 2 and 5 */
  --burn:    #00A14B;  /* Categories 3 and 4 */
  --nodata: #C9C4BA;
  --tap: 44px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--paper); color: var(--ink); }
body { font-size: 16px; line-height: 1.45; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- header ---------- */
.topbar {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 8px; padding: 12px 14px; border-bottom: 3px solid var(--ink);
}
.brand-name { font-weight: 800; letter-spacing: 0.04em; font-size: 0.95rem; display: block; white-space: nowrap; }
.brand-sub  { font-size: 0.78rem; color: #555; display: block; }
.issued { font-size: 0.78rem; text-align: right; color: #555; max-width: 45%; }

/* ---------- banners ---------- */
.banner {
  padding: 10px 14px; font-weight: 700; font-size: 0.95rem;
  background: var(--fair); color: var(--ink); border-bottom: 2px solid var(--ink);
}
.banner.severe { background: var(--ink); color: var(--paper); }
.hidden { display: none; }

/* ---------- parish finder ---------- */
.finder { display: flex; gap: 8px; padding: 10px 14px; }
.finder select, .finder button {
  min-height: var(--tap); font-size: 1rem; border: 2px solid var(--ink);
  border-radius: 8px; background: var(--paper); color: var(--ink); padding: 0 10px;
}
.finder select { flex: 1 1 60%; }
.finder button { flex: 1 1 40%; font-weight: 700; cursor: pointer; }
.finder button:active { background: var(--ink); color: var(--paper); }

/* ---------- map ---------- */
#map { height: 46vh; min-height: 300px; border-top: 2px solid var(--ink);
       border-bottom: 2px solid var(--ink); background: var(--water); }
.leaflet-container { font: inherit; }
.leaflet-control-attribution { display: none; }

.map-period {
  background: var(--paper); border: 2px solid var(--ink); border-radius: 8px;
  padding: 4px 6px; display: flex; align-items: center; gap: 6px;
  font-size: 0.85rem; font-weight: 700;
}
.map-period select {
  font: inherit; font-weight: 700; border: 0; background: transparent;
  color: var(--ink); min-height: 32px; cursor: pointer;
}

.parish-label {
  background: transparent; border: 0; box-shadow: none;
  font-size: 11px; font-weight: 700; color: var(--ink);
  text-shadow: 0 0 3px #FFF, 0 0 3px #FFF, 0 0 3px #FFF;
  pointer-events: none;
}
.parish-label::before { display: none; }

/* ---------- legend ---------- */
.legend { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 14px; }
.chip {
  font-size: 0.78rem; font-weight: 700; padding: 4px 9px; border-radius: 999px;
  border: 2px solid var(--ink); color: var(--paper); white-space: nowrap;
}
.chip.no      { background: var(--no); }
.chip.caution { background: var(--caution); color: var(--ink); }
.chip.burn    { background: var(--burn); }
.chip.nodata  { background: var(--nodata); color: var(--ink); }

/* ---------- detail panel ---------- */
.detail { padding: 12px 14px 4px; }
.detail h2 { margin: 0 0 8px; font-size: 1.4rem; }

.periods { display: flex; gap: 6px; margin-bottom: 10px; }
.periods button {
  flex: 1; min-height: var(--tap); border: 2px solid var(--ink); background: var(--paper);
  color: var(--ink); border-radius: 8px; font-size: 0.9rem; font-weight: 700; cursor: pointer;
  padding: 4px 2px; line-height: 1.15;
}
.periods button[aria-selected="true"] { background: var(--ink); color: var(--paper); }

.verdict {
  display: flex; align-items: center; gap: 14px;
  border: 3px solid var(--ink); border-radius: 14px;
  padding: 16px; margin-bottom: 12px; color: var(--paper);
}
.verdict.no      { background: var(--no); }
.verdict.caution { background: var(--caution); color: var(--ink); }
.verdict.burn    { background: var(--burn); }
.verdict.nodata { background: var(--nodata); color: var(--ink); }
.verdict-icon { font-size: 2.6rem; line-height: 1; }
.verdict-word { font-size: clamp(1.6rem, 8vw, 2.4rem); font-weight: 900; letter-spacing: 0.02em;
                line-height: 1.08; }
.verdict.long .verdict-word { font-size: clamp(1.15rem, 5.4vw, 1.6rem); }
.verdict-detail { font-size: 0.95rem; margin-top: 2px; }

.keyfacts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
            gap: 8px; margin-bottom: 12px; }
.fact { border: 2px solid var(--line); border-radius: 10px; padding: 8px 4px; text-align: center; }
.fact .v { font-size: 1.15rem; font-weight: 800; line-height: 1.2; }
.fact .k { font-size: 0.7rem; color: #555; text-transform: uppercase; letter-spacing: 0.04em; margin-top: 2px; }

.raw summary { min-height: var(--tap); display: flex; align-items: center;
               font-weight: 700; cursor: pointer; }
.raw table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.raw td, .raw th { border-bottom: 1px solid var(--line); padding: 6px 4px; text-align: left; }
.raw td { text-align: right; font-weight: 700; }
.source { font-size: 0.8rem; color: #555; }

.disclaimer { padding: 14px; font-size: 0.8rem; color: #555;
              border-top: 2px solid var(--line); margin-top: 12px; }

@media (min-width: 760px) {
  body { max-width: 900px; margin: 0 auto; }
  #map { height: 54vh; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* neighbor state / gulf labels */
.region-label {
  font-size: 12px; font-weight: 700; letter-spacing: 0.12em; color: #6B6B6B;
  text-align: center; white-space: nowrap; pointer-events: none;
  text-shadow: 0 0 3px #FFF, 0 0 3px #FFF;
}
.periods { flex-wrap: wrap; }
.periods button { flex: 1 1 22%; min-width: 70px; }
