/* base.css — Gedeeld basisskelet van alle vier de academies: topbalk, zijbalk en navigatie, hoofdstukpagina's, zoeken, bladeren.
   Gedeeld bestand: wijzig het in shared/files/base.css en draai node shared/sync.mjs.
   Laadt vóór css/style.css; wat een site anders wil, zet die in zijn eigen style.css. */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
.nav-toggle {
  display: none; background: none; border: 1px solid var(--border);
  color: var(--text); font-size: 18px; border-radius: 6px; padding: 4px 10px; cursor: pointer;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--accent); flex-shrink: 0; }
.brand-logo { width: 28px; height: 28px; }
.brand-text { font-family: var(--mono); font-weight: 600; font-size: 15px; letter-spacing: 0.08em; color: var(--text); }
.brand-sep { color: var(--accent); }
#search {
  width: 100%; background: var(--bg-panel); border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); font-family: var(--sans); font-size: 14px; padding: 8px 14px; outline: none;
  transition: border-color 0.15s;
}
#search:focus { border-color: var(--accent-dim); }
#search::placeholder { color: var(--text-faint); }
.search-results a { display: block; padding: 9px 12px; border-radius: 7px; text-decoration: none; color: var(--text); }
.search-results a:hover { background: var(--bg-hover); }
.search-results .sr-snippet { display: block; font-size: 12.5px; color: var(--text-dim); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-results .sr-empty { padding: 12px; color: var(--text-dim); font-size: 14px; }
.layout { display: flex; padding-top: var(--topbar-h); min-height: 100vh; }
.sidebar {
  position: fixed; top: var(--topbar-h); bottom: 0; left: 0; width: var(--sidebar-w); overflow-y: auto;
  background: var(--bg-panel); border-right: 1px solid var(--border); padding: 16px 12px 24px;
  display: flex; flex-direction: column;
}
.sidebar-foot { margin-top: auto; padding: 18px 10px 0; font-size: 11.5px; font-family: var(--mono); color: var(--text-faint); letter-spacing: 0.04em; }
.sidebar-overlay { display: none; }
.nav-ch { margin-bottom: 4px; }
.nav-ch-head {
  display: flex; align-items: baseline; gap: 10px; width: 100%; background: none; border: none;
  color: var(--text); font-family: var(--sans); font-size: 14px; font-weight: 600; text-align: left;
  padding: 9px 10px; border-radius: 8px; cursor: pointer;
}
.nav-ch-head:hover { background: var(--bg-hover); }
.nav-ch-head .ch-caret { margin-left: auto; color: var(--text-faint); font-size: 10px; transition: transform 0.15s; }
.nav-ch.open .ch-caret { transform: rotate(90deg); }
.nav-sections { display: none; padding: 2px 0 6px; }
.nav-ch.open .nav-sections { display: block; }
.nav-sec { display: block; padding: 6px 10px 6px 24px; font-size: 13.5px; color: var(--text-dim); text-decoration: none; border-radius: 7px; border-left: 2px solid transparent; }
.nav-sec:hover { background: var(--bg-hover); color: var(--text); }
.nav-sec.active { color: var(--accent); background: var(--accent-bg); border-left-color: var(--accent); }
.home-hero { margin: 10px 0 40px; }
.home-hero h1 { font-size: clamp(28px, 4vw, 42px); line-height: 1.15; margin: 0 0 14px; font-weight: 700; }
.chapter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.chapter-card:hover { border-color: var(--accent-dim); background: var(--bg-raised); transform: translateY(-2px); }
.chapter-card p { margin: 0; font-size: 13.5px; color: var(--text-dim); }
.chapter-card .cc-count { display: inline-block; margin-top: 14px; font-family: var(--mono); font-size: 11.5px; color: var(--text-faint); }
.crumbs { font-family: var(--mono); font-size: 12.5px; color: var(--text-faint); margin-bottom: 18px; }
.crumbs a { color: var(--text-dim); text-decoration: none; }
.crumbs a:hover { color: var(--accent); }
.crumbs .sep { margin: 0 8px; color: var(--text-faint); }
.page-head { border-bottom: 1px solid var(--border); padding-bottom: 18px; margin-bottom: 28px; }
.page-head h1 { margin: 6px 0 0; font-size: clamp(24px, 3vw, 32px); line-height: 1.2; }
article.lesson h2 { font-size: 21px; margin: 44px 0 14px; padding-top: 22px; border-top: 1px solid var(--border-soft); scroll-margin-top: calc(var(--topbar-h) + 16px); }
article.lesson h2:first-child { border-top: none; margin-top: 8px; padding-top: 0; }
article.lesson h3 { font-size: 16.5px; margin: 26px 0 8px; color: var(--text); }
article.lesson li { margin-bottom: 6px; }
article.lesson a { color: var(--accent); }
.term { color: var(--amber); font-style: normal; font-weight: 500; }
a.xref { color: var(--accent); text-decoration: none; border-bottom: 1px dotted var(--accent-dim); }
a.xref:hover { border-bottom-style: solid; }
.example { background: var(--bg-panel); border: 1px solid var(--border); }
.note .lbl { color: var(--accent); }
.warn .lbl { color: var(--amber); }
.example .lbl { color: var(--text-dim); }
p.src { font-size: 0.82em; font-style: italic; color: var(--text-dim); margin-top: 0.6rem; }
table.data th { font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; text-align: left; color: var(--accent); border-bottom: 2px solid var(--border); padding: 8px 14px 8px 0; }
table.data td { border-bottom: 1px solid var(--border-soft); padding: 8px 14px 8px 0; vertical-align: top; }
table.data tr:hover td { background: rgba(255,255,255,0.015); }
figure.diagram svg { width: 100%; height: auto; display: block; }
figure.diagram figcaption { margin-top: 12px; font-size: 13px; color: var(--text-dim); font-family: var(--mono); }
.dg-line { stroke: var(--text-dim); stroke-width: 1.5; fill: none; }
.dg-accent { stroke: var(--accent); stroke-width: 2; fill: none; }
.dg-amber { stroke: var(--amber); stroke-width: 2; fill: none; }
.dg-text { fill: var(--text-dim); font-family: var(--mono); font-size: 12px; }
.dg-dash { stroke-dasharray: 5 4; }
.pager { display: flex; gap: 14px; margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--border); }
.pager a { flex: 1; background: var(--bg-panel); border: 1px solid var(--border); border-radius: 10px; padding: 14px 18px; text-decoration: none; color: var(--text); transition: border-color 0.15s; }
.pager a:hover { border-color: var(--accent-dim); }
.pager .pg-dir { display: block; font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 4px; }
.pager .pg-next { text-align: right; }
.pager .pg-title { font-size: 14px; }
@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .brand-text { display: none; }
  .sidebar { transform: translateX(-100%); transition: transform 0.2s ease; z-index: 90; width: min(var(--sidebar-w), 85vw); }
  body.nav-open .sidebar { transform: translateX(0); }
  body.nav-open .sidebar-overlay { display: block; position: fixed; inset: var(--topbar-h) 0 0 0; background: rgba(0,0,0,0.5); z-index: 80; }
}
@media (max-width: 760px) {
  .lesson table.data { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .lesson table.data > tbody:only-child { display: table; width: 100%; }
}
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-dim); }
::-webkit-scrollbar-track { background: transparent; }
.print-fab {
  position: fixed; top: 74px; right: 30px; z-index: 60; display: inline-flex; align-items: center; gap: 7px;
  background: var(--accent-bg); border: 1px solid var(--accent-dim); color: var(--accent); border-radius: 9px;
  padding: 9px 15px; cursor: pointer; font-family: var(--mono); font-size: 13px; font-weight: 600; letter-spacing: 0.05em;
  box-shadow: 0 3px 12px rgba(0,0,0,0.35);
}
@media (max-width: 820px) {
  .print-fab { top: auto; bottom: 18px; right: 16px; padding: 11px 14px; }
  .print-fab-lbl { display: none; }
}
@media print {
  html, body, .layout, .content { background: #fff !important; color: #111 !important; }
  .layout { display: block !important; }
  h1, h2, h3, .term, strong { color: #111 !important; }
}
