/*
  Bouwlink.nl - design system
  Richting: "De doorsnede". De bouwtekening is het beeldmerk, niet de klusfoto.
  Papier is koel tekenpapier, tekst is potloodzwart, het merk is diep petrol,
  en correctierood komt alleen voor waarschuwingen - net als op een echte revisie.
  created-by: claude / model: claude-opus-5 / 2026-08-27
*/

/* ---------- tokens ---------- */
:root {
  /* kleur */
  --paper:        #F1F4F6;   /* tekenpapier, koel grijsblauw */
  --surface:      #FFFFFF;   /* de leeskolom */
  --surface-sub:  #E8EDF0;   /* rustige vlakken */
  --ink:          #14181C;   /* potloodzwart */
  --ink-soft:     #4B575F;   /* bijschrift, metadata */
  --line:         #C7D0D8;   /* maatlijn */
  --line-soft:    #DFE5EA;
  --brand:        #1F4E5F;   /* diep petrol, technisch en rustig */
  --brand-hover:  #143A47;
  --brand-wash:   #E4EDF0;
  --revisie:      #B3261E;   /* correctierood, alleen bij let op */
  --revisie-wash: #FBEAE8;
  --gecontroleerd:#2F6B4F;   /* bron gecontroleerd */
  --geco-wash:    #E6F0EA;

  /* type */
  --display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --body:    "Literata", Georgia, "Times New Roman", serif;
  --meta:    "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --step--1: clamp(0.83rem, 0.81rem + 0.11vw, 0.89rem);
  --step-0:  clamp(1.05rem, 1.01rem + 0.20vw, 1.18rem);
  --step-1:  clamp(1.27rem, 1.19rem + 0.38vw, 1.51rem);
  --step-2:  clamp(1.53rem, 1.40rem + 0.65vw, 1.94rem);
  --step-3:  clamp(1.84rem, 1.63rem + 1.05vw, 2.48rem);
  --step-4:  clamp(2.22rem, 1.89rem + 1.63vw, 3.18rem);

  /* maat */
  --kolom: 44rem;          /* leeskolom, circa 700-760px zoals gevraagd */
  --breed: 76rem;
  --sp-1: 0.35rem; --sp-2: 0.7rem;  --sp-3: 1.1rem;
  --sp-4: 1.8rem;  --sp-5: 2.8rem;  --sp-6: 4.4rem; --sp-7: 6.5rem;
  --radius: 3px;           /* bouwtekeningen hebben geen ronde hoeken */
}

@media (prefers-color-scheme: dark) {
  :root:not([data-thema="licht"]) {
    --paper: #10151A; --surface: #161C22; --surface-sub: #1E262E;
    --ink: #E8EDF1;  --ink-soft: #9DAAB4;
    --line: #35424C; --line-soft: #262F38;
    --brand: #7FB4C2; --brand-hover: #A6CDD8; --brand-wash: #1A2B33;
    --revisie: #F08A80; --revisie-wash: #33201E;
    --gecontroleerd: #7FBF9C; --geco-wash: #1B2A22;
  }
}
:root[data-thema="donker"] {
  --paper: #10151A; --surface: #161C22; --surface-sub: #1E262E;
  --ink: #E8EDF1;  --ink-soft: #9DAAB4;
  --line: #35424C; --line-soft: #262F38;
  --brand: #7FB4C2; --brand-hover: #A6CDD8; --brand-wash: #1A2B33;
  --revisie: #F08A80; --revisie-wash: #33201E;
  --gecontroleerd: #7FBF9C; --geco-wash: #1B2A22;
}

/* ---------- basis ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  margin: 0;
  overflow-wrap: break-word;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: var(--step-0);
  line-height: 1.72;
  font-synthesis-weight: none;
}

h1, h2, h3, h4 { font-family: var(--display); line-height: 1.15; letter-spacing: -0.018em; margin: 0; font-weight: 700; }
h1 { font-size: var(--step-4); }
/* De kop staat vast bovenaan, dus een sprong naar een anker zet de kop waar je heen
   springt eronder en lijkt de link niet te werken. Deze marge houdt hem vrij. */
:where(h2, h3, h4, [id]) { scroll-margin-top: 5rem; }

h2 { font-size: var(--step-2); margin-top: var(--sp-6); margin-bottom: var(--sp-3); }
h3 { font-size: var(--step-1); margin-top: var(--sp-5); margin-bottom: var(--sp-2); font-weight: 600; }
p  { margin: 0 0 var(--sp-3); }
a  { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--brand-hover); }
:focus-visible { outline: 2.5px solid var(--brand); outline-offset: 3px; border-radius: 2px; }
img { max-width: 100%; height: auto; display: block; }
code { font-family: var(--meta); font-size: 0.88em; }

