/* ==========================================================================
   SEMANTISCH GROOTBOEK — Scientific Article Design System
   ==========================================================================
   Table of contents:
   1.  Design tokens (CSS custom properties)
   2.  Reset / base styles
   3.  Typography
   4.  Page structure & layout grid
   5.  Header / article masthead
   6.  Main article structure
   7.  Scientific content elements (definitions, findings, evidence)
   8.  Data / evidence elements (ledger, namespace)
   9.  Tables
   10. Figures / charts
   11. Cards / information panels
   12. Sidebar / supporting information (intelligence panel)
   13. Links and references
   14. Responsive behaviour
   15. Accessibility
   16. Utility classes
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. DESIGN TOKENS
   -------------------------------------------------------------------------- */
:root {
  /* Typography */
  --font-serif: "Georgia", "Times New Roman", serif;
  --font-sans: "Mulish", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "SFMono-Regular", "Consolas", "Liberation Mono", monospace;

  --text-xs: 0.75rem;   /* 12px */
  --text-sm: 0.875rem;  /* 14px */
  --text-base: 1rem;    /* 16px */
  --text-md: 1.125rem;  /* 18px */
  --text-lg: 1.25rem;   /* 20px */
  --text-xl: 1.5rem;    /* 24px */
  --text-2xl: 1.875rem; /* 30px */
  --text-3xl: 2.25rem;  /* 36px */

  --leading-tight: 1.2;
  --leading-snug: 1.4;
  --leading-normal: 1.6;
  --leading-relaxed: 1.75;

  /* Spacing scale */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-8: 3rem;
  --space-10: 4rem;
  --space-12: 5rem;
  --space-16: 7rem;

  /* Content width */
  --content-max: 46rem;        /* readable measure for body text */
  --content-wide: 60rem;       /* for figures, tables, wide blocks */
  --sidebar-width: 20rem;
  --layout-gap: var(--space-8);

  /* Colours — restrained scientific palette */
  --color-bg: #f6f5f2;          /* warm paper */
  --color-bg-alt: #ffffff;      /* white panels */
  --color-bg-muted: #ecebe7;    /* subtle grey */
  --color-text: #1a1a1a;        /* near-black */
  --color-text-muted: #4a4a4a;  /* secondary text */
  --color-text-faint: #6b6b6b;  /* tertiary / captions */
  --color-border: #d4d2cc;      /* hairline borders */
  --color-border-strong: #a8a6a0;

  /* Accent — restrained, single primary */
  --color-accent: #1f4e5f;      /* deep teal — scientific */
  --color-accent-hover: #163a47;
  --color-accent-soft: #e3ecef; /* tinted background */

  /* Semantic accents (used sparingly for data/evidence) */
  --color-cyan: #0e7490;
  --color-cyan-soft: #e0f2f7;
  --color-indigo: #3730a3;
  --color-indigo-soft: #e6e4f7;
  --color-emerald: #047857;
  --color-emerald-soft: #e0f2ec;
  --color-slate: #334155;
  --color-slate-soft: #e8ecf1;
  --color-amber: #92400e;
  --color-amber-soft: #fdf0e0;
  --color-green: #166534;
  --color-green-soft: #e6f4ea;
  --color-red: #991b1b;
  --color-red-soft: #fbe9e9;

  /* Borders & shadows */
  --border-radius-sm: 2px;
  --border-radius: 4px;
  --border-radius-md: 6px;
  --border-radius-lg: 8px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 2px 6px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.1);

  /* Responsive breakpoints */
  --bp-sm: 480px;
  --bp-md: 768px;
  --bp-lg: 1024px;
  --bp-xl: 1280px;

  /* Focus */
  --focus-ring: 2px solid var(--color-accent);
  --focus-offset: 2px;
}

/* --------------------------------------------------------------------------
   2. RESET / BASE
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
svg,
video {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}

a:hover {
  color: var(--color-accent-hover);
  text-decoration-thickness: 2px;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

/* --------------------------------------------------------------------------
   3. TYPOGRAPHY
   -------------------------------------------------------------------------- */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-mono);
  font-weight: 700;
  line-height: var(--leading-tight);
  color: var(--color-text);
  margin-bottom: var(--space-4);
}

h1 {
  font-size: var(--text-3xl);
  letter-spacing: -0.01em;
}

h2 {
  font-size: var(--text-2xl);
  letter-spacing: -0.01em;
  margin-top: var(--space-8);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--color-border);
}

h3 {
  font-size: var(--text-xl);
  margin-top: var(--space-6);
}

