/* /vis/allheimen: skvip.lols folketeljing, dressed as an official statistics
 * bulletin. A black masthead over a census-red rule, a form for the key
 * figures, numbered tables, a rotated stamp.
 *
 * Loaded after /vis/vis.css, whose skip link, focus ring and breadcrumb it
 * keeps. Like the rest of /vis it follows prefers-color-scheme: tokens are
 * declared on :root and redeclared for dark, and nothing below them names a
 * colour. Blue is every ordinary bar; red is the answer to read, the side
 * thread and the stamp. Measured pairs are in test/contrast.test.js. */

:root {
  --bg: #eef0ec;
  --panel: #ffffff;
  --ink: #0b0c0c;
  --muted: #4a4f4a;
  --line: #c9ccc6;
  --spor: #e3e5e0;
  --bla: #1f4e79;
  --raud: #b3261e;
  --lenke: #1f4e79;
  --fokus: #b3261e;
  --topp: #0b0c0c;
  --topp-ink: #ffffff;
  --topp-muted: #c9ccc6;

  --f-tekst: "IBM Plex Sans", system-ui, sans-serif;
  --f-disp: "IBM Plex Sans Condensed", "Arial Narrow", sans-serif;
  --f-data: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121513;
    --panel: #1a1e1c;
    --ink: #eceee9;
    --muted: #a9aea8;
    --line: #343a37;
    --spor: #2a302d;
    --bla: #7fb0e0;
    --raud: #ff7468;
    --lenke: #9cc4ec;
    --fokus: #ff7468;
    --topp: #000000;
    --topp-ink: #ffffff;
    --topp-muted: #b9bdb7;
  }
}

body { background: var(--bg); color: var(--ink); font: 16px/1.5 var(--f-tekst); margin: 0; }
a { color: var(--lenke); }

.ah-topp { background: var(--topp); color: var(--topp-ink); border-bottom: 6px solid var(--raud); }
.ah-topp-indre { max-width: 1160px; margin: 0 auto; padding: 14px 16px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; }
.ah-merke { display: flex; align-items: center; gap: 12px; font: 600 18px/1.15 var(--f-disp); }
.ah-merke small { font-size: inherit; font-weight: 500; color: var(--topp-muted); }
.ah-merke svg { fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linejoin: round; flex: none; }
.ah-skjema { font: 13px var(--f-data); color: var(--topp-muted); }

.ah-side { max-width: 1160px; margin: 0 auto; padding: 16px 16px 48px; }
.ah-side .vis-sti { margin: 4px 0 0; }

.ah-helt { display: flex; flex-wrap: wrap; gap: 24px 32px; align-items: flex-start; padding: 24px 0; }
.ah-helt-tekst { flex: 999 1 520px; min-width: 0; }
.ah-dato { font: 13px var(--f-data); color: var(--muted); margin: 0 0 12px; }
.ah-helt h1 { font: 700 clamp(34px, 5vw, 52px)/1.03 var(--f-disp); margin: 0 0 16px; text-wrap: balance; }
.ah-ingress { font-size: 19px; margin: 0; max-width: 60ch; }
.ah-stempel {
  flex: 1 1 220px; max-width: 250px; margin: 12px auto 0; transform: rotate(-7deg);
  border: 3px solid var(--raud); color: var(--raud); padding: 12px 16px; text-align: center;
  font-family: var(--f-disp); line-height: 1.1; display: flex; flex-direction: column; gap: 6px;
}
.ah-stempel b { font-size: 26px; font-weight: 700; text-transform: uppercase; }
.ah-stempel span { font: 600 14px var(--f-data); }
.ah-stempel small { font-size: 13px; font-weight: 500; }

