/* tokens.css - MijnDataWeg v3
   Design-tokens letterlijk uit v3-ontwerp §5.
   Alle kleurtokens hebben hex-fallbacks zodat een mislukte regel niet de hele file sloopt. */

/* ---- Tokens: light mode (default) ---- */
:root {
  /* Kleuren */
  --color-brand-primary: #0053B3;
  --color-brand-secondary: #0D8A4E;
  --color-accent: #F59E0B;
  --color-danger: #DC2626;
  --color-text: #1F2937;
  --color-text-muted: #6B7280;
  --color-surface: #FFFFFF;
  --color-surface-subtle: #F8FAFC;
  --color-border: #E2E8F0;
  /* per-laag accenten */
  --color-burger: #0053B3;

  --color-burger-hover: #003d80;
  --color-pro: #0D8A4E;
  --color-org: #F59E0B;

  /* Typografie */
  --font-body: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-heading: Sora, Inter, ui-sans-serif, system-ui, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --text-base: 1rem;
  --text-sm: 0.875rem;
  --text-xs: 0.75rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 2rem;
  --text-4xl: 2.5rem;

  --line-base: 1.6;
  --line-heading: 1.2;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;

  /* Layout */
  --max-width-prose: 42rem;
  --max-width-container: 75rem;
  --header-height: 4rem;

  /* Vormgeving */
  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --shadow-card: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.06);

  /* Beweging */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
}

/* ---- Tokens: dark mode ---- */
[data-theme="dark"] {
  --color-text: #F1F5F9;
  --color-text-muted: #94A3B8;
  --color-surface: #0F172A;
  --color-surface-subtle: #1E293B;
  --color-border: #334155;
  --color-brand-primary: #3B82F6;
  --color-brand-secondary: #22C55E;
  --color-accent: #FBBF24;
  --color-burger: #3B82F6;
  --color-pro: #22C55E;
  --color-org: #FBBF24;
}

/* ---- Reset / base ---- */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--line-base);
  color: var(--color-text);
  background-color: var(--color-surface-subtle);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  line-height: var(--line-heading);
  color: var(--color-text);
  margin: 0 0 var(--space-md);
}
h1 { font-size: var(--text-4xl); margin-top: var(--space-2xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
p  { margin: 0 0 var(--space-md); }
a  { color: var(--color-brand-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }

/* ---- Layout utilities ---- */
.container {
  max-width: var(--max-width-container);
  margin-inline: auto;
  padding-inline: var(--space-md);
}
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ---- Site header ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  height: var(--header-height);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: var(--space-md);
}
.logo {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-text);
}
.logo:hover { text-decoration: none; }

.primary-nav {
  display: none;
  gap: var(--space-xl);
  align-items: center;
}
.primary-nav a {
  color: var(--color-text);
  font-weight: 500;
  position: relative;
  transition: color var(--transition-fast);
}
@media (min-width: 64rem) {
  .primary-nav { display: flex; }
}

/* ---- Hero ---- */
.hero {
  padding: var(--space-4xl) 0;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  text-align: center;
}
.hero h1 {
  font-size: var(--text-4xl);
  margin-bottom: var(--space-md);
}
.lead {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  max-width: var(--max-width-prose);
  margin: 0 auto var(--space-2xl);
}

/* ---- Drie deuren ---- */
.deuren {
  display: grid;
  gap: var(--space-lg);
  grid-template-columns: 1fr;
  max-width: var(--max-width-container);
  margin-inline: auto;
}
@media (min-width: 64rem) {
  .deuren { grid-template-columns: repeat(3, 1fr); }
}
.deur {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-sm);
  padding: var(--space-xl);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 6px solid var(--deur-color, var(--color-brand-primary));
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  color: var(--color-text);
  text-decoration: none;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}
.deur:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12);
  text-decoration: none;
}
.deur--burger { --deur-color: var(--color-burger); }
.deur--pro    { --deur-color: var(--color-pro); }
.deur--org    { --deur-color: var(--color-org); }
.deur__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  color: var(--deur-color, var(--color-brand-primary));
  margin-bottom: var(--space-xs);
}
.deur__icon svg { display: block; }
.deur__title {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 700;
}
.deur__desc {
  font-size: var(--text-base);
  color: var(--color-text-muted);
}

