/* ==========================================================================
   112 Meldingen Vandaag — design system (op basis van de zustersites, blauw)
   ========================================================================== */
:root {
    --blue:       #1d4ed8;
    --blue-dark:  #1e3a8a;
    --blue-soft:  #eff6ff;
    --amber:      #d97706;
    --amber-soft: #fff4e2;
    --green:      #2a9d8f;
    --cyan:       #0891b2;
    --purple:     #7c3aed;
    --red:        #dc2626;
    --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(--blue-dark); }

/* ---------- Header / nav ---------- */
.header {
    background: linear-gradient(180deg, #1b2230 0%, #232c3d 100%);
    border-bottom: 3px solid var(--blue);
    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.2rem; letter-spacing: -.01em; }
.brand__mark { font-size: 1.3rem; filter: drop-shadow(0 2px 4px rgba(29,78,216,.5)); }
.brand__text span { color: #60a5fa; }

.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: .9rem; padding: 8px 11px; 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(--blue); }

.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: 900px) {
    .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(29,78,216,.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); color: #bfdbfe; }

.pill { display: inline-flex; align-items: center; gap: 6px; background: var(--blue-soft); color: var(--blue-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(150px, 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; }

/* ---------- 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(--blue-dark); }
.link-card p { margin: 0; color: var(--muted); font-size: .92rem; }

/* ---------- Meldingen (volledige kaart) ---------- */
.melding { background: var(--card); border: 1px solid var(--line); border-left: 5px solid var(--blue); 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; }
.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; }
.melding__context { margin: 8px 0 0; color: var(--ink-soft); line-height: 1.6; font-size: .95rem; }

/* Compacte regel voor brand/ongeval (link naar de zustersite, geen eigen kaart) */
.melding--kort { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 16px; margin-bottom: 8px; font-size: .95rem; }
.melding--kort .tijd { font-weight: 700; color: var(--muted); font-size: .85rem; }
.melding--kort .melding--kort__tekst { color: var(--ink-soft); flex: 1; min-width: 160px; }
.melding--kort a.zusterlink { font-weight: 700; text-decoration: none; white-space: nowrap; }
.melding--kort a.zusterlink:hover { text-decoration: underline; }

/* Badges: soort-kleuren */
.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(--blue); }
.badge--scale { background: var(--amber); color: #4a2c00; }
.badge--wijk  { background: var(--blue); }
.badge--soft  { background: #eef1f6; color: var(--ink-soft); }
.badge--vandaag { background: var(--blue-dark); }
.badge--live  { background: #15803d; }
.badge--groot { background: var(--red); }
.badge--heli  { background: #0f766e; }
.badge--soort-ambulance     { background: var(--blue); }
.badge--soort-brand         { background: var(--red); }
.badge--soort-ongeval       { background: var(--amber); color: #4a2c00; }
.badge--soort-water         { background: var(--cyan); }
.badge--soort-hulpverlening { background: var(--purple); }
.badge--soort-politie       { background: var(--blue-dark); }

/* ---------- 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(29,78,216,.35); border-color: var(--blue); }
.btn { display: inline-block; background: var(--blue); 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(--blue-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 { width: 100%; max-width: 420px; text-align: center; }
.buurt-cta .btn--big[disabled] { opacity: .6; cursor: default; }
.buurt-cta .section-note { margin-top: 10px; min-height: 1.2em; }
@media (max-width: 560px) { .buurt-cta .btn--big { width: 100%; max-width: none; } }

/* ---------- 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); }
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(--blue-soft) !important; }
.rank { color: var(--muted); font-variant-numeric: tabular-nums; }
@media (max-width: 560px){ th, td { padding: 9px 10px; } table { font-size: .9rem; } .content { padding-left: 18px; padding-right: 18px; } td { overflow-wrap: anywhere; } }

/* ---------- Bar chart (CSS) ---------- */
.bar-row { display: grid; grid-template-columns: 130px 1fr auto; gap: 12px; align-items: center; margin-bottom: 9px; }
.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(--blue), #3b82f6); 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-fill--cyan  { background: linear-gradient(90deg, var(--cyan), #67e8f9); }
.bar-fill--purple{ background: linear-gradient(90deg, var(--purple), #c4b5fd); }
.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, #3b82f6, var(--blue)); min-height: 3px; position: relative; }
.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 ---------- */
.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; }

.insight { background: var(--blue-soft); border: 1px solid #bfdbfe; border-radius: 10px; padding: 14px 16px; margin: 14px 0; color: var(--ink-soft); font-size: 1rem; }
.insight strong { color: var(--blue-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(--blue); 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(--blue-soft); color: var(--blue-dark); border-color: #bfdbfe; }

/* ---------- Footer ---------- */
.footer { background: #1b2230; color: #b7c0cf; margin-top: 48px; }
.footer__inner { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr; gap: 26px; 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: 860px){ .footer__inner { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px){ .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; }

/* ---------- plaats.php: "nu"-status, buurt- en stratenlijst ---------- */
.hero .nu { background: var(--blue-soft); border-left: 5px solid var(--blue); border-radius: 12px; padding: 14px 18px; margin-top: 14px; }
.hero .nu__kop { font-weight: 700; font-size: 1.15rem; color: var(--ink); }
.hero .nu__tekst { line-height: 1.6; margin: 6px 0 0; color: var(--ink-soft); max-width: none; }
.hero .nu__meta { font-size: .82rem; color: var(--muted); margin: 8px 0 0; }
.hero .nu__meta a { font-weight: 600; color: var(--blue-dark); }

.melding.melding--vandaag { border-left-width: 6px; border-left-color: var(--blue-dark); background: linear-gradient(135deg, var(--blue-soft), var(--card) 55%); }

.buurt, .wegen, .straten-lijst { list-style: none; margin: 14px 0 4px; padding: 0; }
.buurt li, .wegen li, .straten-lijst li { border-bottom: 1px solid var(--line); padding: 9px 0; }
.buurt li:last-child, .wegen li:last-child, .straten-lijst li:last-child { border-bottom: 0; }
.buurt__tijd { font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; margin-right: 6px; }
.buurt__wat { color: var(--ink-soft); }
.buurt__meer { margin-left: 6px; font-weight: 600; white-space: nowrap; }

@media (max-width: 560px) {
    .hero .nu { padding: 12px 14px; }
    .hero .nu__kop { font-size: 1.05rem; }
    .buurt li, .wegen li { font-size: .92rem; }
}

.nieuws-lijst { list-style: none; margin: 12px 0 4px; padding: 0; }
.nieuws-lijst li { border-bottom: 1px solid var(--line); padding: 9px 0; line-height: 1.5; }
.nieuws-lijst li:last-child { border-bottom: 0; }
.nieuws-lijst a { font-weight: 600; text-decoration: none; }
.nieuws-lijst a:hover { text-decoration: underline; }
.nieuws-meta { display: block; color: var(--muted); font-size: .85rem; }

.hero__cta, .hero__buurt { display: inline-flex; align-items: center; gap: 8px; margin: 14px 0 0; padding: 12px 18px; border-radius: 999px; background: var(--blue); color: #fff; font-weight: 700; text-decoration: none; box-shadow: var(--shadow-sm); }
.hero__cta:hover, .hero__buurt:hover { background: var(--blue-dark); color: #fff; }
@media (max-width: 700px) { .hero__intro { display: none; } }

/* ---------- trends.php ---------- */
.trend-item { border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; margin-bottom: 12px; background: var(--card); box-shadow: var(--shadow-sm); }
.trend-item__kop { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 6px; }
.trend-item__term { font-weight: 800; font-size: 1.05rem; }
.trend-item__traffic { color: var(--muted); font-size: .85rem; }

/* ---------- ellende-index.php ---------- */
.ellende-rank { display: flex; align-items: center; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.ellende-rank:last-child { border-bottom: 0; }
.ellende-rank__pos { font-weight: 800; color: var(--muted); width: 30px; text-align: right; font-variant-numeric: tabular-nums; }
.ellende-rank__naam { flex: 1; font-weight: 700; }
.ellende-rank__naam a { text-decoration: none; }
.ellende-rank__score { font-weight: 800; color: var(--blue-dark); font-variant-numeric: tabular-nums; }
.ellende-rank__n { color: var(--muted); font-size: .85rem; }
.ellende-wacht { background: var(--amber-soft); border: 1px solid #f2dcae; border-radius: 12px; padding: 18px 20px; margin: 18px 0; color: #7a4a00; }
