/* Count Atlas (LAB-32). Tokens: VP Design, design-t1-count-atlas-spain-2026-11-06.md §1 (Teal accent, Lior 6 Nov 2026)
   and the template's type scale and components (design-t1-template-and-tokens-2026-11-06.md). No web font and
   nothing fetched from the stylesheet (page rules). Contrast ratios are Design's [computed] values, not measured. */

:root {
  --lab-paper: #faf8f4;
  --lab-ink: #1a1a1a;
  --lab-ink-muted: #4a4a4a;
  --lab-notice: #efede6;
  --lab-quote: #e9f0ee;
  --lab-accent: #17524e;
  --lab-data: #3d5559;
  --lab-border: #6b6b6b;
  --lab-rule: #8a8a8a;
  --lab-error: #9b1c1c;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 100%;
}

body {
  margin: 0 auto;
  max-width: 40rem;
  padding: 0 1rem 3rem;
  background: var(--lab-paper);
  color: var(--lab-ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1.125rem;
  line-height: 1.55;
}

@media (min-width: 600px) {
  body {
    padding: 0 1.5rem 3rem;
  }
}

h1,
h2,
h3 {
  font-weight: 600;
  line-height: 1.25;
}
h1 {
  font-size: 1.75rem;
}
h2 {
  font-size: 1.375rem;
  margin-top: 2rem;
}
h3 {
  font-size: 1.1875rem;
}
@media (min-width: 600px) {
  h1 {
    font-size: 2.25rem;
  }
  h2 {
    font-size: 1.625rem;
  }
  h3 {
    font-size: 1.25rem;
  }
}

a {
  color: var(--lab-accent);
  text-decoration: underline;
}
a:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--lab-ink);
  outline-offset: 2px;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -10rem;
  background: var(--lab-paper);
  padding: 0.5rem;
}
.skip:focus {
  top: 0.5rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  padding: 0.75rem 0;
}
.wordmark {
  color: var(--lab-ink);
  font-size: 1.25rem;
  font-weight: 600;
  text-decoration: none;
}
.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.langs {
  margin: 0;
}
.langs a[aria-current="page"] {
  font-weight: 600;
}

.notice {
  background: var(--lab-notice);
  border: 1px solid var(--lab-border);
  border-radius: 4px;
  padding: 0.75rem;
  font-size: 1rem;
}
.notice p {
  margin: 0.25rem 0;
}

.lede {
  font-size: 1.125rem;
}

.facts div {
  margin: 0.5rem 0;
}
.facts dt {
  font-weight: 600;
}
.facts dd {
  margin: 0;
}

.source-line {
  color: var(--lab-ink-muted);
  font-size: 1rem;
}

.table-wrap {
  overflow-x: auto;
}
/* VP Design, 7 Nov 2026: the D'Hondt table is wider than a phone. The region is focusable (keyboard scroll), shows
   a focus ring, and carries edge shadows while more columns are hidden (the paper-coloured covers move with the
   content, so a shadow shows only on a side that can still scroll). */
.scroll-region {
  /* the containing block of the visually hidden seat labels: without it, an absolutely positioned label escapes
     the overflow and widens the page (round A2, 7 Nov 2026: 430 px at 360) */
  position: relative;
  background:
    linear-gradient(to right, var(--lab-paper) 30%, transparent) left center / 2rem 100% no-repeat local,
    linear-gradient(to left, var(--lab-paper) 30%, transparent) right center / 2rem 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, color-mix(in srgb, var(--lab-ink) 30%, transparent), transparent)
      left center / 0.75rem 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, color-mix(in srgb, var(--lab-ink) 30%, transparent), transparent)
      right center / 0.75rem 100% no-repeat scroll;
  background-color: var(--lab-paper);
}
.scroll-region:focus-visible {
  outline: 2px solid var(--lab-accent);
  outline-offset: 2px;
}
.scroll-hint {
  display: none;
  color: var(--lab-ink-muted);
  font-size: 1rem;
  margin-bottom: 0;
}
@media (max-width: 36rem) {
  .scroll-hint {
    display: block;
  }
}
.won .seat-mark {
  color: var(--lab-accent);
  margin-left: 0.25rem;
}
table {
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
  line-height: 1.4;
  margin: 1rem 0;
}
caption {
  text-align: left;
  font-weight: 600;
  padding-bottom: 0.25rem;
}
th,
td {
  border-bottom: 1px solid var(--lab-rule);
  padding: 0.25rem 0.75rem 0.25rem 0;
  text-align: left;
  vertical-align: top;
}
td {
  text-align: right;
}
table:not([data-generated]) td {
  text-align: left;
}

.box {
  border: 1px solid var(--lab-border);
  border-radius: 4px;
  padding: 0 0.75rem 0.5rem;
  margin-top: 2rem;
}

.night-frame {
  background: var(--lab-quote);
  border-left: 4px solid var(--lab-accent);
  padding: 0.5rem 0.75rem;
}
/* D7: the height the election-night table needs, reserved before the night (no layout shift when it is
   filled). Sized for about 12 list rows; the number of lists on the night is unknown. */
.night-reserved {
  min-height: 34rem;
}

.site-footer {
  border-top: 1px solid var(--lab-rule);
  margin-top: 3rem;
  font-size: 1rem;
}
