/* ==========================================================================
   Ongelukken Vandaag — design system
   ========================================================================== */
:root {
    --red:        #f59e0b;
    --red-dark:   #b45309;
    --red-soft:   #fef3e2;
    --amber:      #f4a340;
    --amber-soft: #fff4e2;
    --green:      #2a9d8f;
    --blue:       #3d7dca;
    --ink:        #1b2230;
    --ink-soft:   #2b3546;
    --muted:      #5b6675;
    --line:       #e6e9ef;
    --bg:         #f3f5f8;
    --card:       #ffffff;
    --radius:     14px;
    --shadow:     0 1px 2px rgba(20,28,45,.05), 0 6px 20px rgba(20,28,45,.06);
    --shadow-sm:  0 1px 3px rgba(20,28,45,.08);
    --maxw:       1080px;
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--ink);
    margin: 0;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0 20px;
}

a { color: var(--red-dark); }

/* ---------- Header / nav ---------- */
.header {
    background: linear-gradient(180deg, #1b2230 0%, #232c3d 100%);
    border-bottom: 3px solid var(--red);
    position: sticky;
    top: 0;
    z-index: 100;
}
.header__inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 64px;
    position: relative;
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #fff;
    font-weight: 800;
    font-size: 1.25rem;
    letter-spacing: -.01em;
}
.brand__mark { font-size: 1.35rem; filter: drop-shadow(0 2px 4px rgba(230,57,70,.5)); }
.brand__text span { color: var(--red); }