.wrap    { width: min(100% - 2.4rem, var(--breed)); margin-inline: auto; }
.kolom   { width: min(100% - 2.4rem, var(--kolom)); margin-inline: auto; }
.skip {
  position: absolute; left: -9999px; top: 0; background: var(--brand); color: #fff;
  padding: var(--sp-2) var(--sp-3); z-index: 99;
}
.skip:focus { left: var(--sp-3); top: var(--sp-3); }

/* ---------- maatlabel: het utility-lettertype doet de metadata ---------- */
.maat {
  font-family: var(--meta); font-size: 0.7rem; letter-spacing: 0.13em; overflow-wrap: anywhere;
  text-transform: uppercase; color: var(--ink-soft); font-weight: 500;
}

/* ---------- kop van de site ---------- */
.sitekop {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  position: sticky; top: 0; z-index: 20;
}
.sitekop .wrap { display: flex; align-items: center; gap: var(--sp-3); min-height: 4.2rem; flex-wrap: wrap; padding-block: 0.5rem; }
.merk { display: flex; align-items: baseline; gap: 0.5rem; text-decoration: none; color: var(--ink); }
.merk b { font-family: var(--display); font-weight: 700; font-size: 1.28rem; letter-spacing: -0.03em; }
.merk .sinds { font-family: var(--meta); font-size: 0.62rem; letter-spacing: 0.16em; color: var(--ink-soft); text-transform: uppercase; }
.sitenav { margin-left: auto; display: flex; gap: var(--sp-3); align-items: center; flex-wrap: wrap; }
.sitenav a { font-family: var(--display); font-size: 0.94rem; font-weight: 600; text-decoration: none; color: var(--ink-soft); }
.sitenav a:hover { color: var(--brand); }
.themaknop {
  font-family: var(--meta); font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase;
  background: none; border: 1px solid var(--line); color: var(--ink-soft);
  padding: 0.4rem 0.6rem; border-radius: var(--radius); cursor: pointer;
}
.themaknop:hover { border-color: var(--brand); color: var(--brand); }

/* ---------- zoek ---------- */
.zoekdoos { display: flex; border: 1.5px solid var(--ink); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.zoekdoos input {
  flex: 1; border: 0; padding: 0.95rem 1.1rem; font-family: var(--body);
  font-size: var(--step-0); background: transparent; color: var(--ink); min-width: 0;
}
/* De standaardomlijning uitzetten mag alleen als er iets beters voor terugkomt. De vorige
   vervanging was een lichte wash met ongeveer 1,1 op 1 contrast tegen het vlak eromheen, en
   dat is voor een toetsenbordgebruiker onzichtbaar. Nu een omlijning in de merkkleur, die
   dezelfde 3 op 1 haalt als elke andere focus op deze site. */
.zoekdoos input:focus { outline: none; }
.zoekdoos:focus-within { outline: 2.5px solid var(--brand); outline-offset: 2px;
                         box-shadow: 0 0 0 3px var(--brand-wash); }
.zoekdoos button {
  border: 0; background: var(--ink); color: var(--paper); cursor: pointer;
  font-family: var(--display); font-weight: 600; font-size: 0.95rem; padding: 0 1.4rem;
}
.zoekdoos button:hover { background: var(--brand); }

/* ---------- titelblok: geleend van de echte bouwtekening ---------- */
.titelblok {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); margin: var(--sp-4) 0 var(--sp-5);
  display: grid; grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
}
.titelblok div { padding: 0.7rem 0.9rem; border-right: 1px solid var(--line-soft); min-width: 0; }
.titelblok div:last-child { border-right: 0; }
.titelblok dt { margin: 0 0 0.2rem; }
.titelblok dd { margin: 0; font-family: var(--display); font-size: 0.92rem; font-weight: 600; }

/* ---------- kort antwoord ---------- */
.kortantwoord {
  background: var(--brand-wash); border-left: 4px solid var(--brand);
  padding: var(--sp-4); border-radius: 0 var(--radius) var(--radius) 0; margin: var(--sp-4) 0 var(--sp-5);
}
.kortantwoord .maat { color: var(--brand); }
.kortantwoord p { font-size: var(--step-1); line-height: 1.55; margin: var(--sp-2) 0 0; }
.kortantwoord p:last-child { margin-bottom: 0; }

/* ---------- signatuur: de doorsnede ---------- */
.doorsnede {
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  padding: var(--sp-4) var(--sp-4) var(--sp-3); margin: var(--sp-5) 0;
}
.doorsnede figcaption { margin-top: var(--sp-3); font-size: var(--step--1); color: var(--ink-soft); line-height: 1.5; }
/* De tekening mag niet meeschalen tot onder de leesbaarheid van zijn eigen tekst.
   Onder de 34rem scrollt hij liever zijwaarts, en de lagen staan er ook als tekst bij. */
