:root {
  color-scheme: light dark;
  --container: min(100% - 2rem, 44rem);
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --bg: light-dark(#ffffff, #0d0d0d);
  --text: light-dark(#1a1a1a, #eaeaea);
  --muted: light-dark(#666666, #888888);
  --border: light-dark(#e5e5e5, #222222);
  --surface: light-dark(#f9f9f9, #141414);
  --code-bg: light-dark(#f4f4f4, #181818);
}

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

body {
  font-family: var(--sans);
  font-size: clamp(1rem, 0.95rem + 0.35vw, 1.15rem);
  line-height: 1.7;
  color: var(--text);
  background-color: var(--bg);
}

.container {
  width: var(--container);
  margin-inline: auto;
}

a {
  color: inherit;
  text-decoration: none;
  &:hover { text-decoration: underline; }
}

/* Floating flat header */
header.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--bg);
  border-bottom: 1px solid var(--border);
  padding-block: 0.85rem;

  .header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .brand {
    font-family: var(--mono);
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: -0.02em;
  }

  nav a {
    font-family: var(--mono);
    font-size: 0.9rem;
    color: var(--muted);
    margin-left: 1rem;
  }
}

/* Always-on Breadcrumbs */
nav.breadcrumbs {
  padding-block: 0.75rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--muted);

  .container {
    white-space: nowrap;
    overflow-x: auto;
  }

  .sep {
    margin-inline: 0.4rem;
    opacity: 0.6;
  }

  .current {
    color: var(--text);
    font-weight: 600;
  }
}

/* Content Area */
main.content {
  padding-block: 2.5rem;
}

/* Search Box (Homepage & Results) */
.search-section {
  margin-bottom: 2.5rem;

  .search-box {
    display: flex;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--surface);
    overflow: hidden;

    &:focus-within {
      border-color: var(--text);
    }

    input[type="text"] {
      flex: 1;
      padding: 0.85rem 1rem;
      font-size: 1rem;
      font-family: inherit;
      color: var(--text);
      background: transparent;
      border: none;
      outline: none;
    }

    button {
      padding: 0.85rem 1.25rem;
      font-family: var(--mono);
      font-size: 0.9rem;
      color: var(--bg);
      background: var(--text);
      border: none;
      cursor: pointer;
      font-weight: 600;
      &:hover { opacity: 0.9; }
    }
  }
}

/* Article Reader */
article {
  h1 {
    font-size: clamp(1.75rem, 1.5rem + 1vw, 2.3rem);
    line-height: 1.25;
    letter-spacing: -0.03em;
    margin-bottom: 0.75rem;
  }

  .meta {
    font-family: var(--mono);
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  h2 { font-size: 1.45rem; margin-top: 2rem; margin-bottom: 0.75rem; letter-spacing: -0.02em; }
  h3 { font-size: 1.2rem; margin-top: 1.5rem; margin-bottom: 0.5rem; }
  p, ul, ol { margin-bottom: 1.25rem; }
  ul, ol { padding-left: 1.5rem; }
  a { text-decoration: underline; text-underline-offset: 3px; }

  /* External link met new-tab indicatie */
  .external-link {
    display: inline-flex;
    align-items: baseline;
    gap: 0.22em;
    text-underline-offset: 3px;
  }

  .ext-icon {
    display: inline-block;
    vertical-align: middle;
    opacity: 0.65;
    transition: opacity 0.15s ease, transform 0.15s ease;
    transform: translateY(-0.04em);
  }

  .external-link:hover .ext-icon {
    opacity: 1;
    transform: translate(0.08em, -0.12em);
  }

  blockquote:not(.summary-card):not(:has(h3)) {
    border-left: 3px solid var(--muted);
    padding-left: 1rem;
    color: var(--muted);
    margin-bottom: 1.25rem;
    font-style: italic;
  }

  /* Gestileerde TL;DR / Samenvatting Callout */
  .summary-card,
  blockquote.summary-card,
  blockquote:has(h3) {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 3px solid var(--text);
    border-radius: 4px;
    padding: 1.25rem 1.4rem;
    margin-block: 1.5rem 2rem;
    font-style: normal;
    color: var(--text);

    h3, .summary-title {
      font-family: var(--mono);
      font-size: 0.85rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      color: var(--muted);
      margin-top: 0;
      margin-bottom: 0.75rem;
      padding-bottom: 0.4rem;
      border-bottom: 1px solid var(--border);
    }

    ul {
      margin-bottom: 0;
      padding-left: 1.25rem;
    }

    li {
      margin-bottom: 0.45rem;
      font-size: 0.98rem;
      line-height: 1.6;
      &:last-child { margin-bottom: 0; }
    }
  }
}

/* Monospace, Code & Blocks */
pre, code {
  font-family: var(--mono);
  font-size: 0.88em;
}

code {
  background: var(--code-bg);
  padding: 0.15rem 0.35rem;
  border-radius: 3px;
}

pre {
  background: var(--code-bg);
  padding: 1rem;
  border-radius: 4px;
  overflow-x: auto;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border);

  code {
    background: none;
    padding: 0;
  }
}

/* Article List */
.article-list {
  list-style: none;

  .article-item {
    padding-block: 1.25rem;
    border-bottom: 1px solid var(--border);
    &:first-child { border-top: 1px solid var(--border); }

    .title {
      display: block;
      font-size: 1.25rem;
      font-weight: 600;
      margin-bottom: 0.35rem;
    }

    .summary {
      font-size: 0.95rem;
      color: var(--muted);
      margin-bottom: 0.5rem;
    }

    .item-meta {
      font-family: var(--mono);
      font-size: 0.8rem;
      color: var(--muted);
    }
  }
}

/* AI Synthesis Box */
.ai-synthesis {
  margin-top: 0;
  margin-bottom: 2rem;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--text);
  border-radius: 4px;
  font-family: var(--sans);
  color: var(--text);

  h3 {
    font-size: 0.85rem;
    font-family: var(--mono);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    margin-bottom: 0.5rem;
  }
}

.section-title {
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 1rem;
}

.raw-link {
  color: var(--muted);
}

.empty-state {
  color: var(--muted);
}


/* Footer */
footer.site-footer {
  border-top: 1px solid var(--border);
  padding-block: 1.5rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);

  .footer-inner {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
}
