/* Hazards NZ. Light, basic, professional. Cool-grey palette, three severity
   accents plus a calm blue for informational events. No gradients or glow. */

:root {
  --bg:        #f4f6f8;
  --surface:   #ffffff;
  --ink:       #1a2430;
  --ink-soft:  #5b6874;
  --line:      #dde3e9;
  --brand:     #1f6feb;

  --c-severe:   #e23b2e;
  --c-moderate: #ef7d11;
  --c-minor:    #f5c518;
  --c-info:     #4b83c7;

  --header-h: 52px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
}

body { display: flex; flex-direction: column; min-height: 100%; }

a { color: var(--brand); }

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--ink); color: #fff; padding: 8px 12px; z-index: 1000;
}
.skip:focus { left: 8px; top: 8px; }

/* Header */
.site-header {
  display: flex; align-items: center; justify-content: space-between;
  height: var(--header-h); padding: 0 16px;
  background: var(--surface); border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); }
.brand-mark {
  width: 18px; height: 18px; border-radius: 4px;
  background: var(--brand);
  box-shadow: inset 0 0 0 3px rgba(255,255,255,0.65);
}
.brand-name { font-weight: 700; letter-spacing: 0.2px; }
.site-nav a { margin-left: 18px; text-decoration: none; color: var(--ink-soft); }
.site-nav a[aria-current="page"] { color: var(--ink); font-weight: 600; }

/* Main + map */
#main { flex: 1 1 auto; display: flex; min-height: 0; }
#map { flex: 1 1 auto; width: 100%; height: 100%; min-height: 320px; background: #dfe6ec; }

/* Round type-glyph pin markers (volcanoes, and later other point-status hazards).
   Quakes stay as plain Leaflet circle markers sized by magnitude. */
.hz-div { background: none; border: none; }
.hz-pin { display: flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 1px 3px rgba(20,36,48,.45); }
.hz-pin svg { width: 15px; height: 15px; display: block; }

/* Hazard sidebar (home). One collapsible section per hazard type, each with
   its own filter dropdown. Sections are added as their data feeds come online. */
.side { width: 314px; flex: 0 0 auto; background: var(--surface); border-right: 1px solid var(--line); overflow: auto; padding: 8px; }
.hint { color: var(--ink-soft); font-size: .78rem; padding: 10px 10px 4px; }

/* Collapse / expand the whole panel. */
.side-top { display: flex; align-items: center; justify-content: space-between; padding: 4px 4px 0; }
.side-title { font-weight: 700; padding-left: 4px; }
.side-hide { border: 1px solid var(--line); background: var(--surface); border-radius: 6px; width: 28px; height: 28px; cursor: pointer; color: var(--ink-soft); font-size: 18px; line-height: 1; }
.side-hide:hover { background: var(--bg); color: var(--ink); }
.side-show { position: absolute; top: 62px; left: 12px; z-index: 600; display: none; align-items: center; gap: 6px;
  border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 7px 12px; cursor: pointer;
  box-shadow: 0 1px 4px rgba(20,36,48,.14); font-size: .9rem; font-weight: 600; color: var(--ink); }
.side-show:hover { background: var(--bg); }
body.sidebar-hidden .side { display: none; }
body.sidebar-hidden .side-show { display: inline-flex; }
.sec { border-bottom: 1px solid var(--line); }
.sec .head { display: flex; align-items: center; gap: 10px; padding: 11px 8px; cursor: pointer; user-select: none; }
.sec .head:hover { background: var(--bg); }
.sec .head input { margin: 0; }
.sec .ic { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; background: #5b6874; }
.sec .ic svg { width: 15px; height: 15px; }
.sec .lab { flex: 1; font-weight: 600; }
.sec .n { color: var(--ink-soft); font-size: .85rem; font-variant-numeric: tabular-nums; }
.sec .caret { width: 18px; text-align: center; color: var(--ink-soft); transition: transform .15s ease; }
.sec.open .caret { transform: rotate(90deg); }
.sec .sub { display: none; padding: 2px 8px 12px 44px; }
.sec.open .sub { display: block; }
.sec .sub h3 { font-size: .7rem; text-transform: uppercase; letter-spacing: .5px; color: var(--ink-soft); margin: 6px 0 6px; }
.opt { display: flex; align-items: center; gap: 8px; padding: 5px 6px; border-radius: 7px; cursor: pointer; font-size: .9rem; }
.opt:hover { background: var(--bg); }
.opt .dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; }
.opt .oc { margin-left: auto; color: var(--ink-soft); font-size: .8rem; font-variant-numeric: tabular-nums; }
.sec.disabled .lab, .sec.disabled .n { color: #aab2bc; }
.sec.disabled .ic { background: #c7ced6; }

/* Phones: sidebar stacks above a taller map. */
@media (max-width: 640px) {
  body[data-page="home"] #main { flex-direction: column; }
  .side { width: auto; max-height: 42vh; border-right: none; border-bottom: 1px solid var(--line); }
  body[data-page="home"] #map { min-height: 58vh; }
}

.noscript { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; text-align: center; }

/* Detail pages */
.detail { max-width: 720px; margin: 0 auto; padding: 24px 16px 48px; }
.detail h1 { font-size: 1.5rem; margin: 6px 0 16px; }
.crumb { margin: 0; font-size: 0.9rem; }
.crumb a { text-decoration: none; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 0 0 20px; }
.facts div { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.facts dt { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--ink-soft); margin: 0 0 4px; }
.facts dd { margin: 0; font-weight: 600; }
.detail #map { height: 320px; border-radius: 10px; border: 1px solid var(--line); }

/* Footer */
.site-footer {
  flex: 0 0 auto; padding: 14px 16px;
  background: var(--surface); border-top: 1px solid var(--line);
  font-size: 0.85rem; color: var(--ink-soft);
}
.site-footer p { margin: 4px 0; }
.site-footer .attrib { font-size: 0.8rem; }

/* On the map page the footer would eat the map; keep it compact there. */
body[data-page="home"] #main { min-height: 0; }
