/*
  Aldus — huisstijl
  Afgeleid van het beeldmerk: Aldus-blauw (#0d3793) op wit, vette Helvetica.
  - Helvetica (systeemletter, niet meegeleverd) voor merknaam, koppen en interface.
  - Source Serif 4 (variabel, optische maten) voor lopende tekst.
  Tekstmaat ~65 tekens, regelafstand 1,6, verticale ritme in hele regels (--ruimte).
  Alle waarden staan ook in het designsysteem (tokens.json).
*/

@font-face {
  font-family: "Source Serif 4";
  src: url("/fonts/source-serif-4-normal.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("/fonts/source-serif-4-italic.woff2") format("woff2");
  font-weight: 200 900;
  font-style: italic;
  font-display: swap;
}

:root {
  color-scheme: light;

  /* Kleur */
  --blauw: #0d3793;        /* Aldus-blauw, uit het beeldmerk */
  --blauw-diep: #09286e;   /* hover en actief */
  --blauw-tint: #eef1fa;   /* rustige vlakken: code, markering */
  --papier: #ffffff;
  --inkt: #161a26;
  --inkt-zacht: #555c70;
  --lijn: #e5e5e5;         /* dezelfde grijze rand als rond het beeldmerk */

  /* Letter */
  --sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --serif: "Source Serif 4", "Iowan Old Style", "Palatino Linotype", Georgia, serif;

  /* Maten */
  --tekstgrootte: clamp(1.125rem, 1rem + 0.45vw, 1.3125rem); /* 18–21px */
  --regel: 1.6;
  --maat: 34rem;   /* ~65 tekens */
  --ruimte: 1.6rem; /* één regel */
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --blauw: #9db4f5;
    --blauw-diep: #c3d1fa;
    --blauw-tint: #18214a;
    --papier: #0b1024;
    --inkt: #e7eaf3;
    --inkt-zacht: #a0a8bd;
    --lijn: #262e4a;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--papier);
  color: var(--inkt);
  font-family: var(--serif);
  font-size: var(--tekstgrootte);
  line-height: var(--regel);
  font-optical-sizing: auto;
  font-kerning: normal;
  font-variant-ligatures: common-ligatures;
  font-feature-settings: "onum" 1;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  hanging-punctuation: first;
}

.kop, main, .voet {
  max-width: var(--maat);
  margin-inline: auto;
  padding-inline: 1.25rem;
  box-sizing: content-box;
}

:focus-visible { outline: 2px solid var(--blauw); outline-offset: 3px; border-radius: 2px; }

/* Kop: beeldmerk + merknaam */
.kop {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  padding-block: 1.75rem 0;
  font-family: var(--sans);
}
.merk {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--blauw);
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: -0.02em;
}
.merk img {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--lijn);
}
.kop nav { display: flex; flex-wrap: wrap; gap: 0.4rem 1.25rem; }
.kop nav a {
  color: var(--inkt-zacht);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
}
.kop nav a:hover, .kop nav a[aria-current] { color: var(--blauw); }

main { padding-block: calc(var(--ruimte) * 3) calc(var(--ruimte) * 2); }

.voet {
  padding-block: var(--ruimte) calc(var(--ruimte) * 2);
  color: var(--inkt-zacht);
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 500;
}
.voet p { border-top: 1px solid var(--lijn); padding-top: var(--ruimte); margin: 0; }

/* Koppen */
h1, h2, h3 {
  font-family: var(--sans);
  line-height: 1.15;
  text-wrap: balance;
  letter-spacing: -0.015em;
}
h1 {
  font-size: clamp(2rem, 1.4rem + 2.4vw, 2.9rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--blauw);
  margin: 0 0 calc(var(--ruimte) * 0.5);
}
h2 { font-size: 1.3rem; font-weight: 700; margin: calc(var(--ruimte) * 2) 0 calc(var(--ruimte) * 0.5); }
h3 { font-size: 1.05rem; font-weight: 700; margin: calc(var(--ruimte) * 1.5) 0 calc(var(--ruimte) * 0.25); }

