/* Basis */

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

:root {
    --bg: #f5f7fb;
    --bg-card: #ffffff;
    --accent: #2563eb;
    --accent-soft: rgba(37, 99, 235, 0.08);
    --text: #1f2933;
    --text-muted: #6b7280;
    --border-soft: #e5e7eb;
    --radius-lg: 18px;
    --shadow-soft: 0 10px 25px rgba(15, 23, 42, 0.08);
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: radial-gradient(circle at top left, #e0ebff, #f5f7fb 50%);
    color: var(--text);
    line-height: 1.6;
}

/* Header */

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(16px);
    background: linear-gradient(to right, rgba(255, 255, 255, 0.94), rgba(241, 245, 255, 0.96));
    border-bottom: 1px solid rgba(148, 163, 184, 0.25);
}

/* Reading progress bar onderaan de header */
.reading-bar {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background: transparent;
    overflow: hidden;
}

.reading-bar__inner {
    width: 0;
    height: 100%;
    background: linear-gradient(to right, var(--accent), #4ade80);
    transform-origin: left center;
    transition: width 0.12s ease-out;
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.2rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.site-header h1 {
    margin: 0;
    font-size: 1.6rem;
    letter-spacing: 0.03em;
}

.subtitle {
    margin: 0.2rem 0 0;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.header-meta {
    text-align: right;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Layout */

.layout {
    max-width: 1200px;
    margin: 1.2rem auto 3rem;
    padding: 0 1.5rem;
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 1.5rem;
}

/* Sidebar */

.sidebar {
    position: sticky;
    top: 6rem;
    align-self: flex-start;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.doctor-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 1rem 1rem 1.1rem;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-soft);
}

.doctor-card h2 {
    font-size: 1rem;
    margin-top: 0;
    margin-bottom: 0.4rem;
}

.doctor-card p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.nav-section {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 0.9rem 0.9rem 1rem;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-soft);
    max-height: calc(100vh - 11rem);
    overflow: auto;
}

.nav-section::-webkit-scrollbar {
    width: 6px;
}
.nav-section::-webkit-scrollbar-thumb {
    background-color: rgba(148, 163, 184, 0.7);
    border-radius: 999px;
}

.nav-section h3 {
    margin: 0 0 0.5rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-list li {
    margin-bottom: 0.1rem;
}

.nav-list a {
    display: block;
    padding: 0.3rem 0.4rem;
    border-radius: 999px;
    font-size: 0.88rem;
    text-decoration: none;
    color: var(--text-muted);
    transition: background 0.15s ease, color 0.15s ease, transform 0.08s ease;
}

.nav-list a:hover {
    background: var(--accent-soft);
    color: var(--accent);
    transform: translateX(2px);
}

/* Buttons */

.btn-primary,
.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 1.2rem;
    border-radius: 999px;
    border: none;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.08s ease, box-shadow 0.12s ease, background 0.12s ease, color 0.12s ease;
}

.btn-primary {
    background: var(--accent);
    color: #ffffff;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.35);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 26px rgba(37, 99, 235, 0.4);
}

.btn-secondary {
    background: #eef2ff;
    color: #1d4ed8;
    border: 1px solid rgba(129, 140, 248, 0.4);
}

.btn-secondary:hover {
    background: #e0e7ff;
    transform: translateY(-1px);
}

/* Content */

.content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.content-narrow {
    max-width: 800px;
    margin: 1.5rem auto 3rem;
}

/* Cards / sections */

.card {
    background: var(--bg-card);
    border-radius: 24px;
    padding: 1.3rem 1.4rem;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-soft);
}

.card h2 {
    margin-top: 0;
    margin-bottom: 0.6rem;
    font-size: 1.3rem;
}

.card h3 {
    margin-top: 0.9rem;
    margin-bottom: 0.4rem;
    font-size: 1.05rem;
}

.card p {
    margin: 0.25rem 0;
}

.card ul {
    margin-top: 0.2rem;
    margin-bottom: 0.5rem;
    padding-left: 1.1rem;
}

.card li {
    margin-bottom: 0.18rem;
}

/* Images */

.image-block {
    margin: 0.9rem 0 0.4rem;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid var(--border-soft);
    background: #f9fafb;
}

.image-block img {
    display: block;
    width: 100%;
    height: auto;
}

.image-block figcaption {
    padding: 0.5rem 0.75rem 0.6rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    background: #f9fafb;
}

/* Referenties */

.references-body {
    background: radial-gradient(circle at top, #e0ebff, #f5f7fb 55%);
}

.ref-list {
    list-style: none;
    padding-left: 0;
}

.ref-list li {
    padding: 0.6rem 0;
    border-bottom: 1px dashed #e5e7eb;
}

.ref-list li:last-child {
    border-bottom: none;
}

.ref-note {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Footer */

.site-footer {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(148, 163, 184, 0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.site-footer a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

.site-footer a:hover {
    text-decoration: underline;
}

/* Helpers */

.centered {
    text-align: center;
    margin-top: 0.8rem;
}

/* Zorg dat geklikte secties niet onder de sticky header verdwijnen */
section[id] {
    scroll-margin-top: 96px;
}

/* Responsief */

@media (max-width: 960px) {
    .layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .sidebar {
        position: static;
        top: auto;
        max-width: 100%;
    }

    .nav-section {
        max-height: none;
    }

    .header-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .header-meta {
        text-align: left;
    }
}

@media (max-width: 640px) {
    .header-inner {
        padding: 0.9rem 1rem;
    }

    .layout {
        padding: 0 1rem 2.5rem;
    }

    .card {
        border-radius: 18px;
        padding: 1.05rem 1.1rem;
    }

    .site-footer {
        flex-direction: column;
        gap: 0.3rem;
        align-items: flex-start;
    }
}

/* Referentie-navigatie */

.toc {
  list-style: none;
  margin: 0.3rem 0 0;
  padding: 0;
}

.toc li {
  margin-bottom: 0.25rem;
}

.toc a {
  font-size: 0.9rem;
  text-decoration: none;
  color: var(--text-muted);
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  display: inline-block;
  transition: background 0.12s ease, color 0.12s ease;
}

.toc a:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

/* Kleine helper voor kaart */

.map-wrapper {
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-soft);
  margin-top: 0.75rem;
}

/* Back to top button */

.to-top {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    border: none;
    border-radius: 999px;
    padding: 0.4rem 0.7rem;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    background: var(--accent);
    color: #ffffff;
    box-shadow: var(--shadow-soft);
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
    z-index: 40;
}

.to-top--visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.to-top:hover {
    transform: translateY(-1px);
}