/* ---------------------------------------------------------------------------
   Forecast accuracy pages (/accuracy/), written by scripts/bake-accuracy.mjs.

   Loaded after site.css, which keeps the shared nav, the buttons, the skip link
   and the colophon. These pages are the Scoreboard's readable twin, so the rest
   follows the Scoreboard and the design rules (app repo,
   design-system/docs/design-rules.md): sizes from the app's type scale, numbers
   in text colours and the same face as the words, the answer largest, the
   leading row at full strength, the standings on the one raised surface and the
   supporting sections on the sheet.
--------------------------------------------------------------------------- */

.acc {
  /* The app's textSize (theme.ts), as the Scoreboard names it. */
  --fs-2xs: 10px;
  --fs-xs: 11px;
  --fs-sm: 12px;
  --fs-base: 13px;
  --fs-md: 14px;
  --fs-lg: 17px;
  --fs-xl: 20px;
  --fs-2xl: 24px;
  --fs-3xl: 34px;
  --fs-hero: 52px; /* heroNumberSize: the one number a page answers with */
  --r-sm: 6px;
  --r-tile: 12px;
  --r-card: 14px;
  --numeric: tabular-nums lining-nums;
  font-size: var(--fs-md);
  line-height: 1.5;
}
.acc .num { font-family: inherit; font-variant-numeric: var(--numeric); }

.acc-main { max-width: 760px; padding-top: 20px; }

.acc-crumbs { font-size: var(--fs-base); color: var(--text-3); }
.acc-crumbs a { color: var(--text-2); text-decoration: none; }
.acc-crumbs a:hover { color: var(--text); text-decoration: underline; }

/* ── The answer ─────────────────────────────────────────────────────────── */
.acc-answer {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 20px;
  margin-top: 18px;
}
.acc-answer-index { grid-template-columns: minmax(0, 1fr); }
.acc-score {
  grid-row: span 2;
  font-size: var(--fs-hero);
  font-weight: 300;
  line-height: 0.9;
  letter-spacing: -0.04em;
}
.acc-of { margin-left: 3px; font-size: var(--fs-md); font-weight: 400; letter-spacing: 0; color: var(--text-3); }
.acc-answer h1 { font-size: var(--fs-2xl); font-weight: 650; letter-spacing: -0.01em; }
.acc-answer-index h1 { font-size: var(--fs-3xl); letter-spacing: -0.015em; }
.acc-sub { margin-top: 8px; max-width: 44em; color: var(--text-2); }
.acc-source { grid-column: 2; margin-top: 10px; font-size: var(--fs-base); color: var(--text-3); }

/* ── Sections ───────────────────────────────────────────────────────────── */
.acc-sec { margin-top: 36px; }
/* The SectionHeader eyebrow: the one uppercase line per section. */
.acc-h {
  margin: 0 0 8px 2px;
  font-size: var(--fs-xs);
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
}
.acc-cap { margin-top: 8px; max-width: 60em; font-size: var(--fs-sm); color: var(--text-3); }
.acc-lede { margin-bottom: 10px; max-width: 44em; color: var(--text-2); }
.acc-lede b, .acc-qa b, .acc-tally b { color: var(--text); font-weight: 600; }

.acc-card { background: var(--sheet); border-radius: var(--r-card); padding: 4px 16px 8px; }
.acc-primary { background: var(--surface); border: 1px solid var(--surface-light); }
.acc-scroll { overflow-x: auto; }

.acc abbr { text-decoration: none; }

.acc-nil {
  display: inline-block; width: 10px; height: 2px; border-radius: 1px;
  background: var(--text-3); opacity: 0.6; vertical-align: middle;
}

/* ── Standings and the index (the Scoreboard's table) ───────────────────── */
.acc-table { width: 100%; border-collapse: collapse; white-space: nowrap; }
.acc-table th, .acc-table td {
  padding: 9px 14px 9px 0;
  border-bottom: 1px solid var(--surface-mid);
  text-align: left;
  font-weight: 400;
  color: var(--text-2);
}
.acc-table thead th {
  padding: 12px 14px 8px 0;
  border-bottom-color: var(--surface-light);
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--text-3);
}
.acc-table tbody:last-child tr:last-child > * { border-bottom: 0; }
.acc-table .c-n { text-align: right; }
.acc-table .c-rank { width: 1.6rem; color: var(--text-3); }
.acc-table td.c-skill { font-weight: 650; }
.m-label { font-weight: 600; }
.m-prov { margin-left: 4px; font-size: var(--fs-sm); color: var(--text-3); }
.acc-table tr.is-top > *, .acc-table tr.is-top .c-rank { color: var(--text); }
.acc-table tr.is-top .m-label, .acc-table tr.is-top .c-skill { font-size: var(--fs-lg); }
.acc-table tr.is-top .c-skill { font-weight: 700; }

