/* eu-begroting — "Is Europa duur?"
   Licht, journalistiek, rustig — in de stijl van usa-vs-eu. Eén accent per hoofdrolspeler:
   EU = blauw, Nederland = oranje, ontvangers = groen, verleden/overig = violet, rest neutraal grijs.
   Donkere modus via prefers-color-scheme; de chartkleuren lezen dezelfde variabelen uit. */

:root {
    color-scheme: light dark;
    --page:      #f9f9f7;
    --surface:   #fcfcfb;
    --ink:       #0b0b0b;
    --ink-2:     #52514e;
    --muted:     #898781;
    --grid:      #e1e0d9;
    --baseline:  #c3c2b7;
    --border:    rgba(11, 11, 11, 0.10);
    --tip-bg:    #0b0b0b;
    --tip-fg:    #ffffff;
    --eu:        #2a78d6;
    --eu-pale:   #86b6ef;
    --nl:        #eb6834;
    --green:     #1f9d7a;
    --violet:    #4a3aa7;
    --neutral:   #b5b3ac;
    --maxw:      42rem;
    --font:      system-ui, -apple-system, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
    :root {
        --page:      #121211;
        --surface:   #1a1a19;
        --ink:       #f1f0ec;
        --ink-2:     #c2c0b8;
        --muted:     #8f8d85;
        --grid:      #2c2c2a;
        --baseline:  #45443f;
        --border:    rgba(255, 255, 255, 0.10);
        --tip-bg:    #f1f0ec;
        --tip-fg:    #0b0b0b;
        --eu:        #4a8fe6;
        --eu-pale:   #2b5a95;
        --nl:        #e06a3c;
        --green:     #2aa583;
        --violet:    #8a7de0;
        --neutral:   #5d5c56;
    }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
}

body {
    margin: 0;
    background: var(--page);
    color: var(--ink);
    font-family: var(--font);
    font-size: 1.0625rem;
    line-height: 1.65;
    -webkit-text-size-adjust: 100%;
}

a { color: var(--eu); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { filter: brightness(0.85); }

em { font-style: italic; }
strong { font-weight: 700; }

/* ---------- taal-toggle ---------- */

.lang-switch {
    position: fixed;
    top: 0.9rem;
    right: 0.9rem;
    z-index: 50;
    display: inline-flex;
    background: var(--surface);
    border: 1px solid var(--baseline);
    border-radius: 999px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(11, 11, 11, 0.06);
}
.lang-switch a {
    display: block;
    padding: 0.35rem 0.8rem;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--ink-2);
    text-decoration: none;
}
.lang-switch a + a { border-left: 1px solid var(--grid); }
.lang-switch a[aria-current="true"] {
    background: var(--ink);
    color: var(--page);
}
.lang-switch a:focus-visible {
    outline: 2px solid var(--eu);
    outline-offset: -2px;
}

/* ---------- layout ---------- */

.step, .footer-inner {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 3.5rem 1.25rem;
}

section.step { padding-top: 4rem; padding-bottom: 4rem; }

.step-kicker {
    margin: 0 0 0.35rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
}

h1 {
    margin: 0.5rem 0 1rem;
    font-size: clamp(2.1rem, 7vw, 3.4rem);
    line-height: 1.1;
    letter-spacing: -0.02em;
}

h2 {
    margin: 0 0 1rem;
    font-size: clamp(1.45rem, 4.5vw, 1.9rem);
    line-height: 1.2;
    letter-spacing: -0.01em;
}

h3 {
    margin: 0 0 0.6rem;
    font-size: 1.02rem;
    color: var(--ink-2);
}

p { margin: 0 0 1rem; }

/* ---------- hero ---------- */

.hero {
    min-height: 88vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-top: 4rem;
}

.hero .kicker {
    margin: 0;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
}

h1 em { font-style: italic; color: var(--eu); }

.hero-sub {
    font-size: clamp(1.1rem, 3.4vw, 1.3rem);
    color: var(--ink-2);
    margin-bottom: 1.25rem;
}

.hero-intro { color: var(--ink-2); max-width: 36rem; }

.chip {
    font-weight: 600;
    white-space: nowrap;
    border-bottom: 3px solid;
    padding-bottom: 1px;
}
.chip-eu { border-color: var(--eu); }
.chip-nl { border-color: var(--nl); }
.chip-green { border-color: var(--green); }

.scroll-hint {
    margin-top: 2.5rem;
    font-size: 0.85rem;
    color: var(--muted);
}
.scroll-hint .chev {
    display: inline-block;
    margin-left: 0.4rem;
    animation: bob 1.8s ease-in-out infinite;
}
@keyframes bob {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(5px); }
}
@media (prefers-reduced-motion: reduce) {
    .scroll-hint .chev { animation: none; }
}

/* ---------- kerncijfers (stat-tegels) ---------- */

.stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin: 1.5rem 0 0;
    padding: 0;
    list-style: none;
}
@media (min-width: 640px) {
    .stats { grid-template-columns: repeat(4, 1fr); }
}
.stats li {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.9rem 1rem;
}
.stats .num {
    display: block;
    font-size: clamp(1.5rem, 5vw, 2rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}
.stats .lbl {
    display: block;
    margin-top: 0.3rem;
    font-size: 0.8rem;
    color: var(--muted);
    line-height: 1.4;
}

/* ---------- tijdlijn ---------- */

.timeline {
    list-style: none;
    margin: 1.5rem 0 0;
    padding: 0 0 0 1.25rem;
    border-left: 2px solid var(--grid);
}
.timeline li {
    position: relative;
    padding: 0 0 1.1rem 0.9rem;
}
.timeline li::before {
    content: "";
    position: absolute;
    left: calc(-1.25rem - 6px);
    top: 0.5rem;
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--eu);
    border: 2px solid var(--page);
}
.timeline li.muted::before { background: var(--neutral); }
.timeline .yr {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}
.timeline .txt { color: var(--ink-2); font-size: 0.95rem; }

/* ---------- scroll-reveal (alleen met JS + zonder reduced-motion) ---------- */

.anim-ready .step {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.anim-ready .step.in-view {
    opacity: 1;
    transform: none;
}

/* ---------- charts ---------- */

figure.chart { margin: 1.75rem 0 0; }

.chart-box {
    position: relative;
    height: 300px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem 1rem 0.75rem;
}

.chart-box--short { height: 220px; }
.chart-box--half  { height: 260px; }
.chart-box--rank  { height: 440px; padding-right: 0.5rem; }
.chart-box--xl    { height: 720px; } /* 27 lidstaten in de ranglijsten */

figcaption {
    margin-top: 0.6rem;
    font-size: 0.82rem;
    color: var(--muted);
    line-height: 1.5;
}
figcaption .fn { display: block; }

.chart-pair { display: grid; gap: 1.75rem; margin-top: 1.75rem; }
.chart-pair figure.chart { margin: 0; }
@media (min-width: 760px) {
    .chart-pair { grid-template-columns: 1fr 1fr; align-items: start; }
}

/* ---------- toggles ---------- */

.toggle {
    display: inline-flex;
    flex-wrap: wrap;
    border: 1px solid var(--baseline);
    border-radius: 999px;
    overflow: hidden;
    margin: 0.25rem 0 0.5rem;
    background: var(--surface);
}
.toggle button {
    appearance: none;
    border: 0;
    background: transparent;
    font: 600 0.88rem var(--font);
    color: var(--ink-2);
    padding: 0.45rem 1.1rem;
    cursor: pointer;
}
.toggle button[aria-pressed="true"] {
    background: var(--ink);
    color: var(--page);
}
.toggle button:focus-visible {
    outline: 2px solid var(--eu);
    outline-offset: -2px;
}

/* ---------- legenda-chips ---------- */

.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.1rem;
    margin: 0.75rem 0 0;
    padding: 0;
    list-style: none;
    font-size: 0.82rem;
    color: var(--ink-2);
}
.legend li { display: inline-flex; align-items: center; gap: 0.4rem; }
.legend .sw {
    width: 12px; height: 12px;
    border-radius: 3px;
    display: inline-block;
}
.sw-eu { background: var(--eu); }
.sw-nl { background: var(--nl); }
.sw-green { background: var(--green); }
.sw-violet { background: var(--violet); }
.sw-neutral { background: var(--neutral); }
.sw-pale { background: var(--eu-pale); }

/* ---------- tabellen & uitklappers ---------- */

details.data-table, details.about-figures {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--ink-2);
}
details summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--ink-2);
}
details summary:hover { color: var(--ink); }

.data-table table {
    width: 100%;
    margin-top: 0.75rem;
    border-collapse: collapse;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    font-variant-numeric: tabular-nums;
}
.data-table th, .data-table td {
    text-align: right;
    padding: 0.45rem 0.75rem;
    border-bottom: 1px solid var(--grid);
}
.data-table th:first-child, .data-table td:first-child { text-align: left; }
.data-table th {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    font-weight: 600;
}
.data-table tr:last-child td { border-bottom: 0; }
.data-table tr.hl td { font-weight: 700; color: var(--ink); }

.about-figures ul { padding-left: 1.2rem; }
.about-figures li { margin-bottom: 0.6rem; }

/* ---------- conclusie ---------- */

.summary {
    list-style: none;
    padding: 0;
    margin: 0 0 1.25rem;
}
.summary li {
    padding: 0.8rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 0.6rem;
}

.closing {
    font-size: 1.12rem;
    line-height: 1.6;
    border-left: 4px solid var(--nl);
    padding-left: 1rem;
    color: var(--ink);
}

.myth {
    border-left: 4px solid var(--violet);
    padding: 0.2rem 0 0.2rem 1rem;
    margin: 1.25rem 0;
    color: var(--ink-2);
}
.myth strong { color: var(--ink); }

/* ---------- footer ---------- */

.site-footer {
    border-top: 1px solid var(--grid);
    background: var(--surface);
    margin-top: 2rem;
}
.footer-inner { padding-top: 2.5rem; padding-bottom: 2.5rem; font-size: 0.9rem; color: var(--ink-2); }
.site-footer h2 { font-size: 1rem; margin: 1.5rem 0 0.5rem; }
.site-footer h2:first-child { margin-top: 0; }
.site-footer ul { padding-left: 1.2rem; margin: 0 0 1rem; }
.site-footer li { margin-bottom: 0.45rem; }
.footer-note { margin-bottom: 0.5rem; }
.colophon {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--grid);
    font-size: 0.82rem;
    color: var(--muted);
}

/* ---------- toegankelijkheid ---------- */

.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}