.nav__list {
    margin: 0; padding: 0; list-style: none;
    display: flex; align-items: center; gap: 2px;
}
.nav__link {
    display: inline-block;
    color: #cfd6e2;
    text-decoration: none;
    font-weight: 600;
    font-size: .92rem;
    padding: 8px 12px;
    border-radius: 8px;
    transition: color .15s, background .15s;
}
.nav__link:hover { color: #fff; background: rgba(255,255,255,.08); }
.nav__link.active { color: #fff; background: var(--red); }

.nav-toggle { display: none; background: transparent; border: 0; cursor: pointer; padding: .6em; }
.hamburger, .hamburger::before, .hamburger::after {
    display: block; position: relative;
    background: #fff; width: 26px; height: 3px; border-radius: 3px;
    transition: transform .25s ease, opacity .25s ease;
}
.hamburger::before, .hamburger::after { content: ''; position: absolute; left: 0; }
.hamburger::before { top: -8px; }
.hamburger::after  { top: 8px; }

@media (max-width: 860px) {
    .nav-toggle { display: block; }
    .nav__list {
        display: none; position: absolute; right: 0; top: 60px;
        flex-direction: column; align-items: stretch; gap: 0;
        background: #232c3d; min-width: 220px;
        border: 1px solid rgba(255,255,255,.1);
        border-radius: 12px; padding: 8px;
        box-shadow: 0 12px 30px rgba(0,0,0,.35);
    }
    .nav__list--visible { display: flex; }
    .nav__link { padding: 12px 14px; border-radius: 8px; }
    .nav-toggle.open .hamburger { transform: rotate(45deg); }
    .nav-toggle.open .hamburger::before { transform: rotate(90deg); top: 0; }
    .nav-toggle.open .hamburger::after { opacity: 0; }
}

/* ---------- Layout ---------- */
main, .page { padding: 28px 0 10px; }
.content {
    background: var(--card);
    padding: 28px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}
.content > h2:first-child, .content > h1:first-child { margin-top: 0; }

h1 { font-size: 2rem; letter-spacing: -.02em; margin: 0 0 .4em; }
h2 { font-size: 1.4rem; letter-spacing: -.01em; color: var(--ink); margin: 1.8em 0 .7em; }
h3 { font-size: 1.1rem; margin: 1.4em 0 .5em; }
.content > h2 { padding-bottom: .4em; border-bottom: 2px solid var(--line); }
p { margin: 0 0 1em; }
.lead { font-size: 1.1rem; color: var(--muted); }
.muted { color: var(--muted); }

/* ---------- Hero ---------- */
.hero {
    background: radial-gradient(1200px 300px at 15% -20%, rgba(230,57,70,.35), transparent 60%),
                linear-gradient(160deg, #1b2230 0%, #2a3446 100%);
    color: #fff;
    border-radius: var(--radius);
    padding: 34px 30px;
    margin: 28px 0 24px;
    box-shadow: var(--shadow);
}
.hero h1 { color: #fff; margin-bottom: .25em; }
.hero p { color: #c8d0dd; max-width: 60ch; margin-bottom: 0; }
.hero .pill { background: rgba(255,255,255,.12); }

.pill {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--red-soft); color: var(--red-dark);
    font-size: .8rem; font-weight: 700; padding: 5px 12px;
    border-radius: 999px; margin-bottom: 14px;
    text-transform: uppercase; letter-spacing: .04em;
}
.pill--live::before {
    content: ''; width: 8px; height: 8px; border-radius: 50%;
    background: #35e07f; box-shadow: 0 0 0 0 rgba(53,224,127,.7);
    animation: pulse 1.8s infinite;
}
@keyframes pulse { 0%{box-shadow:0 0 0 0 rgba(53,224,127,.7)} 70%{box-shadow:0 0 0 8px rgba(53,224,127,0)} 100%{box-shadow:0 0 0 0 rgba(53,224,127,0)} }

/* ---------- Stat tiles ---------- */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin: 0 0 8px;
}
.stat-grid--hero { margin-top: 22px; }
.stat {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 16px 18px;
    box-shadow: var(--shadow-sm);
}
.hero .stat { background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.14); }
.stat__num { font-size: 2rem; font-weight: 800; line-height: 1.1; letter-spacing: -.02em; }
.hero .stat__num { color: #fff; }
.stat__label { font-size: .85rem; color: var(--muted); margin-top: 2px; }
.hero .stat__label { color: #b7c0cf; }
.stat__sub { font-size: .78rem; color: var(--muted); margin-top: 6px; }
.hero .stat__sub { color: #9fb0c6; }
.stat--accent .stat__num { color: var(--red); }

/* ---------- Cards / grids ---------- */
.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px 24px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
}
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 760px){ .grid-2, .grid-3 { grid-template-columns: 1fr; } }

.link-cards { display: grid; grid-template-columns: repeat(auto-fit,minmax(220px,1fr)); gap: 16px; }
.link-card {
    display: block; text-decoration: none; color: inherit;
    background: var(--card); border: 1px solid var(--line);
    border-radius: 12px; padding: 18px 20px; box-shadow: var(--shadow-sm);
    transition: transform .12s, box-shadow .12s, border-color .12s;
}
.link-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: #d4dae4; }
.link-card h3 { margin: 0 0 4px; color: var(--red-dark); }
.link-card p { margin: 0; color: var(--muted); font-size: .92rem; }

/* ---------- Meldingen ---------- */
.melding {
    background: var(--card);
    border: 1px solid var(--line);
    border-left: 5px solid var(--red);
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 14px;
    box-shadow: var(--shadow-sm);
}
.melding.prio-1 { border-left-color: var(--red); }
.melding.prio-2 { border-left-color: var(--amber); }
.melding.prio-3 { border-left-color: var(--green); }
.melding h2, .melding h3 {
    font-size: 1.08rem; margin: 0 0 6px; color: var(--ink);
    border: 0; padding: 0;
}
.melding .tijd { font-weight: 700; color: var(--muted); font-size: .9rem; font-variant-numeric: tabular-nums; }
.melding .details { margin: 8px 0; display: flex; flex-wrap: wrap; gap: 6px; }
.badge {
    display: inline-block; padding: 3px 10px; border-radius: 999px;
    font-size: .78rem; font-weight: 700; color: #fff; background: var(--muted);
}
.badge--prio  { background: var(--red); }
.badge--scale { background: var(--amber); color: #4a2c00; }
.badge--wijk  { background: var(--blue); }
.badge--soft  { background: #eef1f6; color: var(--ink-soft); }
.narrative { margin-top: 8px; color: var(--ink-soft); line-height: 1.7; }
.melding__more { margin-top: 10px; font-size: .9rem; }
.melding__more a { font-weight: 600; text-decoration: none; }
.melding__more a:hover { text-decoration: underline; }

/* ---------- Forms ---------- */
form.filterbar {
    background: #fbfcfe; border: 1px solid var(--line); border-radius: 12px;
    padding: 14px 16px; margin-bottom: 22px;
    display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
}
form.filterbar label { font-weight: 600; font-size: .9rem; }
input[type=date], input[type=text], select {
    padding: 9px 12px; border: 1px solid #cfd6e2; border-radius: 8px;
    font-size: .95rem; font-family: inherit; background: #fff; color: var(--ink);
}
input:focus, select:focus { outline: 2px solid rgba(230,57,70,.35); border-color: var(--red); }
.btn {
    display: inline-block; background: var(--red); color: #fff;
    border: 0; padding: 10px 18px; border-radius: 8px; cursor: pointer;
    font-weight: 700; font-size: .95rem; text-decoration: none; font-family: inherit;
    transition: background .15s;
}
.btn:hover { background: var(--red-dark); }
.btn--ghost { background: #eef1f6; color: var(--ink); }
.btn--ghost:hover { background: #e2e7ef; }
.btn--big { padding: 14px 26px; font-size: 1.1rem; border-radius: 10px; }
.buurt-cta { margin-top: 18px; }
.buurt-cta .btn--big[disabled] { opacity: .6; cursor: default; }
.buurt-cta .section-note { margin-top: 10px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border-radius: 10px; border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); }
th { background: #f7f8fb; font-weight: 700; color: var(--ink-soft); position: sticky; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fbfcfe; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.highlight { background: var(--red-soft) !important; }
.rank { color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- Bar chart (CSS) ---------- */
.bars { display: flex; flex-direction: column; gap: 9px; margin: 14px 0 4px; }
.bar-row { display: grid; grid-template-columns: 130px 1fr auto; gap: 12px; align-items: center; }
.bar-row__label { font-size: .9rem; color: var(--ink-soft); font-weight: 600; }
.bar-track { background: #eef1f6; border-radius: 6px; height: 22px; overflow: hidden; }
.bar-fill {
    height: 100%; border-radius: 6px;
    background: linear-gradient(90deg, var(--red), #f59e0b);
    min-width: 2px;
}
.bar-fill--amber { background: linear-gradient(90deg, var(--amber), #ffca7a); }
.bar-fill--blue  { background: linear-gradient(90deg, var(--blue), #6ea6e6); }
.bar-fill--green { background: linear-gradient(90deg, var(--green), #5cc5b8); }
.bar-row__val { font-weight: 700; font-variant-numeric: tabular-nums; font-size: .9rem; min-width: 42px; text-align: right; }
@media (max-width: 560px){ .bar-row { grid-template-columns: 92px 1fr auto; } }

/* Vertical bar chart (months) */
.vbars { display: flex; align-items: flex-end; gap: 6px; height: 200px; margin: 18px 0 6px; padding-top: 10px; }
.vbar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; }
.vbar__fill { width: 100%; max-width: 34px; border-radius: 6px 6px 0 0;
    background: linear-gradient(180deg, #f59e0b, var(--red)); min-height: 3px; position: relative; }
.vbar__fill:hover { background: linear-gradient(180deg, #ff8a90, var(--red-dark)); }
.vbar__val { font-size: .72rem; color: var(--muted); margin-bottom: 4px; font-variant-numeric: tabular-nums; }
.vbar__lbl { font-size: .68rem; color: var(--muted); margin-top: 6px; white-space: nowrap; }

/* ---------- Heatmap ---------- */
.heat { overflow-x: auto; }
.heat table { border-collapse: separate; border-spacing: 3px; width: auto; min-width: 100%; }
.heat td, .heat th { border: 0; padding: 0; }
.heat th { background: none; font-size: .72rem; color: var(--muted); font-weight: 600; text-align: center; padding: 2px; }
.heat th.row { text-align: right; padding-right: 8px; min-width: 74px; }
.heat .cell {
    width: 30px; height: 26px; border-radius: 5px; text-align: center;
    font-size: .68rem; color: #33405a;
}
.heat-legend { display: flex; align-items: center; gap: 8px; font-size: .8rem; color: var(--muted); margin-top: 12px; }
.heat-legend span { width: 22px; height: 14px; border-radius: 3px; display: inline-block; }

/* ---------- Callout / tool tip card ---------- */
.callout {
    background: linear-gradient(135deg, var(--amber-soft), #fff);
    border: 1px solid #f2dcae; border-left: 5px solid var(--amber);
    border-radius: 12px; padding: 18px 20px; margin: 22px 0;
}
.callout h3 { margin: 0 0 6px; color: #9a5b00; }
.callout p { margin: 0; color: var(--ink-soft); }
.callout a { font-weight: 700; }

/* Eye-catching CTA naar "in de buurt" (hele banner klikbaar) */
.buurt-banner {
    display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
    background: linear-gradient(135deg, #1b2230, #2a3446);
    border-left: 5px solid var(--red); border-radius: 12px;
    padding: 20px 22px; margin: 22px 0; text-decoration: none;
    transition: transform .15s, box-shadow .15s;
}
.buurt-banner:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.buurt-banner__text { flex: 1; min-width: 220px; }
.buurt-banner__text h3 { margin: 0 0 4px; color: #fff; font-size: 1.15rem; }
.buurt-banner__text p { margin: 0; color: #c8d0dd; font-size: .95rem; max-width: 54ch; }
.buurt-banner .btn { white-space: nowrap; pointer-events: none; }
@media (max-width: 560px) { .buurt-banner .btn { width: 100%; text-align: center; } }

.insight {
    background: var(--red-soft); border: 1px solid #fbe4bb; border-radius: 10px;
    padding: 14px 16px; margin: 14px 0; color: var(--ink-soft); font-size: 1rem;
}
.insight strong { color: var(--red-dark); }

/* ---------- FAQ ---------- */
.faq details {
    background: var(--card); border: 1px solid var(--line); border-radius: 10px;
    padding: 4px 18px; margin-bottom: 10px; box-shadow: var(--shadow-sm);
}
.faq summary { cursor: pointer; font-weight: 700; padding: 12px 0; list-style: none; color: var(--ink); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; float: right; color: var(--red); font-size: 1.2rem; line-height: 1; }
.faq details[open] summary::after { content: '–'; }
.faq details p { margin: 0 0 14px; color: var(--ink-soft); }

/* ---------- Breadcrumb / chips ---------- */
.crumbs { font-size: .85rem; color: var(--muted); margin: 20px 0 4px; }
.crumbs a { text-decoration: none; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.chip {
    display: inline-block; text-decoration: none; font-size: .88rem; font-weight: 600;
    padding: 6px 13px; border-radius: 999px; background: #eef1f6; color: var(--ink-soft);
    border: 1px solid var(--line);
}
.chip:hover { background: var(--red-soft); color: var(--red-dark); border-color: #fbe4bb; }

/* ---------- Footer ---------- */
.footer { background: #1b2230; color: #b7c0cf; margin-top: 48px; }
.footer__inner {
    display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 30px;
    padding: 40px 20px 26px;
}
.footer h4 { color: #fff; margin: 0 0 12px; font-size: 1rem; }
.footer p { margin: 0 0 8px; font-size: .9rem; line-height: 1.6; }
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer li { margin-bottom: 8px; font-size: .9rem; }
.footer a { color: #cfd6e2; text-decoration: none; }
.footer a:hover { color: #fff; text-decoration: underline; }
.footer__bar {
    border-top: 1px solid rgba(255,255,255,.1);
    display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
    max-width: var(--maxw); margin: 0 auto; padding: 16px 20px;
    font-size: .82rem; color: #8b97a9;
}
.footer__bar p { margin: 0; }
@media (max-width: 760px){ .footer__inner { grid-template-columns: 1fr; gap: 22px; } }

/* ---------- Misc ---------- */
.empty-state { text-align: center; color: var(--muted); padding: 30px 10px; }
.section-note { font-size: .88rem; color: var(--muted); margin-top: 6px; }
.tablink { text-decoration: none; font-weight: 600; }
.divider { height: 1px; background: var(--line); margin: 28px 0; border: 0; }
.video-container { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; border-radius: 12px; margin: 18px 0; }
.video-container iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; }