.acc-index .c-place a { color: var(--text); font-weight: 600; text-decoration: none; }
.acc-index .c-place a:hover { text-decoration: underline; }
.p-station { display: block; font-size: var(--fs-sm); color: var(--text-3); }
.acc-index .c-model .m-label { color: var(--text); }
.acc-index td.c-skill { color: var(--text); }
.acc-group th {
  padding: 16px 0 6px;
  border-bottom-color: var(--surface-light);
  font-size: var(--fs-base);
  font-weight: 650;
  color: var(--text);
}

/* ── Best by weather: three questions, each answered, separated by rules ── */
.acc-qa { margin: 0; padding: 2px 16px; }
.acc-qa div { padding: 11px 0; border-bottom: 1px solid var(--surface-mid); }
.acc-qa div:last-child { border-bottom: 0; }
.acc-qa h3 { margin-bottom: 3px; font-size: var(--fs-base); font-weight: 600; line-height: 1.35; color: var(--text-3); }
.acc-qa p { color: var(--text-2); }

/* ── Lead grid: the Scoreboard's absolute brightness ramp ───────────────── */
.acc-lead { width: 100%; border-collapse: separate; border-spacing: 3px; }
.acc-lead th { font-size: var(--fs-xs); font-weight: 600; color: var(--text-3); text-align: center; }
.acc-lead tbody th {
  padding-right: 8px;
  text-align: left;
  white-space: nowrap;
  font-size: var(--fs-sm);
  color: var(--text-2);
}
.acc-lead td {
  height: 26px;
  min-width: 34px;
  border-radius: var(--r-sm);
  text-align: center;
  font-size: var(--fs-sm);
  font-weight: 700;
}
.ramp-0 { background: #33497a; color: #f2f6fc; }
.ramp-1 { background: #3d64ab; color: #f2f6fc; }
.ramp-2 { background: #4a80dd; color: #0b101c; }
.ramp-3 { background: #619cff; color: #0b101c; }
.ramp-4 { background: #94bcff; color: #0b101c; }
.lg-x { background: rgba(148, 163, 184, 0.06); }

/* ── How it was measured, and the method ────────────────────────────────── */
.acc-how { margin-top: 32px; padding-top: 14px; border-top: 1px solid var(--surface-light); }
.acc-how summary { cursor: pointer; font-weight: 600; color: var(--text); }
.acc-how-body { display: grid; gap: 10px; margin-top: 10px; color: var(--text-2); }
.acc-how-body p, .acc-method p { max-width: 44em; }
.acc-method h3 { margin: 18px 0 4px; font-size: var(--fs-md); font-weight: 650; }
.acc-method p { color: var(--text-2); }
.acc-method p + p { margin-top: 8px; }

.acc-tally li { padding: 8px 0; border-bottom: 1px solid var(--surface-mid); color: var(--text-2); }
.acc-tally li:last-child { border-bottom: 0; }
.acc-in { display: block; font-size: var(--fs-sm); color: var(--text-3); }

/* ── The app, and the other places ──────────────────────────────────────── */
.acc-app { margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--surface-light); }
.acc-app h2 { font-size: var(--fs-xl); font-weight: 650; }
.acc-app p { margin-top: 6px; max-width: 44em; color: var(--text-2); }
.acc .acc-stores { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.acc .btn { padding: 10px 16px; border-radius: var(--r-tile); font-size: var(--fs-md); }

.acc-places { margin-top: 36px; }
.acc-places-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px 24px; }
.acc-places h3 { margin-bottom: 4px; font-size: var(--fs-sm); font-weight: 600; color: var(--text-3); }
.acc-places ul { display: grid; gap: 2px; }
.acc-places a { color: var(--text-2); text-decoration: none; }
.acc-places a:hover { color: var(--text); text-decoration: underline; }

.acc .colophon { margin-top: 48px; font-size: var(--fs-sm); }

/* ── Phones ─────────────────────────────────────────────────────────────── */
@media (max-width: 560px) {
  .acc-answer { column-gap: 14px; }
  .acc-score { font-size: var(--fs-hero); }
  .acc-of { display: block; margin: 6px 0 0; font-size: var(--fs-sm); }
  .acc-answer h1 { font-size: var(--fs-xl); }
  .acc-answer-index h1 { font-size: var(--fs-2xl); }
  .acc-source { grid-column: 1 / -1; }
  .acc-card { padding-inline: 12px; }
  .acc-table th, .acc-table td { padding-right: 10px; }
  .acc-table .m-prov, .acc-table .c-rec, .acc-index .c-next { display: none; }
  .acc-lead td { min-width: 30px; }
}