.sectiekop {
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blauw);
  margin-bottom: var(--ruimte);
}

/* Lopende tekst */
p, ul, ol, blockquote, pre, figure { margin: 0 0 var(--ruimte); }
p { text-wrap: pretty; hyphens: auto; }

a {
  color: inherit;
  text-decoration-color: var(--blauw);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.18em;
}
a:hover { color: var(--blauw); }

.lead {
  font-size: 1.2em;
  line-height: 1.45;
  color: var(--inkt-zacht);
  font-style: italic;
  margin-bottom: var(--ruimte);
}
.meta {
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--inkt-zacht);
}

.artikel header { margin-bottom: calc(var(--ruimte) * 2); }

blockquote {
  margin-inline: 0;
  padding-left: 1.2rem;
  border-left: 3px solid var(--blauw);
  font-style: italic;
}
blockquote p:last-child { margin-bottom: 0; }

ul, ol { padding-left: 1.25rem; }
li + li { margin-top: 0.3em; }
li::marker { color: var(--blauw); font-family: var(--sans); font-weight: 700; font-size: 0.85em; }

hr {
  border: 0;
  margin: calc(var(--ruimte) * 2) 0;
  text-align: center;
}
hr::after { content: "⁂"; color: var(--blauw); }

code, pre { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.85em; }
code { background: var(--blauw-tint); padding: 0.1em 0.3em; border-radius: 3px; }
pre { overflow-x: auto; padding: 1rem; background: var(--blauw-tint); border-radius: 4px; }
pre code { background: none; padding: 0; }

img { max-width: 100%; height: auto; }

/* Voetnoten (markdown-it-footnote) */
.footnote-ref a, .footnote-backref { text-decoration: none; color: var(--blauw); font-family: var(--sans); font-weight: 700; }
.footnote-ref { font-size: 0.65em; line-height: 0; }
hr.footnotes-sep { margin: calc(var(--ruimte) * 2) 0 var(--ruimte); border-top: 1px solid var(--lijn); }
hr.footnotes-sep::after { content: none; }
.footnotes { font-size: 0.85rem; color: var(--inkt-zacht); }

/* Lijsten van stukken */
.lijst { list-style: none; padding: 0; margin-bottom: calc(var(--ruimte) * 1.5); }
.lijst li { margin: 0 0 calc(var(--ruimte) * 1.25); }
.lijst li::marker { content: none; }
.lijst a {
  font-family: var(--sans);
  font-size: 1.15em;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.25;
  text-decoration: none;
  color: var(--inkt);
}
.lijst a:hover { color: var(--blauw); }
.lijst p { margin: 0.25em 0 0.15em; }
.lijst time { display: block; font-family: var(--sans); font-size: 0.72rem; font-weight: 500; color: var(--inkt-zacht); }

.lijst--compact li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: calc(var(--ruimte) * 0.5);
}
.lijst--compact a { font-size: 1em; font-weight: 600; }
.lijst--compact time { flex-shrink: 0; font-variant-numeric: tabular-nums; }

.intro { margin-bottom: calc(var(--ruimte) * 2); }
.intro h1 { font-size: clamp(2.6rem, 1.8rem + 3.5vw, 3.8rem); }
.terug { margin-top: calc(var(--ruimte) * 2); font-family: var(--sans); font-size: 0.8rem; font-weight: 600; }
.terug a { text-decoration: none; color: var(--inkt-zacht); }
.terug a:hover { color: var(--blauw); }

