/* bundestagsdaten.de — near-monochrome chrome; color appears only in chart marks */

:root {
  --surface: #fcfcfb;
  --panel: #f6f5f1;
  --ink: #1b1a17;
  --ink2: #52514e;
  --muted: #898781;
  --hairline: #e3e1d9;
  --accent: #4a5590; /* muted blue-violet, a nod to the plenary chamber seats */
  --max: 62rem;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.55;
}

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.shell { max-width: var(--max); margin: 0 auto; padding: 0 1.25rem; }

/* header */

.site-header { border-bottom: 1px solid var(--hairline); }
.site-header .shell {
  display: flex; justify-content: space-between; align-items: baseline;
  padding-top: 1rem; padding-bottom: 1rem; gap: 1rem; flex-wrap: wrap;
}
.wordmark {
  font-weight: 700; letter-spacing: 0.01em; color: var(--ink);
  text-decoration: none; font-size: 1.05rem;
}
.wordmark .tld { color: var(--muted); font-weight: 400; }
.unofficial { font-size: 0.8rem; color: var(--muted); }

/* hero */

.hero { padding: 3.5rem 0 2.5rem; }
.eyebrow {
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--muted); margin: 0 0 0.9rem;
}
h1 {
  font-size: clamp(2.1rem, 5.5vw, 3.4rem); line-height: 1.05;
  letter-spacing: -0.02em; font-weight: 750; margin: 0 0 1rem; max-width: 24ch;
}
.lede { font-size: 1.12rem; color: var(--ink2); max-width: 58ch; margin: 0; }

.stats {
  display: flex; flex-wrap: wrap; gap: 2.5rem;
  margin-top: 2.25rem; padding-top: 1.5rem; border-top: 1px solid var(--hairline);
}
.stat .value { font-size: 1.7rem; font-weight: 650; letter-spacing: -0.01em; }
.stat .label { font-size: 0.82rem; color: var(--muted); }

/* wahlperioden switcher */

.wp-switch {
  display: inline-flex; align-items: center; gap: 0;
  margin: 1.75rem 0 0; padding: 0; border: 1px solid var(--hairline); border-radius: 6px;
  overflow: hidden;
}
.wp-switch legend {
  float: left; /* keep the legend inline inside the fieldset box */
  padding: 0.35rem 0.8rem; font-size: 0.8rem; color: var(--muted);
  border-right: 1px solid var(--hairline);
}
.wp-switch label {
  padding: 0.35rem 0.9rem; font-size: 0.88rem; cursor: pointer;
  color: var(--ink2); border-right: 1px solid var(--hairline);
}
.wp-switch label:last-child { border-right: 0; }
.wp-switch input { position: absolute; opacity: 0; pointer-events: none; }
.wp-switch label:has(input:checked) {
  background: var(--ink); color: var(--surface); font-weight: 600;
}
.wp-switch label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: -2px; }

/* trend line charts */

.trend { margin-top: 2rem; }
.trend h3 { margin-bottom: 0.2rem; }
.trend .note { font-size: 0.88rem; margin: 0 0 0.75rem; max-width: 62ch; }
.chart svg { display: block; width: 100%; height: auto; }
.chart svg:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.chart .gridline { stroke: var(--hairline); stroke-width: 1; }
.chart .tick-label, .chart .wp-label { font-size: 11px; fill: var(--muted); }
.chart .end-label { font-size: 11.5px; fill: var(--ink2); font-weight: 600; }
.chart .series { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .wp-mark { stroke: var(--hairline); stroke-width: 1; }
.chart .crosshair { stroke: var(--muted); stroke-width: 1; visibility: hidden; }
.chart .cross-dot { visibility: hidden; stroke: var(--surface); stroke-width: 2; }

/* sections */

section { padding: 2.75rem 0; border-top: 1px solid var(--hairline); }
h2 { font-size: 1.45rem; letter-spacing: -0.01em; margin: 0 0 0.35rem; }
.section-sub { color: var(--ink2); margin: 0 0 1.75rem; max-width: 62ch; }
.section-sub small, .note { color: var(--muted); }

.columns { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; }
@media (max-width: 44rem) { .columns { grid-template-columns: 1fr; } }

/* matrix (heatmap as CSS grid) */

.matrix-wrap { max-width: 34rem; }
.matrix { display: grid; gap: 2px; margin-top: 0.5rem; }
.matrix .corner { display: flex; align-items: flex-end; justify-content: flex-end; }
.matrix .corner span {
  font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted); text-align: right; padding: 0 0.3rem 0.2rem 0;
}
.matrix .col-head, .matrix .row-head {
  font-size: 0.8rem; color: var(--ink2); align-self: center;
}
.matrix .col-head { text-align: center; padding-bottom: 0.35rem; align-self: end; }
.matrix .row-head { text-align: right; padding-right: 0.6rem; white-space: nowrap; }
.matrix .cell {
  border: 0; padding: 0; margin: 0; font: inherit; cursor: default;
  aspect-ratio: 1.35; min-height: 2.6rem;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.88rem; font-variant-numeric: tabular-nums;
  border-radius: 2px;
}
.matrix .cell:hover, .matrix .cell:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.axis-hint { font-size: 0.78rem; color: var(--muted); margin: 0.6rem 0 0; }

.reading {
  margin: 1.25rem 0 0; padding: 0.8rem 1rem;
  background: var(--panel); border-left: 2px solid var(--accent);
  font-size: 0.95rem; color: var(--ink2); max-width: 34rem; min-height: 3.4rem;
}
.reading strong { color: var(--ink); font-weight: 650; }

/* bar lists (HTML bars) */

.bars { display: grid; gap: 0.45rem; margin: 0; }
.bar-row {
  display: grid; grid-template-columns: minmax(9rem, 14rem) 1fr; gap: 0.75rem;
  align-items: center;
}
.bar-row dt {
  font-size: 0.85rem; text-align: right; color: var(--ink2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 0;
}
.bar-row dt .party-tag { color: var(--muted); }
.bar-row dd { margin: 0; display: flex; align-items: center; gap: 0.5rem; }
.bar {
  height: 16px; border-radius: 0 4px 4px 0; /* rounded data-end, square baseline */
  min-width: 2px;
}
.bar-value {
  font-size: 0.82rem; color: var(--ink2); font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.legend { display: flex; flex-wrap: wrap; gap: 0.4rem 1.1rem; margin: 1.25rem 0 0; padding: 0; list-style: none; }
.legend li { display: flex; align-items: center; gap: 0.4rem; font-size: 0.8rem; color: var(--ink2); }
.swatch { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }

/* quotes */

.quote-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 0.85rem; }
.quote-list .quote { font-size: 1.02rem; }
.quote-list .attrib { font-size: 0.82rem; color: var(--muted); }
.quote-list .count { color: var(--muted); font-variant-numeric: tabular-nums; }

/* tooltip */

.tooltip {
  position: fixed; z-index: 10; pointer-events: none;
  background: var(--ink); color: var(--surface);
  padding: 0.45rem 0.65rem; border-radius: 4px; font-size: 0.8rem;
  max-width: 18rem; opacity: 0; transition: opacity 80ms linear;
}
.tooltip.visible { opacity: 1; }
.tooltip .tip-value { font-weight: 650; font-size: 0.92rem; }
@media (prefers-reduced-motion: reduce) { .tooltip { transition: none; } }

/* footer */

.site-footer { border-top: 1px solid var(--hairline); padding: 2rem 0 3rem; margin-top: 2.5rem; }
.site-footer p { font-size: 0.85rem; color: var(--muted); max-width: 62ch; margin: 0.3rem 0; }
