/* ==========================================================================
   Ruben Winters — basisstijlen
   Licht/donker via systeemvoorkeur + handmatige toggle.
   ========================================================================== */

:root {
  --bg:        #fafaf9;
  --bg-subtle: #f2f1ef;
  --fg:        #1c1c1a;
  --fg-muted:  #6b6b66;
  --accent:    #1d4ed8;
  --border:    #e2e1dd;
  --code-bg:   #f2f1ef;

  --max-width: 46rem;
  --radius:    6px;

  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

html.dark {
  --bg:        #131312;
  --bg-subtle: #1c1c1a;
  --fg:        #e8e7e3;
  --fg-muted:  #9a9a93;
  --accent:    #7aa2f7;
  --border:    #2c2c29;
  --code-bg:   #1c1c1a;
}

@media (prefers-color-scheme: dark) {
  html:not(.light) {
    --bg:        #131312;
    --bg-subtle: #1c1c1a;
    --fg:        #e8e7e3;
    --fg-muted:  #9a9a93;
    --accent:    #7aa2f7;
    --border:    #2c2c29;
    --code-bg:   #1c1c1a;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ── Links ──────────────────────────────────────────────────────────────── */
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }

/* ── Skip link (toegankelijkheid) ──────────────────────────────────────── */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: .5rem 1rem;
  z-index: 100;
}
.skip-link:focus { left: 0; }

/* ── Header / nav ──────────────────────────────────────────────────────── */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(8px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.5rem;
}

.brand {
  font-weight: 700;
  color: var(--fg);
  letter-spacing: -0.01em;
  font-size: 1.05rem;
}
.brand:hover { text-decoration: none; color: var(--accent); }

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-size: .95rem;
}

.site-nav a { color: var(--fg-muted); }
.site-nav a:hover { color: var(--fg); text-decoration: none; }
.site-nav a.active { color: var(--fg); font-weight: 600; }

/* ── Thema-toggle ──────────────────────────────────────────────────────── */
#theme-toggle {
  background: none;
  border: 1px solid var(--border);
  color: var(--fg-muted);
  border-radius: var(--radius);
  width: 2rem;
  height: 2rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .95rem;
  padding: 0;
  line-height: 1;
}
#theme-toggle:hover { color: var(--fg); border-color: var(--fg-muted); }

.theme-icon-dark { display: none; }
html.dark .theme-icon-light { display: none; }
html.dark .theme-icon-dark { display: inline; }

@media (prefers-color-scheme: dark) {
  html:not(.light) .theme-icon-light { display: none; }
  html:not(.light) .theme-icon-dark { display: inline; }
}

/* ── Main / typografie ─────────────────────────────────────────────────── */
main { padding: 2.5rem 1.25rem 4rem; }

h1, h2, h3, h4 {
  line-height: 1.25;
  letter-spacing: -0.015em;
  margin: 2rem 0 .75rem;
  font-weight: 700;
}
h1 { font-size: 2rem; margin-top: 0; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.15rem; }

p { margin: 0 0 1.1rem; }

.lead {
  font-size: 1.15rem;
  color: var(--fg-muted);
  margin-bottom: 1.5rem;
}

.muted { color: var(--fg-muted); }

/* ── Hero ──────────────────────────────────────────────────────────────── */
.hero { margin-bottom: 2.5rem; }
.hero h1 { margin-bottom: .5rem; }

/* ── Prose (artikelinhoud) ─────────────────────────────────────────────── */
.prose { max-width: 100%; }

.prose blockquote {
  margin: 1.5rem 0;
  padding: .25rem 1.25rem;
  border-left: 3px solid var(--accent);
  color: var(--fg-muted);
  font-style: italic;
}

.prose code {
  font-family: var(--font-mono);
  font-size: .88em;
  background: var(--code-bg);
  padding: .15em .4em;
  border-radius: 4px;
}

.prose pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  overflow-x: auto;
  font-size: .87rem;
  line-height: 1.55;
}
.prose pre code {
  background: none;
  padding: 0;
  font-size: inherit;
}

.prose img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
}