/* Consultancy */
.projectregel { font-family: var(--sans); font-size: 0.8rem; font-weight: 600; color: var(--inkt-zacht); margin: 0.3em 0 0; }
.label {
  display: inline-block;
  vertical-align: 0.2em;
  margin-left: 0.4rem;
  padding: 0.1em 0.45em;
  font-family: var(--sans);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--blauw);
  border: 1px solid var(--blauw);
  border-radius: 3px;
}
.project .sectiekop { margin-bottom: calc(var(--ruimte) * 0.5); }
.project .sectiekop a { color: inherit; text-decoration: none; }
.feiten {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: calc(var(--ruimte) * 0.5) 1.5rem;
  margin: var(--ruimte) 0 0;
  padding-top: var(--ruimte);
  border-top: 1px solid var(--lijn);
  font-family: var(--sans);
  font-size: 0.8rem;
  line-height: 1.4;
}
.feiten dt { font-size: 0.65rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--inkt-zacht); margin-bottom: 0.2rem; }
.feiten dd { margin: 0; font-weight: 600; }

@media (max-width: 30rem) {
  .lijst--compact li { display: block; }
}

/* Nieuwsbrief */
.aanmelden {
  margin-top: calc(var(--ruimte) * 2);
  padding-top: var(--ruimte);
  border-top: 1px solid var(--lijn);
}
.aanmelden .sectiekop { margin-bottom: calc(var(--ruimte) * 0.5); }
.aanmeldformulier { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: var(--ruimte); }
.aanmeldformulier input[type="email"], .zoeken input {
  flex: 1 1 14rem;
  min-width: 0;
  padding: 0.55em 0.75em;
  font: 500 0.9rem/1.3 var(--sans);
  color: var(--inkt);
  background: var(--papier);
  border: 1px solid var(--inkt-zacht);
  border-radius: 4px;
}
.aanmeldformulier button {
  padding: 0.55em 1.1em;
  font: 700 0.9rem/1.3 var(--sans);
  color: #fff;
  background: var(--blauw);
  border: 0;
  border-radius: 4px;
  cursor: pointer;
}
.aanmeldformulier button:hover { background: var(--blauw-diep); }
@media (prefers-color-scheme: dark) {
  .aanmeldformulier button { color: var(--papier); }
}
.verborgen {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Consultancy: soorten werk en contact */
.werk { list-style: none; padding: 0; counter-reset: werk; margin-bottom: calc(var(--ruimte) * 2); }
.werk li { counter-increment: werk; padding-left: 2.2rem; position: relative; margin-bottom: var(--ruimte); }
.werk li::before {
  content: counter(werk);
  position: absolute; left: 0; top: 0.1em;
  font: 700 1.3rem/1 var(--sans);
  color: var(--blauw);
}
.werk h3 { margin: 0 0 0.25rem; }
.werk p { margin: 0; }
.contact {
  margin-top: calc(var(--ruimte) * 2);
  padding: var(--ruimte);
  background: var(--blauw-tint);
  border-radius: 6px;
}
.contact .sectiekop { margin-bottom: calc(var(--ruimte) * 0.5); }
.contact p:last-child { margin-bottom: 0; }
.knop {
  display: inline-block;
  padding: 0.55em 1.1em;
  font: 700 0.9rem/1.3 var(--sans);
  color: #fff;
  background: var(--blauw);
  border-radius: 4px;
  text-decoration: none;
}
.knop:hover { color: #fff; background: var(--blauw-diep); }
@media (prefers-color-scheme: dark) {
  .knop, .knop:hover { color: var(--papier); }
}

/* Zoeken (Pagefind) */
.zoeken {
  --pagefind-ui-scale: 0.9;
  --pagefind-ui-primary: var(--blauw);
  --pagefind-ui-text: var(--inkt);
  --pagefind-ui-background: var(--papier);
  --pagefind-ui-border: var(--lijn);
  --pagefind-ui-tag: var(--blauw-tint);
  --pagefind-ui-border-width: 1px;
  --pagefind-ui-border-radius: 4px;
  --pagefind-ui-font: var(--sans);
}
.zoeken .pagefind-ui__result-title { font-family: var(--sans); }
.zoeken .pagefind-ui__result-excerpt { font-family: var(--serif); }
.zoeken mark { background: var(--blauw-tint); color: inherit; }

.meta > .label:first-child { margin-left: 0; }
