/* =====================================================================
   Impactmeting Polderjongens — dashboard
   Huisstijl afgeleid van polderjongensvanalmelo.nl:
   zand #F4E0CE / #EFCEB1, rood #FF1F00, inkt #1D1D1C, condensed uppercase koppen.
   ===================================================================== */

@font-face { font-family: 'Barlow Condensed'; font-style: normal; font-weight: 500; font-display: swap; src: url(assets/fonts/barlow-condensed-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-style: normal; font-weight: 600; font-display: swap; src: url(assets/fonts/barlow-condensed-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-style: normal; font-weight: 700; font-display: swap; src: url(assets/fonts/barlow-condensed-latin-700-normal.woff2) format('woff2'); }
@font-face { font-family: 'Chivo'; font-style: normal; font-weight: 400; font-display: swap; src: url(assets/fonts/chivo-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'Chivo'; font-style: italic; font-weight: 400; font-display: swap; src: url(assets/fonts/chivo-latin-400-italic.woff2) format('woff2'); }
@font-face { font-family: 'Chivo'; font-style: normal; font-weight: 500; font-display: swap; src: url(assets/fonts/chivo-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: 'Chivo'; font-style: normal; font-weight: 700; font-display: swap; src: url(assets/fonts/chivo-latin-700-normal.woff2) format('woff2'); }

:root {
  --sand: #F4E0CE;
  --panel: #EFCEB1;
  --panel-2: #E8C39F;
  --line: #DBB48C;
  --ink: #1D1D1C;
  --ink-2: #5C4A3C;
  --ink-3: #6B5849;
  --red: #FF1F00;
  --mark: #E33F14;
  --mark-dark: #BE1C00;
  --r1: #DD7450; --r2: #E33F14; --r3: #BE1C00; --r4: #861A0A; --r5: #4E1A12;
  --nvt: #9C8672;
  --ghost: #5C4A3C;
  --white: #FFFFFF;
  --head: 'Barlow Condensed', 'Arial Narrow', 'Helvetica Neue', Arial, sans-serif;
  --body: 'Chivo', 'Helvetica Neue', Arial, sans-serif;
  --gutter: clamp(16px, 4vw, 48px);
  --maxw: 1240px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--sand); color: var(--ink);
  font-family: var(--body); font-size: 15px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button, select, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

h1, h2, h3, h4 { font-family: var(--head); font-weight: 600; text-transform: uppercase; letter-spacing: -0.01em; line-height: 0.92; margin: 0; }
h1 { font-size: clamp(52px, 9vw, 112px); font-weight: 700; letter-spacing: -0.03em; }
h2 { font-size: clamp(36px, 5.5vw, 64px); letter-spacing: -0.02em; }
h3 { font-size: 26px; line-height: 1; }
h4 { font-size: 20px; }
p { margin: 0 0 1em; }
.lead { text-transform: uppercase; font-size: clamp(15px, 1.6vw, 19px); line-height: 1.4; font-weight: 500; max-width: 60ch; }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }

/* --- rode blokjes en onderstrepingen zoals op de site --- */
.tag {
  display: inline-block; background: var(--red); color: var(--ink);
  font-family: var(--head); font-weight: 600; text-transform: uppercase; letter-spacing: -0.01em;
  font-size: 22px; line-height: 1; padding: 10px 14px 8px;
}
.underline-red { position: relative; display: inline-block; z-index: 0; }
.underline-red::after {
  content: ''; position: absolute; left: -0.06em; right: 28%; bottom: 0.02em; height: 0.26em;
  background: var(--red); z-index: -1;
}
.rule { border: 0; border-top: 1px solid var(--red); margin: 0; }

/* --- header --- */
.site-header { padding: 28px 0 8px; }
.site-header .wrap { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.logo { display: block; width: 190px; }
.logo img, .logo svg { width: 100%; height: auto; display: block; }
.header-meta { text-align: right; font-family: var(--head); text-transform: uppercase; font-size: 20px; line-height: 1.05; font-weight: 600; }
.header-meta .muted { display: block; font-weight: 500; font-size: 16px; }

/* --- navigatie: donkere balk zoals de menubalk op de site --- */
.nav { position: sticky; top: 0; z-index: 40; background: var(--ink); color: var(--white); }
.nav .wrap { display: flex; align-items: stretch; gap: 0; overflow-x: auto; scrollbar-width: none; }
.nav .wrap::-webkit-scrollbar { display: none; }
.nav a {
  font-family: var(--head); text-transform: uppercase; font-weight: 600; font-size: 18px; letter-spacing: -0.01em;
  padding: 12px 11px 10px; text-decoration: none; white-space: nowrap; color: var(--white);
  border-bottom: 4px solid transparent;
}
.nav a:hover { background: #333; }
.nav a.active { background: var(--red); color: var(--ink); }

/* --- hero --- */
.hero { padding: 36px 0 20px; }
.hero h1 { margin-bottom: 18px; }
.hero h1 span { display: block; }
.hero .cols { display: grid; grid-template-columns: 1.3fr 1fr; gap: 32px; align-items: start; }
@media (max-width: 800px) { .hero .cols { grid-template-columns: 1fr; } }
.hero-photo { background: var(--panel); aspect-ratio: 4 / 3; position: relative; overflow: hidden; }
.hero-photo::after { content: ''; position: absolute; inset: 0; background: linear-gradient(135deg, rgba(29,29,28,0.02), rgba(29,29,28,0.12)); }
.stat-hero { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; background: var(--ink); margin-top: 8px; }
.stat-hero div { background: var(--sand); padding: 16px 14px 12px; }
.stat-hero b { display: block; font-family: var(--head); font-weight: 700; font-size: clamp(40px, 5vw, 60px); line-height: 0.9; letter-spacing: -0.03em; }
.stat-hero span { display: block; text-transform: uppercase; font-family: var(--head); font-weight: 600; font-size: 17px; margin-top: 6px; color: var(--ink-2); }

/* --- lessons learned (donker blok in de hero, zoals de menubalk/knoppen op de site) --- */
.lessons { margin-top: 36px; background: var(--ink); color: var(--white); padding: 28px 30px 26px; }
.lessons > header { display: grid; grid-template-columns: max-content 1fr; gap: 10px 24px; align-items: start; margin-bottom: 22px; }
.lessons > header .tag { align-self: start; }
.lessons > header h2 { color: var(--white); font-size: clamp(28px, 3.6vw, 40px); grid-column: 2; }
.lessons > header p { grid-column: 2; margin: 0; color: #d9cdbf; max-width: 78ch; font-size: 14px; }
.lessons-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; }
.lessons-grid > li { padding: 0 22px 0 0; margin-right: 22px; border-right: 1px solid #3a3835; min-width: 0; }
.lessons-grid > li:last-child { border-right: 0; margin-right: 0; padding-right: 0; }
.lessons-grid h3 { color: var(--white); font-size: 22px; line-height: 1; margin-bottom: 14px; display: flex; align-items: baseline; gap: 10px; }
.lessons-grid .nr { color: var(--red); font-weight: 700; font-size: 34px; line-height: 0.8; }
.lessons-grid dl { margin: 0; }
.lessons-grid dt { font-family: var(--head); text-transform: uppercase; font-weight: 600; font-size: 14px; letter-spacing: .06em; color: var(--red); margin-top: 10px; }
.lessons-grid dd { margin: 3px 0 0; font-size: 13px; line-height: 1.5; color: #e9dfd3; }
@media (max-width: 1000px) { .lessons-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 24px; } .lessons-grid > li:nth-child(2) { border-right: 0; } }
@media (max-width: 600px) {
  .lessons { padding: 20px 16px 18px; }
  .lessons > header { grid-template-columns: 1fr; }
  .lessons > header h2, .lessons > header p { grid-column: 1; }
  .lessons-grid { grid-template-columns: 1fr; }
  .lessons-grid > li { border-right: 0; margin-right: 0; padding-right: 0; border-bottom: 1px solid #3a3835; padding-bottom: 18px; }
  .lessons-grid > li:last-child { border-bottom: 0; padding-bottom: 0; }
}

/* --- filterbalk --- */
.filters { position: sticky; top: var(--navh, 46px); z-index: 30; background: var(--sand); border-top: 1px solid var(--red); border-bottom: 1px solid var(--red); }
.filters .wrap { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; }
.filters .tag { font-size: 18px; padding: 8px 10px 6px; }
.chip {
  position: relative; display: inline-flex; align-items: center; gap: 6px;
  background: transparent; border: 1.5px solid var(--ink); color: var(--ink);
  padding: 6px 10px; font-size: 13px; font-weight: 500; line-height: 1.2; border-radius: 0;
}
.chip:hover { background: var(--panel); }
.chip[aria-expanded="true"], .chip.on { background: var(--ink); color: var(--white); }
.chip .cnt { background: var(--red); color: var(--ink); font-weight: 700; font-size: 11px; padding: 1px 6px; min-width: 18px; text-align: center; }
.chip .car { font-size: 10px; opacity: 0.8; }
.chip-wrap { position: relative; }
.pop {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 50; min-width: 260px; max-width: 360px; max-height: 60vh; overflow: auto;
  background: var(--white); color: var(--ink); border: 1.5px solid var(--ink); box-shadow: 6px 6px 0 var(--ink); padding: 8px;
}
.pop label { display: flex; align-items: flex-start; gap: 8px; padding: 6px 6px; cursor: pointer; font-size: 13px; line-height: 1.3; }
.pop label:hover { background: var(--sand); }
.pop input[type=checkbox] { appearance: none; width: 16px; height: 16px; border: 1.5px solid var(--ink); margin: 1px 0 0; flex: none; background: var(--white); }
.pop input[type=checkbox]:checked { background: var(--red); box-shadow: inset 0 0 0 2px var(--white); }
.pop .n { margin-left: auto; color: var(--ink-3); font-size: 12px; padding-left: 8px; }
.pop .actions { display: flex; gap: 6px; padding: 4px 6px 6px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.pop .actions button { background: none; border: 0; padding: 2px 0; font-size: 12px; text-decoration: underline; }
.filters .count { margin-left: auto; font-family: var(--head); text-transform: uppercase; font-weight: 600; font-size: 20px; letter-spacing: -0.01em; white-space: nowrap; }
.filters .count b { color: var(--mark-dark); }
.btn-dark { background: var(--ink); color: var(--white); border: 0; font-family: var(--head); text-transform: uppercase; font-weight: 600; font-size: 18px; padding: 8px 12px 6px; }
.btn-dark:hover { background: var(--red); color: var(--ink); }
.btn-dark:disabled { opacity: 0.35; cursor: default; }
.btn-dark:disabled:hover { background: var(--ink); color: var(--white); }
.filter-note { font-size: 13px; color: var(--ink-2); width: 100%; }
.toggle-filters { display: none; }
.filters.stuck .toggle-filters { display: inline-flex; }
.filters.stuck:not(.expanded) .chip-wrap:not(.on) { display: none; }
.filters.stuck .tag { font-size: 16px; padding: 7px 9px 5px; }
#filters-sentinel { height: 1px; margin-top: -1px; }

/* --- secties --- */
section.block { padding: 40px 0 8px; }
section.block > .wrap > header { display: flex; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 20px; }
section.block > .wrap > header p { max-width: 62ch; margin: 0; color: var(--ink-2); }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.grid .span2 { grid-column: 1 / -1; }
@media (max-width: 860px) { .grid { grid-template-columns: 1fr; } }

/* --- kaarten (zandpanelen zoals 'PROGRAMMA' op de site) --- */
.card { background: var(--panel); padding: 20px 22px 18px; position: relative; min-width: 0; }
.card > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card h3 { font-size: 24px; }
.card .sub { font-size: 12.5px; color: var(--ink-2); margin-top: 4px; }
.card .tools { display: flex; gap: 6px; flex: none; }
.tbtn { background: transparent; border: 1.5px solid var(--ink); font-size: 12px; font-weight: 500; padding: 3px 8px; }
.tbtn:hover, .tbtn[aria-pressed="true"] { background: var(--ink); color: var(--white); }
.card .foot { font-size: 12px; color: var(--ink-3); margin-top: 10px; }
.card.empty::after { content: 'Geen respondenten in deze selectie.'; display: block; color: var(--ink-3); font-style: italic; }

/* --- KPI tegels --- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px; background: var(--ink); }
@media (max-width: 860px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kpi { background: var(--panel); padding: 16px 16px 12px; min-width: 0; }
.kpi .v { font-family: var(--head); font-weight: 700; font-size: clamp(36px, 4vw, 52px); line-height: 0.9; letter-spacing: -0.03em; }
.kpi .v small { font-size: 0.45em; font-weight: 600; letter-spacing: 0; color: var(--ink-2); margin-left: 2px; }
.kpi .l { font-family: var(--head); text-transform: uppercase; font-weight: 600; font-size: 16px; line-height: 1.05; margin-top: 8px; }
.kpi .ref { font-size: 12px; color: var(--ink-2); margin-top: 5px; min-height: 1.3em; }
.kpi .ref b { color: var(--ink); font-weight: 500; }

/* --- staafdiagrammen (HTML) --- */
.bars { display: grid; grid-template-columns: minmax(90px, 32%) 1fr max-content; column-gap: 12px; row-gap: 7px; align-items: center; }
.bars .lab { font-size: 13px; line-height: 1.25; text-align: right; color: var(--ink); overflow-wrap: break-word; }
.bars .track { position: relative; height: 22px; }
.bars .bar { position: absolute; left: 0; top: 0; height: 100%; background: var(--mark); border-radius: 0 4px 4px 0; min-width: 0; transition: width .35s ease; }
.bars .bar.ghost { background: transparent; }
.bars .tick { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ghost); margin-left: -1px; transition: left .35s ease; }
.bars .val { font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bars .val small { color: var(--ink-3); margin-left: 4px; }
.bars .track:hover .bar { filter: brightness(1.08); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--ink-2); margin-bottom: 10px; }
.legend i { display: inline-block; width: 12px; height: 12px; vertical-align: -2px; margin-right: 5px; }
.legend i.tick { width: 2px; height: 14px; background: var(--ghost); vertical-align: -3px; margin-right: 7px; }

/* --- likert (gestapeld 100%) --- */
.likert { display: grid; grid-template-columns: minmax(110px, 30%) 1fr 92px; column-gap: 12px; row-gap: 9px; align-items: center; }
.likert .lab { font-size: 13px; line-height: 1.25; text-align: right; overflow-wrap: break-word; }
.likert .stack { display: flex; gap: 2px; height: 22px; }
.likert .seg { height: 100%; min-width: 0; transition: flex-basis .35s ease; position: relative; }
.likert .seg:first-child { border-radius: 4px 0 0 4px; }
.likert .seg:last-child { border-radius: 0 4px 4px 0; }
.likert .seg:hover { filter: brightness(1.12); }
.likert .stat { font-variant-numeric: tabular-nums; font-size: 13px; line-height: 1.2; white-space: nowrap; }
.likert .stat b { font-family: var(--head); font-size: 20px; font-weight: 700; letter-spacing: -0.01em; display: block; }
.likert .stat .g { color: var(--ink-3); font-size: 12px; }
.likert .stat .ref { color: var(--ink-3); font-size: 11px; display: block; }
.likert-head { display: grid; grid-template-columns: minmax(110px, 30%) 1fr 92px; column-gap: 12px; font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }
.likert-head span:last-child { text-align: left; }

/* --- histogram (kolommen) --- */
.hist { display: flex; align-items: flex-end; gap: 6px; height: 160px; padding-top: 18px; border-bottom: 1px solid var(--line); }
.hist .col { flex: 1 1 0; position: relative; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; }
.hist .col .bar { background: var(--mark); border-radius: 4px 4px 0 0; transition: height .35s ease; position: relative; width: min(100%, 44px); margin: 0 auto; }
.hist .col .bar:not([style*="height: 0%"]) { min-height: 1px; }
.hist .col .bar.dim { background: var(--r1); }
.hist .col:hover .bar { filter: brightness(1.08); }
.hist .col .v { position: absolute; left: 0; right: 0; text-align: center; font-size: 11px; font-variant-numeric: tabular-nums; color: var(--ink-2); transform: translateY(-16px); }
.hist .col .tick { position: absolute; left: 10%; right: 10%; height: 2px; background: var(--ghost); }
.hist-x { display: flex; gap: 6px; margin-top: 4px; }
.hist-x span { flex: 1 1 0; text-align: center; font-size: 12px; font-variant-numeric: tabular-nums; }
.hist-bands { display: flex; gap: 6px; margin-top: 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); }
.hist-bands span { border-top: 2px solid var(--ink); padding-top: 3px; text-align: center; }

/* --- tabelweergave --- */
table.data { border-collapse: collapse; width: 100%; font-size: 12.5px; margin-top: 10px; font-variant-numeric: tabular-nums; }
table.data th, table.data td { text-align: right; padding: 5px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data th:first-child, table.data td:first-child { text-align: left; }
table.data thead th { font-family: var(--head); text-transform: uppercase; font-weight: 600; font-size: 13px; letter-spacing: .01em; border-bottom: 2px solid var(--ink); }
table.data tfoot td { font-weight: 700; border-top: 2px solid var(--ink); border-bottom: 0; }
.tablewrap { overflow-x: auto; }

/* --- tooltip --- */
.tip {
  position: fixed; z-index: 100; pointer-events: none; background: var(--ink); color: var(--white);
  padding: 8px 10px; font-size: 12.5px; line-height: 1.35; max-width: 280px; box-shadow: 4px 4px 0 var(--red);
  opacity: 0; transition: opacity .12s;
}
.tip.show { opacity: 1; }
.tip b { font-size: 15px; display: block; }
.tip .row { display: flex; gap: 10px; justify-content: space-between; }
.tip .row i { display: inline-block; width: 10px; height: 10px; margin-right: 6px; vertical-align: -1px; }

/* --- vergelijk-tool & citaten --- */
.controls { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: flex-end; margin-bottom: 18px; }
.controls label { display: flex; flex-direction: column; gap: 4px; font-family: var(--head); text-transform: uppercase; font-weight: 600; font-size: 15px; letter-spacing: .01em; }
.controls select, .controls input[type=search] {
  background: var(--white); border: 1.5px solid var(--ink); padding: 7px 10px; font-size: 13.5px; font-family: var(--body); min-width: 220px; border-radius: 0; text-transform: none; font-weight: 400;
}
.controls input[type=search] { min-width: 260px; }
.seg-btns { display: inline-flex; border: 1.5px solid var(--ink); }
.seg-btns button { background: transparent; border: 0; padding: 7px 12px; font-size: 13px; font-family: var(--body); border-right: 1.5px solid var(--ink); }
.seg-btns button:last-child { border-right: 0; }
.seg-btns button[aria-pressed="true"] { background: var(--ink); color: var(--white); }
.warn { color: var(--mark-dark); }

.quotes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 860px) { .quotes { grid-template-columns: 1fr; } }
.quote { background: var(--panel); padding: 16px 18px 14px; border-left: 4px solid var(--red); }
.quote p { font-style: italic; margin: 0 0 8px; font-size: 14.5px; }
.quote p::before { content: '\201C'; } .quote p::after { content: '\201D'; }
.quote .meta { font-size: 11.5px; color: var(--ink-2); text-transform: uppercase; letter-spacing: .04em; }
.quote .meta span + span::before { content: ' · '; }
.quote mark { background: var(--red); color: var(--ink); padding: 0 2px; }
.more { display: flex; justify-content: center; margin-top: 16px; }

/* --- methode & footer --- */
.prose { max-width: 70ch; }
.prose h4 { margin: 18px 0 6px; }
.site-footer { margin-top: 48px; background: var(--ink); color: var(--white); padding: 32px 0 40px; }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; align-items: flex-end; }
.site-footer h4 { font-size: 26px; color: var(--white); }
.site-footer p { margin: 6px 0 0; font-size: 13px; color: #cfc4b8; max-width: 60ch; }
.site-footer .logo { width: 150px; }

@media print {
  .nav, .filters .chip-wrap, .tools, .btn-dark { display: none !important; }
  body { background: #fff; }
  .card { break-inside: avoid; }
}

@media (max-width: 600px) {
  .filters .count { font-size: 16px; }
  .btn-dark { font-size: 15px; padding: 6px 9px 4px; }
  .filters .tag { font-size: 15px; }
  .kpi .v { font-size: 34px; }
  .card { padding: 16px 14px 14px; }
  .bars, .likert, .likert-head { column-gap: 8px; }
  .likert, .likert-head { grid-template-columns: minmax(90px, 30%) 1fr 78px; }
}