h4 {
  font-size: var(--text-lg);
  margin-top: var(--space-5);
}

p {
  margin-bottom: var(--space-5);
  max-width: var(--content-max);
}

strong {
  font-weight: 700;
}

em {
  font-style: italic;
}

small {
  font-size: var(--text-sm);
}

/* Lead paragraph */
.lead-text {
  font-size: var(--text-md);
  line-height: var(--leading-relaxed);
  color: var(--color-text-muted);
  max-width: var(--content-max);
}

/* --------------------------------------------------------------------------
   4. PAGE STRUCTURE & LAYOUT GRID
   -------------------------------------------------------------------------- */
.site-wrapper {
  max-width: calc(var(--content-wide) + var(--sidebar-width) + var(--layout-gap) * 2);
  margin: 0 auto;
  padding: var(--space-8) var(--space-5);
}

.layout-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--sidebar-width);
  gap: var(--layout-gap);
  align-items: start;
}

.main-content {
  min-width: 0;
}

/* --------------------------------------------------------------------------
   5. HEADER / ARTICLE MASTHEAD
   -------------------------------------------------------------------------- */
.article-header {
  margin-bottom: var(--space-8);
  padding-bottom: var(--space-6);
  border-bottom: 2px solid var(--color-border-strong);
}

.article-header h1 {
  margin-bottom: var(--space-3);
}

.brand {
  display: inline-block;
}

.brand-logo {
  max-height: 3.5rem;
  width: auto;
}

.article-kicker {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-accent);
  margin-bottom: var(--space-2);
}

.article-title {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-accent);
  margin-bottom: var(--space-2);
}

.publication-meta {
  font-size: var(--text-sm);
  color: var(--color-text-faint);
  margin-bottom: 0;
}

.publication-meta a {
  color: var(--color-text-muted);
}

/* --------------------------------------------------------------------------
   6. MAIN ARTICLE STRUCTURE
   -------------------------------------------------------------------------- */
article {
  font-family: var(--font-serif);
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
}

article p {
  margin-bottom: var(--space-5);
}

/* Table of contents */
.article-toc {
  margin: var(--space-6) 0;
  padding: var(--space-5);
  background-color: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-accent);
  border-radius: var(--border-radius);
}

.toc-title {
  display: block;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
}

.article-toc ol {
  list-style: none;
  counter-reset: toc;
}

.article-toc li {
  counter-increment: toc;
  margin-bottom: var(--space-2);
}

.article-toc li::before {
  content: counter(toc) ".";
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-accent);
  margin-right: var(--space-2);
}

.article-toc a {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--color-text);
  text-decoration: none;
}

.article-toc a:hover {
  color: var(--color-accent);
  text-decoration: underline;
}

/* Section blocks */
.definition-block {
  margin: var(--space-8) 0;
  padding: var(--space-6);
  background-color: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-md);
}

.definition-block h2 {
  margin-top: 0;
  border-bottom: none;
  padding-bottom: 0;
}

/* Accent variants — restrained left border */
.definition-block--cyan {
  border-left: 4px solid var(--color-cyan);
}

.definition-block--indigo {
  border-left: 4px solid var(--color-indigo);
}

.definition-block--emerald {
  border-left: 4px solid var(--color-emerald);
}

.definition-block--slate {
  border-left: 4px solid var(--color-slate);
}

/* --------------------------------------------------------------------------
   7. SCIENTIFIC CONTENT ELEMENTS
   -------------------------------------------------------------------------- */
/* Definition lists (ontological) */
.list-compact {
  margin: var(--space-5) 0 0;
}

.list-compact > div {
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--color-border);
}

.list-compact > div:last-child {
  border-bottom: none;
}

.list-compact dt {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.list-compact dt strong {
  font-family: var(--font-sans);
  font-size: var(--text-md);
  font-weight: 700;
}

.list-compact dd {
  margin: 0;
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  color: var(--color-text-muted);
}

/* Accent colour mapping for evidence rows (data-accent attribute) */
.list-compact > div[data-accent="cyan"],
.list-cards > div[data-accent="cyan"] {
  border-left: 3px solid var(--color-cyan);
  padding-left: var(--space-4);
}

.list-compact > div[data-accent="indigo"],
.list-compact > div[data-accent="indigo-highlight"],
.list-cards > div[data-accent="indigo"],
.list-cards > div[data-accent="indigo-highlight"] {
  border-left: 3px solid var(--color-indigo);
  padding-left: var(--space-4);
}

.list-compact > div[data-accent="emerald"],
.list-cards > div[data-accent="emerald"] {
  border-left: 3px solid var(--color-emerald);
  padding-left: var(--space-4);
}

.list-cards > div[data-accent="amber"] {
  border-left: 3px solid var(--color-amber);
  padding-left: var(--space-4);
}

/* Step badges */
.step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  padding: 0 var(--space-2);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-text);
  background-color: var(--color-bg-muted);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-sm);
}

