/* Europa Klimaatkaart */
:root {
    color-scheme: dark;
    --bg: #10141a;
    --paneel: #1a212b;
    --rand: #2c3644;
    --tekst: #e8ecf1;
    --tekst-dim: #94a0af;
    --accent: #4f8fdb;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--tekst);
    display: flex;
    flex-direction: column;
}

/* ---- topbar ---- */
.topbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    padding: .45rem .9rem;
    background: var(--paneel);
    border-bottom: 1px solid var(--rand);
    font-size: .875rem;
    z-index: 1200;
}
.merk { color: var(--tekst); text-decoration: none; font-weight: 650; white-space: nowrap; }
.schaal-tabs { display: flex; gap: .15rem; background: #10141a; border-radius: 8px; padding: .15rem; }
.schaal-tabs .tab {
    padding: .25rem .7rem; border-radius: 6px; color: var(--tekst-dim);
    text-decoration: none;
}
.schaal-tabs .tab.actief { background: var(--accent); color: #fff; }
.tijd-nav { display: flex; align-items: center; gap: .25rem; }
.tijd-nav .periode {
    min-width: 7.2em; text-align: center; font-variant-numeric: tabular-nums;
    font-weight: 650; font-size: 1rem;
}
.tijd-nav .sep { width: .6rem; }
.tijd-nav .periode-invoer {
    background: #232c38; color: var(--tekst); border: 1px solid var(--rand);
    border-radius: 6px; padding: .25rem .45rem; font: inherit;
    font-variant-numeric: tabular-nums; font-weight: 650;
    color-scheme: dark;             /* donkere native datumpicker */
}
.tijd-nav .periode-invoer:hover, .tijd-nav .periode-invoer:focus { border-color: var(--accent); }
.tijd-nav .periode-invoer[type=number] { width: 5.2rem; }
.sep-tekst { color: var(--tekst-dim); padding: 0 .4rem; }
button, select {
    background: #232c38; color: var(--tekst); border: 1px solid var(--rand);
    border-radius: 6px; padding: .28rem .55rem; font: inherit; cursor: pointer;
}
button:hover, select:hover { border-color: var(--accent); }
button.actief { background: var(--accent); border-color: var(--accent); color: #fff; }
.opties { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; }
.opties label { display: inline-flex; align-items: center; gap: .35rem; color: var(--tekst-dim); }
.opties label[hidden] { display: none; }
.modus-toggle {
    display: inline-flex; align-items: center; gap: .4rem;
    color: var(--tekst-dim); cursor: pointer; white-space: nowrap;
}
.modus-toggle input { accent-color: var(--accent); }
.modus-toggle:has(input:checked) { color: var(--tekst); }
.acties { margin-left: auto; display: flex; align-items: center; gap: .8rem; }
.acties a { color: var(--tekst-dim); text-decoration: none; }
.acties a:hover { color: var(--tekst); }

/* ---- Meer-menu ---- */
.menu { position: relative; }
.menu summary {
    list-style: none; cursor: pointer; user-select: none;
    background: #232c38; color: var(--tekst); border: 1px solid var(--rand);
    border-radius: 6px; padding: .28rem .55rem;
}
.menu summary::-webkit-details-marker { display: none; }
.menu summary:hover, .menu[open] summary { border-color: var(--accent); }
.menu-paneel {
    position: absolute; right: 0; top: calc(100% + .5rem); width: 250px;
    background: var(--paneel); border: 1px solid var(--rand); border-radius: 10px;
    padding: .9rem; display: flex; flex-direction: column; gap: .9rem;
    box-shadow: 0 10px 28px rgba(0, 0, 0, .5); z-index: 1300;
}
.menu-kop { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--tekst-dim); }
.menu-groep { display: flex; flex-direction: column; gap: .45rem; align-items: flex-start; }
.menu-rij { display: flex; gap: .5rem; }
.menu-veld { display: flex; justify-content: space-between; align-items: center; gap: .6rem; color: var(--tekst-dim); }
.menu-check { display: flex; align-items: center; gap: .45rem; cursor: pointer; }
.menu-check input { accent-color: var(--accent); }
.menu-paneel a { color: var(--tekst); text-decoration: none; }
.menu-paneel a:hover { color: var(--accent); }
.menu-actie { padding: 0; border: 0; background: none; color: var(--tekst); text-align: left; }
.menu-actie:hover { color: var(--accent); border: 0; }
.menu-hint {
    font-size: .72rem; color: var(--tekst-dim); line-height: 1.6;
    border-top: 1px solid var(--rand); padding-top: .6rem;
}

/* ---- meldingen ---- */
.melding {
    padding: .45rem .9rem; background: #4a3b18; color: #f5d98a;
    border-bottom: 1px solid #6b5620; font-size: .85rem;
}

/* ---- kaart + paneel ---- */
.kaart-wrap { flex: 1; display: flex; min-height: 0; }
#kaart { flex: 1; background: #0b0e13; }
.leaflet-container { background: #0b0e13; font: inherit; }
.paneel {
    width: 240px; flex: none; display: flex; flex-direction: column; gap: 1rem;
    padding: 1rem; background: var(--paneel); border-left: 1px solid var(--rand);
    overflow-y: auto;
}
.legenda-blok { position: relative; align-self: center; padding: 0 0 1.4rem 0; }
#legenda { display: block; }
.legenda-as { position: absolute; font-size: .7rem; color: var(--tekst-dim); }
.legenda-as-x { bottom: .2rem; left: 50%; transform: translateX(-50%); }
.legenda-as-y {
    /* verticale strook links van de ruit; writing-mode i.p.v. rotatie zodat de
       positie niet van de tekstlengte afhangt */
    left: -1.1rem; top: 0; bottom: 1.4rem;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    text-align: center;
    white-space: nowrap;
}
.readout { font-size: .875rem; line-height: 1.55; }
.readout table { border-collapse: collapse; width: 100%; }
.readout td { padding: .1rem 0; }
.readout td:last-child { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.readout-leeg, .paneel-voet { color: var(--tekst-dim); font-size: .8rem; }
.paneel-voet { margin-top: auto; }

/* ---- vergelijken ---- */
.vergelijk-wrap { flex: 1; display: flex; min-height: 0; position: relative; }
.vergelijk-kaarten { flex: 1; display: flex; min-width: 0; }
.vergelijk-kolom { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.vergelijk-kolom + .vergelijk-kolom { border-left: 2px solid var(--rand); }
.kaart-kop {
    padding: .3rem .7rem; font-size: .85rem; font-weight: 650;
    background: var(--paneel); border-bottom: 1px solid var(--rand);
}
.kaart-half, .kaart-vol { flex: 1; min-height: 0; }
.kaart-vol { position: absolute; inset: 0; }
[hidden] { display: none !important; }

/* ---- raster (small multiples) ---- */
.raster-titel { font-size: 1rem; font-weight: 650; margin: 0; }
.raster-wrap {
    flex: 1; overflow-y: auto; display: grid; gap: 1rem; padding: 1rem;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    align-content: start;
}
.raster-cel { margin: 0; background: var(--paneel); border: 1px solid var(--rand); border-radius: 8px; padding: .5rem; }
.raster-cel img { width: 100%; height: auto; display: block; image-rendering: auto; background: #0b0e13; }
.raster-cel figcaption { text-align: center; padding-top: .35rem; font-size: .85rem; color: var(--tekst-dim); }
.raster-cel.leeg { opacity: .45; display: flex; align-items: center; justify-content: center; min-height: 120px; }

/* veeg-schuifbalk over de kaart */
.veeg-schuif {
    position: absolute; z-index: 1000; left: 10%; right: 10%; width: 80%;
    bottom: 1.2rem; accent-color: var(--accent);
}

/* ---- tekstpagina's ---- */
.tekst-pagina { max-width: 46rem; margin: 0 auto; padding: 2rem 1.2rem 4rem; line-height: 1.65; overflow-y: auto; }
.tekst-pagina h1 { font-size: 1.5rem; }
.tekst-pagina h2 { font-size: 1.1rem; margin-top: 2rem; }
.tekst-pagina a { color: var(--accent); }
.tekst-pagina li { margin-bottom: .6rem; }

@media (max-width: 900px) {
    .kaart-wrap { flex-direction: column; }
    .paneel { width: auto; flex-direction: row; align-items: center; border-left: 0; border-top: 1px solid var(--rand); }
    .paneel-voet { margin-top: 0; margin-left: auto; }
}
