/* Swedish Temperature Records — dashboard styles.
   Editorial / data-journalism look: white ground, near-black text, one warm and
   one cool accent, generous whitespace, a single sans-serif stack. */

:root {
  --ink: #1a1a1a;
  --ink-soft: #555;
  --ink-faint: #888;
  --line: #e4e4e4;
  --bg: #ffffff;
  --bg-soft: #fafafa;
  --hot: #c0392b;
  --cold: #2c6fbb;
  --maxw: 920px;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  font-size: 18px;
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ── header ─────────────────────────────────────────────────────────────── */
header.site {
  border-bottom: 1px solid var(--line);
  padding: 56px 0 40px;
}
header.site h1 {
  font-size: 2.4rem;
  line-height: 1.15;
  margin: 0 0 12px;
  letter-spacing: -0.02em;
}
header.site .sub {
  font-size: 1.15rem;
  color: var(--ink-soft);
  max-width: 38em;
  margin: 0;
  text-align: justify;
}
.stamp {
  margin-top: 18px;
  font-size: 0.82rem;
  color: var(--ink-faint);
  letter-spacing: 0.01em;
}
.stamp .dot { color: var(--hot); }

/* ── sections ───────────────────────────────────────────────────────────── */
section { padding: 48px 0; border-bottom: 1px solid var(--line); }
section:last-of-type { border-bottom: none; }
h2 {
  font-size: 1.5rem;
  letter-spacing: -0.01em;
  margin: 0 0 6px;
}
.lede { font-size: 1.05rem; color: var(--ink-soft); max-width: 40em; margin: 0 0 24px; text-align: justify; }
.kicker {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ink-faint);
  margin: 0 0 8px;
}

/* big plain-language statement */
.statement {
  font-size: 1.7rem;
  line-height: 1.4;
  font-weight: 500;
  max-width: 24em;
  margin: 8px 0 36px;
  letter-spacing: -0.01em;
}
.statement .hot { color: var(--hot); font-weight: 700; }
.statement .cold { color: var(--cold); font-weight: 700; }
.statement ul { margin: 8px 0 36px; padding-left: 1.1em; list-style: disc; }
.statement li { margin-bottom: 0.45em; }
.statement li::marker { color: var(--ink-faint); }

/* stat cards — a fixed 2×3 grid (six facts) */
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.card { background: var(--bg); padding: 22px 20px; }
.card .num { font-size: 2rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1; }
.card .num.hot { color: var(--hot); }
.card .num.cold { color: var(--cold); }
.card .lab { font-size: 0.85rem; color: var(--ink-soft); margin-top: 8px; }

/* ── charts ─────────────────────────────────────────────────────────────── */
.chart { width: 100%; }
.chart.tall { min-height: 560px; }
.chart.med { min-height: 440px; }
.spiral-video { display: block; width: 100%; max-width: 600px; margin: 4px auto 0; background: #fff; }
.note { font-size: 0.85rem; color: var(--ink-faint); margin-top: 12px; max-width: 42em; text-align: justify; }

/* spiral controls */
.controls {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 8px 0 4px;
  flex-wrap: wrap;
}
.controls button {
  font-family: var(--sans);
  font-size: 0.9rem;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: #fff;
  padding: 8px 18px;
  border-radius: 999px;
  cursor: pointer;
}
.controls button:hover { background: #000; }
.controls input[type="range"] { flex: 1 1 220px; accent-color: var(--hot); }

/* segmented Tmax/Tmin toggle */
.controls .seg { display: inline-flex; border: 1px solid var(--ink); border-radius: 999px; overflow: hidden; }
.controls .seg button { border: 0; border-radius: 0; background: #fff; color: var(--ink); padding: 8px 16px; }
.controls .seg button.active { background: var(--ink); color: #fff; }
.controls .seg button:not(.active):hover { background: #f0f0f0; }
.controls .yearout {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 1.1rem;
  min-width: 3.2em;
}

/* ── table ──────────────────────────────────────────────────────────────── */
table.records { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
table.records th, table.records td { text-align: right; padding: 10px 12px; border-bottom: 1px solid var(--line); }
table.records th:first-child, table.records td:first-child { text-align: left; }
table.records thead th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-faint); }
table.records td.hot { color: var(--hot); font-weight: 600; }
table.records td.cold { color: var(--cold); font-weight: 600; }
table.records tbody tr:hover { background: var(--bg-soft); }

/* ── footer ─────────────────────────────────────────────────────────────── */
footer.site {
  padding: 44px 0 72px;
  font-size: 0.9rem;
  color: var(--ink-soft);
}
footer.site h3 { font-size: 0.95rem; margin: 0 0 6px; color: var(--ink); }
footer.site .cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 28px;
}
footer.site a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
footer.site a:hover { color: var(--hot); }
footer.site .fine { margin-top: 28px; font-size: 0.8rem; color: var(--ink-faint); }

/* loading / error */
.status { padding: 60px 0; color: var(--ink-faint); font-size: 1rem; }
.status.err { color: var(--hot); }

@media (max-width: 600px) {
  body { font-size: 16px; }
  header.site h1 { font-size: 1.9rem; }
  .statement { font-size: 1.35rem; }
  .card .num { font-size: 1.6rem; }
  .cards { grid-template-columns: repeat(2, 1fr); }   /* 2×3 → 2-wide on phones */
}