/* Type tags */
.type-tag {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  background-color: var(--color-bg-muted);
  border-radius: var(--border-radius-sm);
}

/* Warning tag variant (strategic risk labels) */
.type-tag.tag-warning {
  color: var(--color-amber);
  background-color: var(--color-amber-soft);
  border: 1px solid var(--color-amber);
}

/* Sublist grid (debet/credit) */
.sublist-grid {
  list-style: none;
  margin: var(--space-3) 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}

.sublist-grid li {
  padding: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
}

.debet-card {
  background-color: var(--color-cyan-soft);
  border-left: 3px solid var(--color-cyan);
}

.credit-card {
  background-color: var(--color-indigo-soft);
  border-left: 3px solid var(--color-indigo);
}

.blank-card {
  background-color: var(--color-bg-alt);
  border-left: 3px solid var(--color-bg-alt);
}

/* Boardroom callout */
.boardroom-callout {
  margin: var(--space-5) 0;
  padding: var(--space-5);
  background-color: var(--color-slate-soft);
  border-left: 4px solid var(--color-slate);
  border-radius: var(--border-radius);
}

.boardroom-callout p:last-child {
  margin-bottom: 0;
}

/* Block summary */
.block-summary {
  margin-top: var(--space-6);
  padding: var(--space-5);
  background-color: var(--color-bg-muted);
  border-radius: var(--border-radius);
}

.block-summary--highlight {
  background-color: var(--color-amber-soft);
  border-left: 4px solid var(--color-amber);
}

.block-summary p:last-child {
  margin-bottom: 0;
}

.summary-conclusion {
  font-weight: 400;
  color: var(--color-text);
}

/* --------------------------------------------------------------------------
   8. DATA / EVIDENCE ELEMENTS
   -------------------------------------------------------------------------- */
.ledger-summary {
  padding: var(--space-4);
  background-color: var(--color-bg-muted);
  border-radius: var(--border-radius);
}

.ledger-balance {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.balance-icon {
  font-size: var(--text-xl);
}

.balance-label {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: var(--text-md);
}

.ledger-status {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: var(--space-2);
}

.status-green {
  color: var(--color-green);
}

/* Ledger status background variants — semaphore colours.
   Gebruik een van deze modifiers op een .ledger-summary element
   om de achtergrond in te stellen op groen, geel of oranje. */
.ledger-summary--green {
  background-color: var(--color-green-soft);
  border-left: 3px solid var(--color-green);
}

.ledger-summary--yellow {
  background-color: var(--color-amber-soft);
  border-left: 3px solid var(--color-amber);
}

.ledger-summary--orange {
  background-color: var(--color-orange-soft);
  border-left: 3px solid var(--color-orange);
}

.ledger-description {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: 0;
}


/* Namespace grid */
.namespace-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
  margin: var(--space-3) 0;
}

.namespace-item {
  padding: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  text-align: center;
}

.namespace-debet {
  background-color: var(--color-cyan-soft);
  border-left: 3px solid var(--color-cyan);
}

.namespace-credit {
  background-color: var(--color-indigo-soft);
  border-left: 3px solid var(--color-indigo);
}

.namespace-label {
  display: block;
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-1);
}

.namespace-value {
  display: block;
  font-family: var(--font-sans);
  font-size: var(--text-md);
  font-weight: 600;
}

.namespace-note {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   9. TABLES
   -------------------------------------------------------------------------- */
/* (No tables currently in the document, but styles are provided for future use) */
table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-5) 0;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
}

th,
td {
  padding: var(--space-3);
  border: 1px solid var(--color-border);
  text-align: left;
  vertical-align: top;
}

th {
  background-color: var(--color-bg-muted);
  font-weight: 700;
}

/* --------------------------------------------------------------------------
   10. FIGURES / CHARTS
   -------------------------------------------------------------------------- */
figure {
  margin: var(--space-6) 0;
}

figure img {
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
}

figcaption {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--color-text-faint);
  margin-top: var(--space-2);
  line-height: var(--leading-normal);
}