/* ---- "Hoe werkt het" sectie ---- */
.hoewerkthet {
  padding: var(--space-3xl) 0;
}
.hoewerkthet h2 {
  text-align: center;
  margin-bottom: var(--space-xl);
}
.steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: var(--space-md);
  grid-template-columns: 1fr;
}
@media (min-width: 64rem) {
  .steps { grid-template-columns: repeat(3, 1fr); }
}
.steps li {
  padding: var(--space-lg);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  counter-increment: stap;
  position: relative;
  padding-left: calc(var(--space-lg) + 2.5rem);
}
.steps li::before {
  content: counter(stap);
  position: absolute;
  left: var(--space-lg);
  top: var(--space-lg);
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-brand-primary);
  color: #ffffff;
  font-family: var(--font-heading);
  font-weight: 700;
  border-radius: 50%;
}

/* ---- Footer ---- */
.site-footer {
  padding: var(--space-lg) 0;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  text-align: center;
}

/* ---- Reduced motion ---- */

/* =========================================================
   COMPONENT LIBRARY — extra componenten voor Fase 2
   ========================================================= */

/* ---- Laatst voordat agents de kans krijgen iets te slopen ---- */

/* ---- Rechten-uitklapper (per-content-blok dat 3 dieptes toont) ---- */
.uitklapper {
  --uitklapper-color: var(--color-burger);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 6px solid var(--uitklapper-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  margin-bottom: var(--space-lg);
  overflow: hidden;
}
.uitklapper--pro { --uitklapper-color: var(--color-pro); }
.uitklapper--org { --uitklapper-color: var(--color-org); }

.uitklapper__top {
  padding: var(--space-lg);
}
.uitklapper__top h3,
.uitklapper__top h4 {
  margin: 0 0 var(--space-sm);
  font-family: var(--font-heading);
  color: var(--color-text);
}
.uitklapper__top p:last-child { margin-bottom: 0; }

.uitklapper__toggle {
  appearance: none;
  border: 0;
  background: transparent;
  width: 100%;
  text-align: left;
  font-family: inherit;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  padding: var(--space-sm) var(--space-lg);
  cursor: pointer;
  border-top: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  transition: background var(--transition-fast);
}
.uitklapper__toggle:hover { background: var(--color-surface-subtle); }
.uitklapper__toggle::after {
  content: "▾";
  display: inline-block;
  transition: transform var(--transition-base);
  font-size: var(--text-base);
}
.uitklapper[data-open="true"] .uitklapper__toggle::after { transform: rotate(180deg); }

.uitklapper__panel {
  display: none;
  padding: var(--space-lg);
  border-top: 1px solid var(--color-border);
  background: var(--color-surface-subtle);
}
.uitklapper[data-open="true"] .uitklapper__panel { display: block; }

.uitklapper__panel h4 {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  margin: 0 0 var(--space-md);
  color: var(--color-text);
}
.uitklapper__panel ul {
  margin: 0 0 var(--space-md);
  padding-left: var(--space-lg);
}
.uitklapper__panel li { margin-bottom: var(--space-sm); }

/* ---- BegripTag (inline term met definieerbare tooltip) ---- */
.begrip {
  border-bottom: 1px dotted var(--color-text-muted);
  cursor: help;
  position: relative;
  color: inherit;
}
.begrip::after {
  content: attr(data-def);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  background: var(--color-text);
  color: var(--color-surface);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  line-height: var(--line-base);
  max-width: 28rem;
  width: max-content;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition-fast);
  z-index: 100;
  white-space: normal;
  text-align: left;
}
.begrip:hover::after,
.begrip:focus::after { opacity: 1; }

/* ---- FAQ-item ---- */
/* Oude button-based FAQ styling verwijderd — we gebruiken nu native <details>. 
/* Native <details>/<summary> accordion styling.
   faq-item kan ook een <details> zijn — dan wordt onze display:none gepasseerd. */