.prose hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: .93rem;
}
.prose th, .prose td {
  text-align: left;
  padding: .6rem .75rem;
  border-bottom: 1px solid var(--border);
}
.prose th { font-weight: 600; background: var(--bg-subtle); }

/* ── Post-lijsten ──────────────────────────────────────────────────────── */
.post-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.post-list li {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}
.post-list li:last-child { border-bottom: 0; }
.post-list a { font-weight: 600; font-size: 1.05rem; }
.post-list time {
  display: block;
  color: var(--fg-muted);
  font-size: .85rem;
  margin-top: .2rem;
}
.post-excerpt {
  color: var(--fg-muted);
  font-size: .95rem;
  margin: .4rem 0 0;
}

.post-list-full .post-item { padding: 1.5rem 0; }
.post-list-full h2 { margin: 0 0 .35rem; font-size: 1.25rem; }

/* ── Post-meta ─────────────────────────────────────────────────────────── */
.post-meta {
  color: var(--fg-muted);
  font-size: .88rem;
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  align-items: center;
}
.post-meta .sep { opacity: .5; }

.tags, .post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  font-size: .88rem;
}
.post-tags { margin-top: 2rem; }

/* ── Post-navigatie ────────────────────────────────────────────────────── */
.post-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: .93rem;
  margin-top: 2rem;
}
.post-nav .next { text-align: right; margin-left: auto; }

/* ── Accordion (<details>) ─────────────────────────────────────────────── */
.accordion {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 1.25rem 0;
  background: var(--bg-subtle);
  overflow: hidden;
}
.accordion summary {
  cursor: pointer;
  padding: .85rem 1.1rem;
  font-weight: 600;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  user-select: none;
}
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary::after {
  content: "+";
  font-weight: 400;
  font-size: 1.2rem;
  color: var(--fg-muted);
  transition: transform .15s ease;
}
.accordion[open] summary::after { content: "−"; }
.accordion summary:hover { background: var(--bg); }
.accordion-content {
  padding: 0 1.1rem 1rem;
  border-top: 1px solid var(--border);
}
.accordion-content > :first-child { margin-top: 1rem; }

/* ── Callouts ──────────────────────────────────────────────────────────── */
.callout {
  border-left: 3px solid var(--accent);
  background: var(--bg-subtle);
  padding: .9rem 1.15rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 1.5rem 0;
  font-size: .95rem;
}
.callout p { margin: 0; }

.callout-waarschuwing { border-left-color: #d97706; }
.callout-tip { border-left-color: #059669; }

/* ── Footer ────────────────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.75rem 0 2.5rem;
  color: var(--fg-muted);
  font-size: .87rem;
}
.site-footer p { margin: .25rem 0; }
.footer-links a { color: var(--fg-muted); }
.footer-links a:hover { color: var(--accent); }

/* ── 404 ───────────────────────────────────────────────────────────────── */
.error-page { text-align: center; padding: 3rem 0; }
.error-page h1 { font-size: 4rem; margin-bottom: .5rem; }

/* ── Responsief ────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  body { font-size: 16px; }

  .header-inner {
    flex-wrap: wrap;
    gap: .5rem;
    padding-top: .6rem;
    padding-bottom: .6rem;
  }

  .site-nav {
    gap: .9rem;
    font-size: .9rem;
    flex-wrap: wrap;
  }

  h1 { font-size: 1.65rem; }
  h2 { font-size: 1.25rem; }

  main { padding: 2rem 1.25rem 3rem; }

  .post-nav { flex-direction: column; }
  .post-nav .next { text-align: left; margin-left: 0; }

  .error-page h1 { font-size: 3rem; }
}

/* ── Print ─────────────────────────────────────────────────────────────── */
@media print {
  .site-header, .site-footer, .skip-link, #theme-toggle { display: none; }
  body { background: #fff; color: #000; font-size: 12pt; }
  a { color: #000; text-decoration: underline; }
  .accordion[open] .accordion-content,
  .accordion .accordion-content { display: block; }
  .accordion summary::after { display: none; }
}

/* ── Beweging verminderen ──────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