.doorsnede-vlak { overflow-x: auto; }
.doorsnede-vlak:focus-visible { outline: 2.5px solid var(--brand); outline-offset: 2px; }
.doorsnede svg { width: 100%; min-width: 30rem; height: auto; display: block; }
.doorsnede .lagen { margin-top: var(--sp-3); border-top: 1px solid var(--line-soft); padding-top: var(--sp-2); }
.doorsnede .lagen > summary { cursor: pointer; font-family: var(--display); font-weight: 600;
                              font-size: var(--step--1); }
.lagenlijst { list-style: none; padding: 0; margin: var(--sp-2) 0 0; font-size: var(--step--1); }
.lagenlijst li { padding: 0.25rem 0; border-bottom: 1px solid var(--line-soft); }
.lagenlijst li:last-child { border-bottom: 0; }
.ds-vlak  { stroke: var(--ink); stroke-width: 1; }
.ds-lijn  { stroke: var(--line); stroke-width: 1; }
.ds-maat  { stroke: var(--ink-soft); stroke-width: .75; }
.ds-tekst { font-family: var(--meta); font-size: 9px; fill: var(--ink); letter-spacing: .04em; }
.ds-num   { font-family: var(--meta); font-size: 9px; fill: var(--paper); font-weight: 600; }

/* ---------- let op en risico ---------- */
.letop, .risico, .gecontroleerd {
  border-left: 4px solid; padding: var(--sp-3) var(--sp-4);
  margin: var(--sp-4) 0; border-radius: 0 var(--radius) var(--radius) 0;
}
.letop  { border-color: var(--ink-soft); background: var(--surface-sub); }
.risico { border-color: var(--revisie); background: var(--revisie-wash); }
.gecontroleerd { border-color: var(--gecontroleerd); background: var(--geco-wash); }
.letop p:last-child, .risico p:last-child, .gecontroleerd p:last-child { margin-bottom: 0; }

/* ---------- stappen ---------- */
ol.stappen { list-style: none; counter-reset: stap; padding: 0; margin: var(--sp-4) 0; }
ol.stappen li {
  counter-increment: stap; position: relative; padding-left: 3rem;
  margin-bottom: var(--sp-3); border-bottom: 1px solid var(--line-soft); padding-bottom: var(--sp-3);
}
ol.stappen li:last-child { border-bottom: 0; }
ol.stappen li::before {
  content: counter(stap, decimal-leading-zero); position: absolute; left: 0; top: 0.15rem;
  font-family: var(--meta); font-size: 0.78rem; color: var(--paper); background: var(--ink);
  width: 2rem; height: 1.55rem; display: grid; place-items: center; border-radius: var(--radius);
}
ol.stappen b { font-family: var(--display); display: block; margin-bottom: 0.15rem; }