.faq-item {
  margin-bottom: var(--space-md);
}
.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: var(--space-md) var(--space-lg);
  font-weight: 600;
  color: var(--color-text);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-md);
  background: var(--color-surface);
  border-radius: var(--radius-md);
}
.faq-item:not(details) summary { border: 1px solid var(--color-border); }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  font-size: var(--text-lg);
  font-weight: 400;
  color: var(--color-text-muted);
}
.faq-item[open] summary::after,
.faq-item[data-open="true"] summary::after { content: "−"; }

.faq-item__a {
  padding: 0 var(--space-lg) var(--space-lg);
  color: var(--color-text);
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-md);
  font-size: var(--text-base);
  line-height: var(--line-base);
}
/* Voor als .faq-item géén <details> is, en we willen toggle via JS: */
.faq-item:not([open]):not([data-open="true"]) > .faq-item__a {
  display: none;
}
.faq-item[data-open="true"] > .faq-item__a { display: block; }

/* ---- Brief-voorbeeld (3 templates) ---- */
.brief-voorbeeld {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-xl);
  overflow: hidden;
}
.brief-voorbeeld__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface-subtle);
}
.brief-voorbeeld__title {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 700;
  margin: 0;
}
.brief-voorbeeld__body {
  padding: var(--space-lg);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  line-height: var(--line-heading);
  white-space: pre-wrap;
  color: var(--color-text);
  background: var(--color-surface);
  overflow-x: auto;
}
.brief-voorbeeld__actions {
  display: flex;
  gap: var(--space-sm);
}
.brief-voorbeeld__btn {
  appearance: none;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  font-family: inherit;
  font-size: var(--text-sm);
  font-weight: 500;
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-md);
  cursor: pointer;
  text-decoration: none;
  transition: background var(--transition-fast);
}
.brief-voorbeeld__btn:hover { background: var(--color-surface-subtle); }
.brief-voorbeeld__btn--accent {
  background: var(--color-brand-primary);
  color: #ffffff;
  border-color: var(--color-brand-primary);
}
.brief-voorbeeld__btn--accent:hover { background: var(--color-brand-primary); opacity: 0.9; }

/* ---- ArtikelMeta (datum, laag, bronnen) ---- */
.artikel-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  align-items: center;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-lg);
}
.artikel-meta__laag {
  display: inline-block;
  padding: 2px var(--space-sm);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text);
  background: var(--color-surface-subtle);
}

/* ---- Article body (typografie voor rechten-pagina's) ---- */
.artikel {
  max-width: var(--max-width-prose);
  margin-inline: auto;
  padding: var(--space-2xl) var(--space-md);
}
.artikel h2 { margin-top: var(--space-2xl); }
.artikel h3 { margin-top: var(--space-xl); }
.artikel ul, .artikel ol { padding-left: var(--space-lg); margin-bottom: var(--space-md); }
.artikel li { margin-bottom: var(--space-xs); }

/* ---- Bronnenlijst ---- */
.bronnen {
  background: var(--color-surface-subtle);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-lg);
  margin: var(--space-xl) 0;
  font-size: var(--text-sm);
}
.bronnen h3 {
  font-family: var(--font-heading);
  font-size: var(--text-base);
  margin: 0 0 var(--space-sm);
}
.bronnen ul { margin: 0; padding-left: var(--space-lg); }
.bronnen li { margin-bottom: var(--space-xs); }

/* ========================================================================
   Mobile-first responsive + accessibility-laag (2026-09-29)
   Doel: hamburger-menu op <768px, tap-targets >=44px, focus-rings,
   dark-mode auto-detect, reduced-motion respect.
   Strak-rustig design — geen flashy animaties.
   ======================================================================== */