.ah-felt { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); background: var(--panel); border: 2px solid var(--ink); margin: 8px 0 32px; }
.ah-felt > div { padding: 16px 18px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.ah-felt dt { font: 12px var(--f-data); color: var(--muted); }
.ah-felt dd { margin: 4px 0 0; font: 600 44px/1.05 var(--f-disp); white-space: nowrap; }

.ah-seksjon { padding: 32px 0; }
.ah-kvit { background: var(--panel); border-block: 1px solid var(--line); box-shadow: 0 0 0 100vmax var(--panel); clip-path: inset(0 -100vmax); }
.ah-tabnr { font: 600 13px var(--f-data); color: var(--raud); margin: 0; }
.ah-seksjon h2, .ah-kort h2 { font: 600 clamp(26px, 3.4vw, 34px)/1.1 var(--f-disp); margin: 4px 0 20px; text-wrap: balance; }
.ah-to { display: flex; flex-wrap: wrap; gap: 32px; }
.ah-to > * { flex: 999 1 520px; min-width: 0; }
.ah-to > .ah-sidetekst { flex: 1 1 260px; display: flex; flex-direction: column; gap: 14px; }
.ah-sidetekst p { margin: 0; }
.ah-merknad { font-size: 14px; color: var(--muted); }

.ah-stort { display: flex; gap: 14px; align-items: flex-start; border-left: 4px solid var(--raud); padding-left: 14px; margin: 0; }
.ah-stort b { font: 700 40px/1 var(--f-disp); color: var(--raud); white-space: nowrap; }
.ah-stort span { font-size: 14px; color: var(--muted); }

/* Table 1: one column per poll. */
.ah-suler { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; align-items: end; height: 300px; border-bottom: 2px solid var(--ink); }
.ah-sule { display: flex; flex-direction: column; justify-content: flex-end; height: 100%; text-align: center; position: relative; }
.ah-sule-tal { font: 600 26px/1 var(--f-disp); }
.ah-sule-pst { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.ah-sule-bar { display: block; background: var(--bla); }
.ah-sule.ah-hi .ah-sule-bar { background: var(--raud); }
.ah-sule-namn { position: absolute; top: 100%; left: 0; right: 0; padding-top: 8px; font-size: 13px; line-height: 1.3; overflow-wrap: anywhere; }
.ah-sule-namn small { display: block; font-size: 12px; color: var(--muted); }
.ah-suler { margin-bottom: 52px; }

/* Table 2. */
.ah-tabell { overflow-x: auto; background: var(--panel); border: 2px solid var(--ink); }
.ah-tabell table, .ah-enkel { width: 100%; border-collapse: collapse; font-size: 15px; }
.ah-tabell thead th { background: var(--ink); color: var(--bg); text-align: left; font-weight: 600; padding: 10px 12px; }
.ah-tabell th, .ah-tabell td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; font-weight: 400; }
.ah-tabell td:nth-child(2) { color: var(--muted); }
.ah-tabell tfoot th, .ah-tabell tfoot td { border-top: 2px solid var(--ink); border-bottom: 0; font-weight: 600; }
.ah-smal { display: none; }
.ah-tabell th[scope="row"] { overflow-wrap: anywhere; }
.ah-tal-k { text-align: right !important; font-family: var(--f-data); white-space: nowrap; }
.ah-boks { border: 1px dashed var(--ink); background: var(--panel); padding: 14px; }
.ah-boks p { margin: 0; }
.ah-boks-tittel { font: 12px var(--f-data); color: var(--muted); }
.ah-boks-tal { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 4px !important; }
.ah-boks-tal span { display: flex; flex-direction: column; font-size: 13px; color: var(--muted); }
.ah-boks-tal b { font: 600 32px/1.1 var(--f-disp); color: var(--ink); }

/* Tables 3 to 8: one form card each. */
.ah-kort-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 500px), 1fr)); gap: 24px; padding: 8px 0 40px; }
.ah-kort { background: var(--panel); border: 2px solid var(--ink); padding: 22px 22px 18px; display: flex; flex-direction: column; gap: 12px; }
.ah-kort h2 { font-size: 26px; margin: 0; }
.ah-kort > p { margin: 0; font-size: 15px; }
.ah-kort-topp { display: flex; justify-content: space-between; gap: 12px; font: 13px var(--f-data); color: var(--muted); }
.ah-kort .ah-stort { border-left: 0; border-top: 1px solid var(--line); padding: 12px 0 0; }
.ah-kort .ah-stort b { font-size: 36px; }
.ah-rader { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ah-rad { display: grid; grid-template-columns: 10em minmax(0, 1fr) 5.2em; gap: 10px; align-items: center; font-size: 15px; }
.ah-spor { height: 22px; background: var(--spor); }
.ah-fyll { display: block; height: 100%; background: var(--bla); }
.ah-rad.ah-hi .ah-fyll { background: var(--raud); }
.ah-rad.ah-hi .ah-rad-namn { font-weight: 600; }
.ah-rad-tal { text-align: right; font: 14px var(--f-data); white-space: nowrap; }
.ah-rad-tal small { font-size: inherit; color: var(--muted); }

/* Table 9 and method. */
.ah-enkel th, .ah-enkel td { padding: 8px 0; border-bottom: 1px solid var(--line); text-align: left; font-weight: 400; }
.ah-metode { margin: 0; padding-left: 1.3em; font-size: 15px; display: flex; flex-direction: column; gap: 8px; }

.ah-botn { background: var(--topp); color: var(--topp-muted); font-size: 14px; }
.ah-botn > div { max-width: 1160px; margin: 0 auto; padding: 28px 16px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.ah-botn span:last-child { font-family: var(--f-data); }

@media (max-width: 520px) {
  .ah-rad { grid-template-columns: 7.5em minmax(0, 1fr) 4.8em; font-size: 14px; }
  .ah-suler { gap: 6px; height: 240px; }
  .ah-sule-tal { font-size: 20px; }
  .ah-sule-namn { font-size: 11px; }
  .ah-felt dd { font-size: 38px; }
  .ah-kort { padding: 18px 16px 16px; }
  .ah-tabell thead th:nth-child(2), .ah-tabell td:nth-child(2) { display: none; }
  .ah-smal { display: block; font-size: 13px; color: var(--muted); }
  .ah-tabell th, .ah-tabell td { padding: 8px 10px; font-size: 14px; }
}
