/* De roos in Midden-Groningen
   Wit vlak, één rood (dat van het PvdA-logo), zwarte tekst. Koppen in Archivo, leestekst in Literata.
   Het rode stempotlood is een SVG-lijn met een korrelfilter (#pot, staat in elke pagina). */

:root {
  --rood: #E12B1A;          /* het rood van het PvdA-logo */
  --rood-donker: #B42215;   /* voor links en kleine tekst op wit */
  --rood-diep: #8C1B10;
  --inkt: #1a1a1a;
  --grijs: #555;
  --vlak: #f4f4f4;
  --lijn: #e4e4e4;
  --wit: #fff;
  --kop: 'Archivo', Arial, sans-serif;
  --lees: 'Literata', Georgia, serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--wit); color: var(--inkt); font-family: var(--kop); line-height: 1.5; }
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p, figure, blockquote, ul { margin: 0; }
a { color: var(--rood-donker); }
a:hover { color: #7a150b; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--inkt); outline-offset: 3px; }

.filters { position: absolute; width: 0; height: 0; }

.wrap { max-width: 1240px; margin: 0 auto; padding: 40px clamp(16px, 4vw, 48px) 64px; display: flex; flex-direction: column; gap: 56px; }
.eyebrow { font-size: 15px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.reuzekop { font-weight: 800; font-size: clamp(44px, 7vw, 96px); line-height: .96; letter-spacing: -.02em; color: var(--rood); }
.sectiekop { font-weight: 800; font-size: 36px; line-height: 1.1; }
.lees { font-family: var(--lees); font-size: 19px; line-height: 1.6; max-width: 620px; }

/* ---------- Rood stempotlood ---------- */
.woord { position: relative; display: inline-block; }
.woord.heel { white-space: nowrap; }
.potlood { position: absolute; overflow: visible; filter: url(#pot); mix-blend-mode: multiply; opacity: .92; pointer-events: none; }
.potlood path { fill: none; stroke: var(--rood); stroke-linecap: round; }
.potlood.cirkel { left: -12%; top: -30%; width: 124%; height: 160%; }
.potlood.cirkel path { stroke-width: 7; stroke-dasharray: 700; }
.potlood.cirkel path + path { stroke-width: 4; opacity: .5; }
.potlood.streep { left: 0; bottom: -9px; width: 100%; height: 14px; }
.potlood.streep path { stroke-width: 5; vector-effect: non-scaling-stroke; }
.potlood.dubbel { left: -3%; bottom: -9px; width: 106%; height: 16px; }
.potlood.dubbel path { stroke-width: 4.5; vector-effect: non-scaling-stroke; }
@keyframes teken { from { stroke-dashoffset: 700; } to { stroke-dashoffset: 0; } }

/* Het potlood tekent zichzelf zodra een aantekening in beeld komt (js/potlood.js).
   tekenen: het script draait. tekent: deze aantekening wordt nu getekend. getekend: ze staat er. */
html.tekenen .potlood:not(.tekent):not(.getekend), html.tekenen .krijt:not(.tekent):not(.getekend) { visibility: hidden; }
.potlood.streep.tekent { animation: veeg var(--duur, .7s) cubic-bezier(.45, 0, .3, 1) both; }
.potlood.dubbel.tekent, .krijt.tekent { animation: veeg-dubbel var(--duur, 1.2s) both; }
.potlood.cirkel.tekent path { animation: teken .9s cubic-bezier(.4, 0, .3, 1) both; }
.potlood.cirkel.tekent path + path { animation-duration: .65s; animation-delay: .8s; }
/* Een streep verschijnt van links naar rechts. De marge van 30px laat de korrel aan de randen heel. */
@keyframes veeg {
  from { clip-path: inset(-30px 100% -30px -30px); }
  to { clip-path: inset(-30px -30px -30px -30px); }
}
/* Een dubbele streep: eerst de bovenste lijn, dan de onderste. */
@keyframes veeg-dubbel {
  0% { clip-path: polygon(-30px -30px, -30px -30px, -30px 53%, -30px 53%, -30px calc(100% + 30px), -30px calc(100% + 30px)); animation-timing-function: cubic-bezier(.45, 0, .3, 1); }
  48%, 56% { clip-path: polygon(-30px -30px, calc(100% + 30px) -30px, calc(100% + 30px) 53%, -30px 53%, -30px calc(100% + 30px), -30px calc(100% + 30px)); animation-timing-function: cubic-bezier(.45, 0, .3, 1); }
  100% { clip-path: polygon(-30px -30px, calc(100% + 30px) -30px, calc(100% + 30px) 53%, calc(100% + 30px) 53%, calc(100% + 30px) calc(100% + 30px), -30px calc(100% + 30px)); }
}

/* ---------- De roos ----------
   Het logo van de PvdA, in tien losse vlakken die van binnen naar buiten openvouwen. */
.roos { flex: none; width: 260px; padding: 0; border: 0; background: none; }
.roos svg { display: block; width: 100%; height: auto; overflow: visible; }
.roos .blad { fill: var(--rood); transform-origin: 100px 100px; animation: open 1.3s cubic-bezier(.2, .7, .2, 1) both; animation-delay: var(--d, 0s); }
.roos.klaar .blad { animation: none; }
.roos.dicht .blad { animation: none; transform: scale(.12) rotate(-60deg); opacity: 0; }
@keyframes open { from { transform: scale(.12) rotate(-60deg); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Hoofdpagina: inleiding ---------- */
.intro { display: flex; flex-wrap: wrap; align-items: center; gap: 24px 64px; }
.intro-tekst { flex: 999 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.openingszin { max-width: 720px; font-weight: 600; font-size: clamp(22px, 2.4vw, 30px); line-height: 1.35; }
.spring { display: flex; flex-wrap: wrap; gap: 8px 28px; font-weight: 600; font-size: 18px; }
.spring a { padding: 10px 0; }

/* ---------- Zetelteller ---------- */
.cijfers { display: flex; flex-wrap: wrap; align-items: center; gap: 24px 56px; padding: 28px 0; border-top: 1px solid var(--inkt); border-bottom: 1px solid var(--inkt); }
.cijfers-kies { flex: 1 1 240px; display: flex; flex-direction: column; gap: 12px; }
.cijfers-kies h2 { font-weight: 800; font-size: 20px; line-height: 1.25; }
.jaren { display: flex; gap: 12px; }
.jaar { min-width: 64px; min-height: 48px; padding: 10px 6px; border: 0; border-bottom: 4px solid var(--lijn); background: none; font-weight: 600; font-size: 18px; }
.jaar[aria-pressed="true"] { border-bottom-color: var(--rood); color: var(--rood-donker); }
.telling { display: flex; align-items: baseline; gap: 14px; }
.telling strong { font-weight: 800; font-size: 120px; line-height: 1; color: var(--rood); font-variant-numeric: tabular-nums; }
.telling span { font-size: 20px; font-weight: 600; }
.cijfers-uitleg { flex: 999 1 380px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.zetels { display: flex; gap: 3px; }
.zetels span { flex: 1; height: 30px; background: var(--lijn); }
.zetels span.rood { background: var(--rood); }
.cijfers-uitleg .toelichting { font-family: var(--lees); font-size: 17px; line-height: 1.5; }
.bron { font-size: 13px; line-height: 1.5; color: var(--grijs); }

/* ---------- Kaarten: verhalen en kiezers ---------- */
.blok { display: flex; flex-direction: column; gap: 24px; }
.blok-kop { display: flex; flex-direction: column; gap: 12px; }
.verhalen { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 32px; }
.kiezers { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 24px; }
.kaart { display: flex; flex-direction: column; gap: 14px; padding-top: 18px; border-top: 5px solid var(--rood); color: var(--inkt); text-decoration: none; }
.kaart:hover { color: var(--inkt); }
.kaart:hover .titel { color: var(--rood-donker); text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 5px; }
.kaart .beeld { display: grid; place-items: center; aspect-ratio: 16 / 10; background: var(--vlak); font-size: 14px; color: var(--grijs); object-fit: cover; width: 100%; }
.kaart .label { display: flex; align-items: baseline; gap: 12px; font-size: 14px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.kaart .label b { font-weight: 800; font-size: 40px; line-height: 1; letter-spacing: 0; color: var(--rood); }
.kaart .titel { font-weight: 800; font-size: 28px; line-height: 1.12; }
.kaart .samenvatting { font-family: var(--lees); font-size: 17px; line-height: 1.55; }
.kaart .lees-verder { font-weight: 600; font-size: 17px; color: var(--rood-donker); }
.kaart.kiezer { gap: 10px; border-top-width: 3px; }
.kaart.kiezer .beeld { aspect-ratio: 3 / 4; }
.kaart.kiezer .titel { margin-top: 4px; font-size: 21px; line-height: 1.2; }
.kaart.kiezer .wie { font-size: 14px; color: var(--grijs); }
.kaart.kiezer .citaat { font-family: var(--lees); font-size: 16px; line-height: 1.5; }

.voet { display: flex; flex-direction: column; gap: 8px; padding-top: 20px; border-top: 5px solid var(--rood); font-size: 15px; line-height: 1.5; color: var(--grijs); }

/* ---------- Voorwoord (rode pagina) ---------- */
html.rood, body.voorwoord { background: var(--rood); }
.voorwoord { color: var(--wit); }
.voorwoord .wrap { gap: 40px; padding-top: 32px; }
.voorwoord a { color: var(--wit); }
.voorwoord a:hover { color: #ffe3dd; }
.voorwoord :focus-visible { outline-color: var(--wit); outline-offset: 4px; }
.bovenbalk { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 24px; font-size: 15px; font-weight: 600; }
.bovenbalk a { padding: 12px 0; }
.voorwoord-rij { display: flex; flex-wrap: wrap; align-items: center; gap: 24px 48px; }
.voorwoord-tekst { flex: 999 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.voorwoord .reuzekop { color: var(--wit); font-size: clamp(48px, 7vw, 104px); }
.krijt { position: absolute; left: 0; bottom: -14px; width: 100%; height: 16px; overflow: visible; filter: url(#pot); pointer-events: none; }
.krijt path { fill: none; stroke: var(--wit); stroke-width: 5; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.voorwoord-alineas { max-width: 640px; display: flex; flex-direction: column; gap: 16px; font-family: var(--lees); font-size: 20px; line-height: 1.6; }
.ondertekening { font-size: 17px; font-weight: 600; }
.voorwoord a.knop { display: inline-block; margin-top: 8px; padding: 16px 28px; background: var(--wit); color: var(--rood-donker); text-decoration: none; font-weight: 800; font-size: 20px; }
.voorwoord a.knop:hover { background: #ffebe6; color: var(--rood-donker); }
.portret { flex: 0 1 300px; display: flex; flex-direction: column; gap: 10px; }
.portret img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border: 8px solid var(--wit); }
.portret figcaption { font-size: 15px; font-weight: 600; }

/* ---------- Overgang tussen voorwoord en hoofdpagina ----------
   Het rood van het voorwoord is één blad van de roos. De hoofdpagina zoomt uit vanuit dat blad (js/overgang.js). */
.zoomdoek { position: fixed; z-index: 50; inset: 0; display: block; width: 100%; height: 100%; pointer-events: none; }
.wrap[hidden] { display: none; }
/* Het voorwoord als los vel boven de roos: het krimpt mee het blad in. */
.voorwoordlaag { position: fixed; z-index: 60; inset: 0; overflow: hidden; transform-origin: 0 0; will-change: transform, opacity; pointer-events: none; }
.voorwoord.voorwoordlaag .wrap { transition: none; animation: none; }
html.uitzoomen, html.uitzoomen body { background: var(--rood); }
html.uitzoomen .wrap { opacity: 0; }
html.zoomt { overflow-x: hidden; }
html.zoomt .roos { visibility: hidden; }
html.uitzoomen .roos *, html.zoomt .roos * { animation: none; }
.voorwoord .wrap { transform-origin: 50% 320px; transition: opacity .45s ease-in, transform .45s ease-in; }
html.vertrek .voorwoord .wrap, html.aankomst .voorwoord .wrap { will-change: transform, opacity; }
html.vertrek .voorwoord .wrap { opacity: 0; transform: scale(.9); }
html.aankomst .voorwoord .wrap { animation: aankomst .8s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes aankomst { from { opacity: 0; transform: scale(.9); } to { opacity: 1; transform: none; } }

/* ---------- Verhaalpagina's ---------- */
.bovenbalk a { font-weight: 600; }
.artikelkop { display: flex; flex-direction: column; gap: 20px; }
.artikelkop .reuzekop { max-width: 18ch; font-size: clamp(38px, 5.4vw, 72px); line-height: 1; }
.artikelkop .label { display: flex; align-items: baseline; gap: 12px; font-size: 14px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.artikelkop .label b { font-weight: 800; font-size: 40px; line-height: 1; letter-spacing: 0; color: var(--rood); }
.naamregel { font-size: 15px; font-weight: 600; color: var(--grijs); }
.beeldvak { display: grid; place-items: center; width: 100%; aspect-ratio: 16 / 9; padding: 12px; background: var(--vlak); font-size: 14px; text-align: center; color: var(--grijs); }
.artikelbeeld { display: flex; flex-direction: column; gap: 10px; max-width: 960px; }
.artikelbeeld img { width: 100%; }
.artikelbeeld figcaption { font-size: 14px; line-height: 1.45; color: var(--grijs); }
.artikel { display: flex; flex-direction: column; gap: 20px; max-width: 720px; }
.artikel .lees { max-width: none; }
.tussenkop { margin-top: 16px; font-weight: 800; font-size: 28px; line-height: 1.15; }
.vraag { margin-top: 8px; font-weight: 800; font-size: 19px; line-height: 1.45; }
.streamer { margin: 12px 0; padding-left: 22px; border-left: 5px solid var(--rood); font-weight: 800; font-size: clamp(24px, 3vw, 34px); line-height: 1.2; }
.kader { display: flex; flex-direction: column; gap: 12px; margin: 12px 0; padding: 24px; background: var(--vlak); border-top: 5px solid var(--rood); }
.kader h2 { font-weight: 800; font-size: 22px; line-height: 1.2; }
.kader ul { display: flex; flex-direction: column; gap: 6px; padding-left: 20px; font-size: 17px; line-height: 1.5; }
.verder { display: flex; flex-direction: column; gap: 24px; padding-top: 28px; border-top: 1px solid var(--inkt); }
.verder .kaart .titel { font-size: 22px; }

/* ---------- De kiezers ---------- */
.kiezerlijst { display: flex; flex-wrap: wrap; gap: 8px 28px; font-weight: 600; font-size: 18px; }
.kiezerlijst a { padding: 10px 0; }
.kiezerportret { display: grid; grid-template-columns: minmax(200px, 320px) minmax(0, 720px); gap: 24px 56px; padding-top: 28px; border-top: 5px solid var(--rood); scroll-margin-top: 16px; }
.kiezerportret .artikelbeeld .beeldvak, .kiezerportret .artikelbeeld img { aspect-ratio: 3 / 4; object-fit: cover; }
.kiezerportret .tekst { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.kiezerportret .nummer { font-weight: 800; font-size: 40px; line-height: 1; color: var(--rood); }
.kiezerportret h2 { font-weight: 800; font-size: clamp(30px, 3.6vw, 46px); line-height: 1.05; letter-spacing: -.01em; }
.kiezerportret .wie { font-size: 15px; font-weight: 600; color: var(--grijs); }
.kiezerportret .lees { max-width: none; }

@media (max-width: 680px) {
  .kiezerportret { grid-template-columns: 1fr; }
  .kiezerportret .artikelbeeld { max-width: 300px; }
}
@media (max-width: 560px) {
  .roos { width: 170px; }
  .telling strong { font-size: 88px; }
  .sectiekop { font-size: 30px; }
}
@media (prefers-reduced-motion: reduce) {
  .roos .blad { animation: none; }
  .voorwoord .wrap { transition: none; }
}