/* ---- Mobiele navigatie: altijd zichtbare horizontale scroll-tabs ---- */
/* Op alle schermen: primary-nav is een flex-rij. Op mobiel horizontaal scroll-baar. */
.site-header .primary-nav {
  display: flex;
  gap: var(--space-xl);
  align-items: center;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: thin;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  scroll-padding-inline: var(--space-md);
  /* Eén ondergrens voor de hele rij */
  border-bottom: 1px solid transparent;
}
.site-header .primary-nav::-webkit-scrollbar {
  height: 4px;
}
.site-header .primary-nav::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 2px;
}
.site-header .primary-nav a {
  white-space: nowrap;
  scroll-snap-align: start;
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--color-text-muted);
  font-weight: 500;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  position: relative;
  transition: color var(--transition-fast);
}
/* Subtiele hover: tekst wordt donkerder + lichte onderlijn */
.site-header .primary-nav a::after {
  content: "";
  position: absolute;
  left: var(--space-sm);
  right: var(--space-sm);
  bottom: 6px;
  height: 2px;
  background: var(--color-text-muted);
  opacity: 0;
  transform: scaleX(0.7);
  transform-origin: center;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
  border-radius: 2px;
}
.site-header .primary-nav a:hover {
  color: var(--color-text);
  text-decoration: none;
}
.site-header .primary-nav a:hover::after {
  opacity: 0.4;
  transform: scaleX(1);
}
/* Focus-ring voor keyboard-nav (WCAG 2.4.7) */
.site-header .primary-nav a:focus-visible {
  outline: 2px solid var(--color-brand-primary);
  outline-offset: 4px;
  border-radius: var(--radius-sm);
}
/* Actieve tab: duidelijke indicator (donkere onderlijn + brand-kleurige tekst) */
.site-header .primary-nav a[aria-current="page"] {
  color: var(--color-brand-primary);
  font-weight: 600;
  background: transparent;
}
.site-header .primary-nav a[aria-current="page"]::after {
  opacity: 1;
  transform: scaleX(1);
  background: var(--color-brand-primary);
  height: 2px;
  bottom: 4px;
}

/* Op heel smalle schermen (<400px): compacter, minder padding, links iets kleiner */
@media (max-width: 400px) {
  .site-header .primary-nav {
    gap: var(--space-md);
  }
  .site-header .primary-nav a {
    padding: var(--space-xs);
    font-size: var(--text-sm);
  }
}

/* Header-inner mag op smalle schermen wrappen zodat de tabs een tweede regel krijgen */
@media (max-width: 767.98px) {
  .header-inner {
    flex-wrap: wrap;
    height: auto;
    min-height: var(--header-height);
    padding: var(--space-xs) 0;
    gap: var(--space-xs);
  }
  .logo { flex-shrink: 0; }
  /* primary-nav neemt tweede regel in beslag */
  .primary-nav {
    order: 3;
    flex-basis: 100%;
  }
}

/* ---- Tap-target minimum (WCAG 2.5.5) ---- */
button,
input,
select,
textarea,
a {
  min-height: 44px;
}
a:not(.logo):not(.tool__links a):not(.bronnen a):not(.footer a) {
  /* Alleen voor niet-tekstuele links; tekst-links in paragraaf hebben deze grootte al via line-height */
}

/* Links in lange tekst: alleen tap-area vergroten zonder visuele blokken */
p a, li a {
  /* Visueel ongewijzigd; tap-gebied wordt vergroot via padding */
  padding: 2px 0;
}

/* ---- Focus-rings (WCAG 2.4.7) ---- */
*:focus { outline: none; }
*:focus-visible {
  outline: 3px solid var(--color-brand-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}
/* Voor donkere thema's een lichtere focus-ring */
[data-theme="dark"] *:focus-visible { outline-color: #93C5FD; }

/* ---- Reduced motion (WCAG 2.3.3) ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---- Auto dark mode via OS ---- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --color-text: #F1F5F9;
    --color-text-muted: #94A3B8;
    --color-surface: #0F172A;
    --color-surface-subtle: #1E293B;
    --color-border: #334155;
    --color-brand-primary: #3B82F6;
    --color-brand-secondary: #22C55E;
    --color-accent: #FBBF24;
    --color-burger: #3B82F6;
    --color-burger-hover: #2563EB;
    --color-pro: #22C55E;
    --color-org: #FBBF24;
  }
}


/* ============================================================
   Utility-classes (vervangen inline style-attributen)
   ============================================================ */

.mt-lg   { margin-top: var(--space-lg); }
.mt-xl   { margin-top: var(--space-2xl); }
.mb-xs   { margin-bottom: var(--space-xs); }

.block     { display: block; }
.font-heading { font-family: var(--font-heading); }
.text-4xl  { font-size: var(--text-4xl); }

.prose-center {
  max-width: var(--max-width-prose);
  margin-inline: auto;
}
