/* AllePeilingen.com — modern & licht (approved design option B).
   White cards on #f7f8fa, red round logo accent, system font stack.
   Hand-written, no framework. Chart + ad containers have FIXED heights (CLS). */

:root {
    --bg: #f7f8fa;
    --card: #ffffff;
    --ink: #1c1e21;
    --muted: #6b7280;
    --border: #e2e4e8;
    --accent: #d22222;
    --radius: 10px;
    --shadow: 0 1px 2px rgba(16, 24, 40, 0.06);
    --maxw: 1080px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.55;
}

a { color: inherit; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }

/* ---------- header / nav ---------- */
.site-header {
    position: sticky; top: 0; z-index: 30;
    display: flex; align-items: center; gap: 1.25rem;
    background: var(--card); border-bottom: 1px solid var(--border);
    padding: 0.6rem 1.25rem;
}
.site-header__logo {
    display: flex; align-items: center; gap: 0.5rem;
    font-weight: 700; font-size: 1.05rem; text-decoration: none; white-space: nowrap;
}
.site-header__logo::before {
    content: ""; width: 22px; height: 22px; border-radius: 50%;
    background: var(--accent); flex: none;
}
.site-header__logo span { color: var(--muted); font-weight: 400; }
.site-header__nav { display: flex; gap: 0.25rem; flex-wrap: wrap; }
.site-header__nav a {
    text-decoration: none; color: var(--muted); font-size: 0.95rem;
    padding: 0.35rem 0.7rem; border-radius: 999px;
}
.site-header__nav a:hover { color: var(--ink); background: var(--bg); }
.site-header__nav a[aria-current="page"] { color: var(--ink); background: var(--bg); font-weight: 600; }
.site-freshness { margin-left: auto; font-size: 0.8rem; color: var(--muted); text-align: right; white-space: nowrap; }

main { max-width: var(--maxw); margin: 0 auto; padding: 1.5rem 1.25rem 3rem; }
h1 { font-size: 1.55rem; margin: 0.5rem 0 0.25rem; }
h2 { font-size: 1.15rem; margin: 2rem 0 0.75rem; }
main > p { color: var(--muted); max-width: 62ch; }

/* ---------- cards & charts ---------- */
.card {
    background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow);
    padding: 1rem 1.25rem; margin: 1rem 0;
}
.chart { height: 420px; margin: 1rem 0; }
.card .chart { margin: 0.25rem 0; }
.chart--loading { display: grid; place-items: center; color: var(--muted); }
.chart--loading::after { content: "grafiek laden\2026"; }
.chart--error { display: grid; place-items: center; color: var(--muted); font-size: 0.9rem; }
.chart-note { color: var(--muted); font-size: 0.8rem; margin: 0.25rem 0 1rem; }

/* ---------- images (legacy news articles embed native-size images) ---------- */
img { max-width: 100%; height: auto; }

/* ---------- tables (SSR fallback + data views) ---------- */
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
caption { text-align: left; color: var(--muted); font-size: 0.85rem; padding-bottom: 0.4rem; }
th, td { text-align: left; padding: 0.45rem 0.6rem; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; font-size: 0.85rem; }
tbody tr:hover { background: var(--bg); }

/* ---------- seat cards ---------- */
.seat-cards td:first-child a {
    display: inline-flex; align-items: center; gap: 0.5rem;
    text-decoration: none; font-weight: 600;
}
.seat-cards td:first-child a::before {
    content: ""; width: 10px; height: 10px; border-radius: 3px;
    background: var(--party-color, var(--muted)); flex: none;
}
.delta--plus { color: #1a7f37; font-weight: 600; }
.delta--min { color: #b3261e; font-weight: 600; }
.delta--nul { color: var(--muted); }

/* ---------- small multiples ---------- */
.multiples { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.75rem; margin: 1rem 0; }
.multiple {
    background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 0.5rem 0.75rem;
}
.multiple h3 { margin: 0 0 0.25rem; font-size: 0.85rem; }
.multiple h3 a { text-decoration: none; }
.multiple .mini { height: 96px; }

/* ---------- feed ---------- */
.feed ul { list-style: none; margin: 0; padding: 0; }
.feed li {
    background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 0.6rem 0.9rem; margin: 0.5rem 0; font-size: 0.92rem;
}
.feed li strong { color: var(--ink); margin-right: 0.4rem; }
.feed li time { color: var(--muted); font-size: 0.8rem; margin-left: 0.4rem; }
.feed li a { font-size: 0.85rem; margin-left: 0.5rem; }
.feed__links { margin-top: 0.75rem; font-size: 0.9rem; }
.feed__links a { margin-right: 1rem; }

/* ---------- listing (index) pages ---------- */
.listing { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0.75rem; padding: 0; list-style: none; }
.listing li { margin: 0; }
.listing a {
    display: block; background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 0.7rem 1rem; text-decoration: none; font-weight: 600;
}
.listing a small { display: block; color: var(--muted); font-weight: 400; font-size: 0.8rem; }

/* ---------- ads: reserved heights, never inside chart cards (CLS) ---------- */
.ad-slot { display: grid; place-items: center; color: var(--muted); overflow: hidden; }
.ad-slot--leaderboard { min-height: 100px; margin: 0.75rem auto; max-width: var(--maxw); }
.ad-slot--incontent { min-height: 250px; margin: 1.5rem 0; }

/* ---------- toast ---------- */
.toast {
    position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(120%);
    background: var(--ink); color: #fff; border-radius: 999px;
    padding: 0.6rem 1.2rem; font-size: 0.92rem; box-shadow: 0 4px 14px rgba(0,0,0,0.25);
    transition: transform 0.25s ease; z-index: 50;
}
.toast--visible { transform: translateX(-50%) translateY(0); }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--border); color: var(--muted); font-size: 0.85rem; }
.site-footer > p { max-width: var(--maxw); margin: 0 auto; padding: 1rem 1.25rem; }
.site-footer nav { max-width: var(--maxw); margin: 0 auto; padding: 0 1.25rem 1.25rem; display: flex; gap: 1rem; flex-wrap: wrap; }
.site-footer nav a { color: var(--muted); text-decoration: none; }

/* ---------- responsive ---------- */
@media (max-width: 720px) {
    /* Logo above a single scrollable nav row (no hamburger): stacking gives the
       nav the full width; nowrap + overflow-x keeps the header ~2 rows tall
       instead of ~4 wrapped rows eating a third of the viewport. */
    .site-header { padding: 0.5rem 0.9rem; gap: 0.35rem; flex-direction: column; align-items: stretch; }
    .site-header__nav {
        flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .site-header__nav::-webkit-scrollbar { display: none; }
    .site-header__nav a { white-space: nowrap; flex: none; }
    .site-freshness { display: none; }
    main { padding: 1rem 0.9rem 2.5rem; }
    .chart { height: 320px; }
    .ad-slot--leaderboard { min-height: 60px; }
    th, td { padding: 0.4rem 0.45rem; font-size: 0.9rem; }
}

@media print {
    .site-header, .site-footer, .feed, .ad-slot, .toast { display: none; }
}