.center-image-semantic {
  margin: 0 auto;
}

.kleine-tekst {
  font-size: var(--text-sm);
}

/* --------------------------------------------------------------------------
   11. CARDS / INFORMATION PANELS
   -------------------------------------------------------------------------- */
.list-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}

.list-cards > div {
  padding: var(--space-4);
  background-color: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
}

.list-cards--wide {
  grid-template-columns: 1fr;
}

/* --------------------------------------------------------------------------
   12. SIDEBAR / SUPPORTING INFORMATION (INTELLIGENCE PANEL)
   -------------------------------------------------------------------------- */
.intelligence-panel {
  position: sticky;
  top: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.panel-card {
  padding: var(--space-5);
  background-color: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-md);
}

.panel-title {
  font-family: var(--font-sans);
  font-size: var(--text-md);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--color-border);
}

.panel-card p {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
}

.panel-card p:last-child {
  margin-bottom: 0;
}

/* CTA panel */
.panel-cta {
  background-color: var(--color-accent-soft);
  border-left: 4px solid var(--color-accent);
}

/* Provenance */
.provenance-links {
  margin: var(--space-3) 0;
}

.provenance-links img {
  max-height: 3rem;
  width: auto;
}

.provenance-author {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
}

/* --------------------------------------------------------------------------
   13. LINKS AND REFERENCES
   -------------------------------------------------------------------------- */
.article-references {
  margin-top: var(--space-8);
  padding-top: var(--space-5);
  border-top: 2px solid var(--color-border-strong);
}

/* Site footer — administrative provenance */
.site-footer {
  margin-top: var(--space-10);
  padding-top: var(--space-5);
  border-top: 1px solid var(--color-border-strong);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.site-footer p {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-bottom: 0;
}

.site-footer a {
  color: var(--color-text-muted);
}

.site-footer a:hover {
  color: var(--color-accent);
}

.footer-right {
  margin-left: auto;
}

.article-references h2 {
  margin-top: 0;
  border-bottom: none;
}

.article-references ol {
  padding-left: var(--space-5);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  color: var(--color-text-muted);
}

.article-references li {
  margin-bottom: var(--space-3);
}

.article-references cite {
  font-style: italic;
}

/* Buttons */
.button {
  display: inline-block;
  padding: var(--space-3) var(--space-5);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--border-radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.button-primary {
  background-color: var(--color-accent);
  color: #ffffff;
}

.button-primary:hover {
  background-color: var(--color-accent-hover);
  color: #ffffff;
  text-decoration: none;
}

/* --------------------------------------------------------------------------
   14. RESPONSIVE BEHAVIOUR
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .layout-grid {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }

  .intelligence-panel {
    position: static;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
  }
}

@media (max-width: 768px) {
  .site-wrapper {
    padding: var(--space-5) var(--space-4);
  }

  h1 {
    font-size: var(--text-2xl);
  }

  h2 {
    font-size: var(--text-xl);
  }

  .sublist-grid {
    grid-template-columns: 1fr;
  }

  .intelligence-panel {
    grid-template-columns: 1fr;
  }

  .definition-block {
    padding: var(--space-4);
  }
}

@media (max-width: 480px) {
  .article-header h1 {
    font-size: var(--text-xl);
  }

  .list-compact dt {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-1);
  }

  .publication-meta {
    font-size: var(--text-xs);
  }
}

/* --------------------------------------------------------------------------
   15. ACCESSIBILITY
   -------------------------------------------------------------------------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: var(--focus-ring);
  outline-offset: var(--focus-offset);
}

a:focus-visible,
button:focus-visible {
  outline: var(--focus-ring);
  outline-offset: var(--focus-offset);
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* --------------------------------------------------------------------------
   16. UTILITY CLASSES
   -------------------------------------------------------------------------- */
/* Only genuinely necessary utilities are included */
.text-muted {
  color: var(--color-text-muted);
}

.text-faint {
  color: var(--color-text-faint);
}

.text-center {
  text-align: center;
}

.mt-0 {
  margin-top: 0;
}

.mb-0 {
  margin-bottom: 0;
}

/* Standaard responsive gedrag voor de afbeelding */
.center-image-rmaanden {
  width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

/* Enkel op grotere schermen (bijv. v.a. 1024px breed) in landscape-stand */
@media screen and (min-width: 1024px) and (orientation: landscape) {
  .center-image-rmaanden {
    width: 80%;
    margin: 0; /* Zet de marges op nul voor linkse uitlijning */
  }
}