/*
 * Donasjonene til partiene (donasjoner.html og donasjon_giver.html). Bygger på
 * statistikk.css: toppen, filteret, kortene, nøkkeltallene og tabellene er de
 * samme. Her ligger bare stolpene, partimerkene og typemerkene.
 *
 * Fargene for type giver er de fem første i dataviz-paletten (validert for
 * fargeblinde på lys bakgrunn), og «Andre» er grå. Tre av dem har lav kontrast
 * mot hvitt, så de står aldri alene: navnet og beløpet står alltid ved siden av.
 */

.dn-hode { padding-bottom: 30px; }
.dn-kilde { margin: 14px 0 0; font-size: 0.9rem; line-height: 1.5; color: rgba(255, 255, 255, 0.75); }
.dn-kilde a { color: #93c5fd; font-weight: 600; text-decoration: none; }
.dn-kilde a:hover { text-decoration: underline; }

.dn-filter { flex-direction: column; align-items: flex-start; gap: 10px; }
.dn-filter .st-filter-navn { min-width: 44px; }
.dn-andre summary {
    display: inline-flex; align-items: center; height: 32px; padding: 0 13px;
    border: 1px dashed #cbd5e1; border-radius: 999px; background: var(--surface);
    color: var(--primary-muted); font-size: 0.86rem; font-weight: 500; cursor: pointer; list-style: none;
}
.dn-andre summary::-webkit-details-marker { display: none; }
.dn-andre[open] summary { margin-bottom: 6px; }

.dn-tall-navn { font-size: clamp(1.1rem, 2.2vw, 1.35rem) !important; }
.dn-tall-navn a { color: inherit; text-decoration: none; }
.dn-tall-navn a:hover { color: var(--accent); text-decoration: underline; }

.dn-typenavn { display: inline-flex; align-items: center; }
.dn-prikk { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; margin-right: 8px; vertical-align: 0; }

/* ── De største giverne ─────────────────────────────────────────── */

.dn-givere th[scope="row"] { min-width: 180px; }
.dn-plass { width: 28px; padding-right: 0 !important; color: var(--text-muted); font-variant-numeric: tabular-nums; text-align: right !important; }
.st-tabell th.dn-plass:first-child, .st-tabell td.dn-plass:first-child { padding-left: 24px; }
.dn-mobil { display: none; }
.dn-navn { display: block; overflow-wrap: anywhere; font-weight: 600; color: var(--primary); text-decoration: none; }
.dn-navn:hover { color: var(--accent); text-decoration: underline; }
.dn-under { font-size: 0.8rem; color: var(--text-muted); font-weight: 400; }
.dn-type { display: inline-flex; align-items: center; gap: 5px; }
.dn-type::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--type); }
.dn-partier { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 12px; }
.dn-partier li { display: inline-flex; align-items: center; gap: 6px; font-size: 0.88rem; color: var(--primary); white-space: nowrap; }
.dn-partier img { width: 18px; height: 18px; object-fit: contain; border-radius: 3px; }
.dn-partier .dn-prikk { margin-right: 0; }

.dn-flere summary {
    display: flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 24px;
    border-top: 1px solid var(--border); color: var(--accent); font-weight: 600; font-size: 0.92rem;
    cursor: pointer; list-style: none;
}
.dn-flere summary::-webkit-details-marker { display: none; }
.dn-flere summary::after { content: '▾'; font-size: 0.8rem; }
.dn-flere[open] summary::after { content: '▴'; }
.dn-flere[open] summary { border-bottom: 1px solid var(--border); }
.dn-flere thead { display: none; }

/* ── Stolper ────────────────────────────────────────────────────── */

.dn-stolpecelle { width: 46%; min-width: 130px; }
.dn-spor { position: relative; display: flex; gap: 2px; height: 14px; }
.dn-fyll { height: 100%; border-radius: 0 4px 4px 0; background: var(--type, var(--accent)); }
.dn-stablet span { display: block; height: 100%; background: var(--type); min-width: 2px; }
.dn-stablet span:last-child { border-radius: 0 4px 4px 0; }
.dn-intern th, .dn-intern td { color: var(--text-muted) !important; }
.dn-parti { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; color: var(--primary); text-decoration: none; white-space: nowrap; }
a.dn-parti:hover { color: var(--accent); text-decoration: underline; }
.dn-parti img { width: 20px; height: 20px; object-fit: contain; border-radius: 4px; }
.dn-parti .dn-prikk { margin-right: 0; }
.dn-forklaring { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 10px 0 0; padding: 0; list-style: none; font-size: 0.84rem; color: var(--text-muted); }
.dn-forklaring li { display: inline-flex; align-items: center; }
.dn-aartabell th[scope="row"] { width: 60px; font-variant-numeric: tabular-nums; }
.dn-aartabell td:first-of-type { width: auto; }

.dn-spm h3 { margin: 18px 0 6px; font-size: 0.95rem; font-weight: 600; color: var(--primary); }

/* ── Giversiden ─────────────────────────────────────────────────── */

.dn-giver-ledd { color: var(--text-muted); font-size: 0.86rem; }
.dn-aar-hode th, .dn-aar-hode td { background: #f8fafc; font-weight: 600 !important; color: var(--primary) !important; }
.st-tabell.dn-bidrag td:first-child { padding-left: 24px; }

@media (max-width: 760px) {
    .dn-stolpecelle { width: 34%; min-width: 60px; }
    .dn-skjul-mobil { display: none; }
    .dn-typer th, .dn-typer td, .dn-partitabell th, .dn-partitabell td { padding-left: 8px; padding-right: 8px; }
    .st-tabell.dn-typer th:first-child, .st-tabell.dn-partitabell th:first-child { padding-left: 14px; }
    .st-tabell.dn-typer td:last-child, .st-tabell.dn-partitabell td:last-child { padding-right: 14px; }
    .st-tabell th.dn-plass:first-child, .st-tabell td.dn-plass:first-child,
    .st-tabell.dn-bidrag td:first-child, .st-tabell.dn-bidrag th:first-child { padding-left: 14px; }
    .dn-givere th[scope="row"] { min-width: 140px; }
    .dn-givere td, .dn-givere th { padding-left: 8px; padding-right: 8px; }
    .dn-givere .dn-gitt { display: none; }
    .dn-givere th[scope="row"] { min-width: 0; }
    .dn-mobil { display: block; margin-top: 2px; font-size: 0.84rem; font-weight: 500; color: var(--primary-muted); }
    .st-tall:has(.dn-tall-navn) dt, .st-tall .dn-tall-navn { grid-column: 1 / -1; grid-row: auto; }
    .dn-stablet, .dn-spor { height: 12px; }
}