/* ---------- tabel ---------- */
.tabelrol { overflow-x: auto; margin: var(--sp-4) 0; }
table { border-collapse: collapse; width: 100%; font-size: var(--step--1); }
th, td { text-align: left; padding: 0.7rem 0.9rem; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
th { font-family: var(--display); font-weight: 600; border-bottom: 1.5px solid var(--ink); white-space: nowrap; }

/* ---------- claimstatus ---------- */
.claim {
  font-family: var(--meta); font-size: 0.62rem; letter-spacing: 0.09em; text-transform: uppercase;
  padding: 0.16rem 0.42rem; border-radius: var(--radius); border: 1px solid currentColor; white-space: nowrap;
}
.claim.geverifieerd { color: var(--gecontroleerd); }
.claim.onderbouwd   { color: var(--brand); }
.claim.historisch   { color: var(--ink-soft); }
.claim.controle     { color: var(--revisie); }
.claim.bronconflict { color: var(--revisie); border-style: dashed; }
.claim.validatie-nodig { color: var(--ink-soft); border-style: dashed; }

/* ---------- kaarten ---------- */
.raster { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.raster.k2 { grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.raster.k3 { grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); }
.kaart { background: var(--surface); padding: var(--sp-4); text-decoration: none; color: inherit; display: block; }
.kaart:hover { background: var(--brand-wash); }
.kaart h3 { margin: var(--sp-2) 0 var(--sp-1); font-size: var(--step-0); }
.kaart p  { margin: 0; font-size: var(--step--1); color: var(--ink-soft); line-height: 1.5; }

/* ---------- probleemlijst ---------- */
.problemen { list-style: none; padding: 0; margin: var(--sp-4) 0; display: grid; gap: 1px; background: var(--line); border-block: 1px solid var(--line); }
.problemen li { background: var(--surface); }
.problemen a { display: flex; gap: var(--sp-3); align-items: baseline; padding: 0.95rem var(--sp-3); text-decoration: none; color: inherit; }
.problemen a:hover { background: var(--brand-wash); color: var(--brand); }
.problemen .vraag { font-family: var(--display); font-weight: 600; }
.problemen .cat { margin-left: auto; }

/* ---------- artikel-indeling ---------- */
.artikel { display: grid; grid-template-columns: minmax(0,1fr); gap: var(--sp-5); padding-block: var(--sp-5) var(--sp-7); }
.artikel > article { min-width: 0; }
.inhoudsrail { display: none; }          /* moet VOOR de media query staan, anders wint hij ervan */
@media (min-width: 62rem) {
  .artikel { grid-template-columns: 13rem var(--kolom); justify-content: center; gap: var(--sp-6); }
  .inhoudsrail { display: block; }
}
.inhoudsrail nav { position: sticky; top: 6rem; border-left: 1px solid var(--line); padding-left: var(--sp-3); }
.inhoudsrail ol { list-style: none; padding: 0; margin: var(--sp-2) 0 0; }
.inhoudsrail li { margin-bottom: 0.45rem; }
.inhoudsrail a { font-size: var(--step--1); text-decoration: none; color: var(--ink-soft); line-height: 1.35; display: block; }
.inhoudsrail a:hover { color: var(--brand); }

.kruimels { font-family: var(--meta); font-size: 0.68rem; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: var(--sp-3); }
.kruimels a { color: var(--ink-soft); text-decoration: none; }
.kruimels a:hover { color: var(--brand); text-decoration: underline; }

.bronnen { font-size: var(--step--1); }
.bronnen li { margin-bottom: var(--sp-2); }

/* ---------- hero ---------- */
.hero { padding-block: var(--sp-6) var(--sp-5); border-bottom: 1px solid var(--line); background: var(--surface); }
.hero h1 { max-width: 20ch; margin-bottom: var(--sp-3); }
.hero .lead { font-size: var(--step-1); color: var(--ink-soft); max-width: 46ch; margin-bottom: var(--sp-4); }
.hero .zoekdoos { max-width: 34rem; }

/* ---------- voet ---------- */
.voet { border-top: 1px solid var(--line); background: var(--surface); padding-block: var(--sp-5); margin-top: var(--sp-7); }
.voet .wrap { display: flex; flex-wrap: wrap; gap: var(--sp-4); align-items: baseline; }
.voet a { color: var(--ink-soft); text-decoration: none; font-size: var(--step--1); }
.voet a:hover { color: var(--brand); text-decoration: underline; }
.voet .rechts { margin-left: auto; }

/* ---------- smalle schermen ---------- */
@media (max-width: 34rem) {
  /* Sectie 45 vraagt 16 tot 20 px lucht aan de zijkant; 1,6rem verdeeld over twee kanten
     gaf er 12,8. */
  .wrap, .kolom { width: calc(100% - 2.25rem); }
  .merk .sinds { display: none; }
  .sitenav { gap: 0.85rem; }
  .sitenav a { font-size: 0.86rem; }
  .voet .wrap { gap: var(--sp-2); }
  .voet .rechts { margin-left: 0; }
  .problemen a { flex-wrap: wrap; gap: 0.2rem; }
  .problemen .cat { margin-left: 0; }
  ol.stappen li { padding-left: 2.6rem; }
}

/* legenda onder de claimtabel: kleiner dan lopende tekst, maar geen kapitalen */
.legenda { font-size: var(--step--1); color: var(--ink-soft); line-height: 1.75; margin-top: var(--sp-4); }
.legenda .claim { margin-inline: 0.1rem; }

/* actieve pagina in de navigatie herkenbaar maken */
.sitenav a[aria-current="page"] { color: var(--ink); text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 2px; }

/* inhoudsopgave op smalle schermen: ingeklapt in plaats van verdwenen */
.toc-mobiel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
              margin-bottom: var(--sp-4); }
.toc-mobiel > summary { cursor: pointer; padding: 0.8rem var(--sp-3); font-family: var(--display);
                        font-weight: 600; font-size: 0.95rem; }
.toc-mobiel[open] > summary { border-bottom: 1px solid var(--line-soft); }
.toc-mobiel nav { padding: var(--sp-3); }
.toc-mobiel ol { list-style: none; padding: 0; margin: 0; }
.toc-mobiel li { margin-bottom: 0.5rem; }
.toc-mobiel a { text-decoration: none; color: var(--ink-soft); font-size: var(--step--1); }
.toc-mobiel a:hover { color: var(--brand); }
@media (min-width: 62rem) { .toc-mobiel { display: none; } }

/* een tabel die zijwaarts scrollt moet ook met het toetsenbord te bedienen zijn */
.tabelrol:focus-visible { outline: 2.5px solid var(--brand); outline-offset: 2px; }
