/* Eigen opmaak van deze site. De gedeelde regels staan in css/base.css, css/les.css
   (bron: shared/files/, verspreid met node shared/sync.mjs); die laden vóór dit bestand. */
/* ============================================================
   EMS Leeromgeving — radarscoop-thema
   Donker antraciet-groen, fosforgroen + amber accenten
   ============================================================ */

:root {
  --bg:          #0b1410;
  --bg-panel:    #101b16;
  --bg-raised:   #15231d;
  --bg-hover:    #1a2c24;
  --border:      #233a30;
  --border-soft: #1a2c24;
  --text:        #d8e6de;
  --text-dim:    #8fa89b;
  --text-faint:  #5f7a6c;
  --accent:      #3ddc84;
  --accent-dim:  #2aa763;
  --accent-bg:   rgba(61, 220, 132, 0.08);
  --amber:       #ffb454;
  --amber-bg:    rgba(255, 180, 84, 0.08);
  --danger:      #ff6b6b;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --topbar-h: 56px;
  --sidebar-w: 320px;
}

body {
  margin: 0;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 60% at 70% -10%, rgba(61, 220, 132, 0.05), transparent),
    repeating-linear-gradient(0deg, transparent 0 3px, rgba(255,255,255,0.004) 3px 4px);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
}

/* ---------- Topbar ---------- */

.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
  background: rgba(11, 20, 16, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
}

.brand-logo .sweep {
  transform-origin: 16px 16px;
  animation: sweep 6s linear infinite;
}

@keyframes sweep { to { transform: rotate(360deg); } }

.search-wrap { position: relative; margin-left: auto; width: min(420px, 45vw); }

/* ---------- Taalkiezer ---------- */

.lang-wrap {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
  color: var(--text-dim);
}

.lang-globe { width: 18px; height: 18px; }

#lang-select {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--sans);
  font-size: 13.5px;
  padding: 7px 28px 7px 10px;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%238fa89b' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  background-size: 11px;
  max-width: 180px;
}

#lang-select:hover { border-color: var(--accent-dim); }
#lang-select:focus { border-color: var(--accent-dim); }
#lang-select option { background: var(--bg-raised); color: var(--text); }

body.lang-loading #lang-select {
  opacity: 0.55;
  pointer-events: none;
}

/* Korte melding (toast) */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 16px);
  max-width: min(440px, 90vw);
  background: var(--bg-raised);
  border: 1px solid var(--amber);
  color: var(--text);
  font-size: 14px;
  padding: 12px 18px;
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  z-index: 200;
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }

.search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  max-height: 60vh;
  overflow-y: auto;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  padding: 6px;
}

/* ---------- Layout ---------- */

.sidebar-credit {
  padding: 8px 10px 2px;
  font-size: 10.5px;
  font-family: var(--mono);
  color: var(--text-faint);
  letter-spacing: 0.06em;
  opacity: 0.65;
}

/* Vaste, taal-onafhankelijke disclaimer (zelfde bewoording op alle Adepti-sites). */
.sidebar-disclaimer {
  padding: 10px 10px 4px;
  font-size: 10px;
  font-family: var(--sans);
  color: var(--text-faint);
  line-height: 1.4;
  opacity: 0.6;
}

.content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
  padding: 36px clamp(20px, 5vw, 64px) 100px;
  max-width: calc(var(--sidebar-w) + 980px);
}

/* ---------- Home ---------- */

.home-kicker {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.18em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 10px;
}

.home-hero p { max-width: 720px; color: var(--text-dim); font-size: 17px; }

.chapter-item { display: flex; flex-direction: column; }
.chapter-item .chapter-card { flex: 1; }

.card-audio:empty { display: none; }
.card-audio { margin-top: 8px; }
.card-audio .media-label {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 2px 0 5px;
}
.card-audio audio { width: 100%; height: 34px; }

.chapter-card {
  display: block;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s, transform 0.15s, background 0.15s;
}

.chapter-card h3 { margin: 8px 0 8px; font-size: 17px; line-height: 1.3; }

/* ---------- Lespagina ---------- */

article.lesson p { margin: 0 0 14px; max-width: 76ch; }

article.lesson ul, article.lesson ol { margin: 0 0 16px; padding-left: 26px; max-width: 72ch; }

article.lesson strong { color: #eaf5ee; }
article.lesson em { color: var(--text); }

/* Formuleblok */
.formula {
  font-family: var(--mono);
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 14px 18px;
  margin: 18px 0;
  font-size: 15.5px;
  overflow-x: auto;
  max-width: 76ch;
}

.formula .f-where {
  display: block;
  margin-top: 10px;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--text-dim);
}

.formula .f-where span { display: block; padding-left: 1em; }

/* Notitie / waarschuwing */
.note, .warn, .example, .keypt, .simpel {
  border-radius: 10px;
  padding: 14px 18px;
  margin: 18px 0;
  max-width: 76ch;
  font-size: 14.5px;
}

.note { background: var(--accent-bg); border: 1px solid rgba(61,220,132,0.25); }
.warn { background: var(--amber-bg); border: 1px solid rgba(255,180,84,0.3); }
.keypt { background: rgba(90,160,208,0.08); border: 1px solid rgba(90,160,208,0.3); }
.keypt .lbl { color: #5aa0d0; }
/* Simpel gezegd · In de praktijk: eenvoudige uitleg + toepassing bovenaan moeilijke secties */
.simpel { background: rgba(179,157,219,0.09); border: 1px solid rgba(179,157,219,0.32); border-left: 3px solid #b39ddb; }
.simpel .lbl { color: #b39ddb; }
.simpel .lbl ~ .lbl { margin-top: 12px; }

.note .lbl, .warn .lbl, .example .lbl, .keypt .lbl, .simpel .lbl {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.note p:last-child, .warn p:last-child, .example p:last-child, .keypt p:last-child, .simpel p:last-child { margin-bottom: 0; }

/* Tabellen */
table.data {
  border-collapse: collapse;
  margin: 18px 0;
  font-size: 14px;
  width: 100%;
  max-width: 820px;
}

/* Diagrammen (SVG) */
figure.diagram {
  margin: 24px 0;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  max-width: 820px;
}

.dg-fill   { fill: var(--accent-bg); }
.dg-text-b { fill: var(--text); font-family: var(--mono); font-size: 12px; }

/* Foto's (echte afbeeldingen) */
figure.photo {
  margin: 24px 0;
  max-width: 820px;
}

figure.photo img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #000;
}

figure.photo.compact { max-width: 520px; }

figure.photo figcaption {
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-dim);
  font-family: var(--mono);
  line-height: 1.5;
}

figure.photo figcaption .credit {
  color: var(--text-faint);
  font-style: normal;
}

/* Geïmporteerde illustraties (bijv. Wikimedia) — vaak met witte achtergrond */
figure.illustration { margin: 24px 0; max-width: 760px; }

figure.illustration img {
  width: 100%;
  height: auto;
  display: block;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  box-sizing: border-box;
}

figure.illustration figcaption {
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-dim);
  font-family: var(--mono);
  line-height: 1.5;
}

figure.illustration figcaption .credit { color: var(--text-faint); }

/* Interactieve rekenhulp (calculator) */
.calc {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  padding: 16px 18px;
  margin: 18px 0;
  max-width: 480px;
}

.calc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.calc-row label { font-size: 14px; color: var(--text-dim); }

.calc-row input {
  width: 130px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 14px;
  padding: 6px 10px;
}

.calc-row input:focus { outline: none; border-color: var(--accent-dim); }

.calc-out {
  border-top: 1px solid var(--border-soft);
  padding-top: 12px;
  margin-top: 4px;
  font-size: 15px;
  color: var(--text-dim);
}

.calc-out strong { color: var(--accent); font-family: var(--mono); font-size: 17px; }

/* ---------- Media-slots ---------- */

.media-slot { margin: 20px 0; max-width: 820px; }

.media-slot video, .media-slot audio { width: 100%; border-radius: 10px; outline: none; }

.media-slot video { background: #000; border: 1px solid var(--border); }

.media-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.media-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.media-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 8px;
}

/* ---------- Responsief ---------- */

@media (max-width: 900px) {

  .content { margin-left: 0; padding: 24px 18px 80px; }

  .search-wrap { width: auto; flex: 1; }
  .lang-globe { display: none; }
  #lang-select { max-width: 130px; font-size: 12.5px; padding: 6px 24px 6px 8px; }
}

/* ---------- Print / PDF-knop (zwevend, rechtsboven in het contentgebied) ---------- */
.print-fab:hover { background: var(--bg-hover); border-color: var(--accent); color: var(--accent); }

/* ---------- Glossary flashcards ---------- */
.fc-bar { margin: 14px 0; }
.fc-btn {
  background: var(--accent-bg); border: 1px solid var(--accent-dim); color: var(--accent);
  border-radius: 8px; padding: 8px 14px; cursor: pointer; font-family: var(--mono);
  font-size: 13px; letter-spacing: 0.04em;
}
.fc-btn:hover { background: var(--bg-hover); }
.fc-wrap { margin: 16px 0; max-width: 560px; }
.fc-card {
  border: 1px solid var(--border); border-left: 4px solid var(--accent);
  background: var(--bg-raised); border-radius: 10px; padding: 26px 22px; min-height: 120px;
  cursor: pointer; text-align: center; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px;
}
.fc-card .fc-q { font-size: 24px; font-weight: 600; color: var(--text); font-family: var(--mono); }
.fc-card .fc-a { font-size: 16px; color: var(--text-dim); line-height: 1.5; }
.fc-card .fc-hint { font-size: 11.5px; color: var(--text-faint); font-family: var(--mono); letter-spacing: 0.05em; }
.fc-controls { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.fc-controls button {
  background: none; border: 1px solid var(--border); color: var(--text-dim);
  border-radius: 7px; padding: 7px 14px; cursor: pointer; font-size: 13px;
}
.fc-controls button:hover { background: var(--bg-hover); color: var(--accent); border-color: var(--accent-dim); }
.fc-progress { font-family: var(--mono); font-size: 12px; color: var(--text-faint); }

/* ---------- Nav: modulegroepering (Deel A) ---------- */
.nav-mod { margin-bottom: 4px; }
.nav-mod-head {
  display: flex; align-items: center; gap: 8px; width: 100%;
  background: none; border: none; color: var(--accent);
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  text-align: left; padding: 11px 10px 6px; cursor: pointer;
}
.nav-mod-head .mod-caret { margin-left: auto; color: var(--text-faint); font-size: 10px; transition: transform 0.15s; }
.nav-mod.open > .nav-mod-head .mod-caret { transform: rotate(90deg); }
.nav-mod-chs { display: none; padding-bottom: 4px; }
.nav-mod.open .nav-mod-chs { display: block; }

/* ---------- Home: modulegroepering (Deel A) ---------- */
.home-mod { margin-top: 38px; }
.home-mod:first-child { margin-top: 18px; }
.home-mod-head {
  display: flex; align-items: baseline; gap: 12px;
  border-bottom: 1px solid var(--border); padding-bottom: 8px; margin-bottom: 16px;
}
.home-mod-tag { font-family: var(--mono); font-size: 12px; color: var(--accent); letter-spacing: 0.1em; }
.home-mod-head h2 { font-size: 19px; margin: 0; font-weight: 600; }
.home-mod-count { margin-left: auto; font-family: var(--mono); font-size: 11.5px; color: var(--text-faint); }

/* ============================================================
   Lesomgeving (#/les) — Deel B
   ============================================================ */

.les-item-why { font-size: 13px; color: var(--text-dim); margin-top: 3px; }
.les-item-ref { font-family: var(--mono); font-size: 11px; color: var(--text-faint); margin-left: 8px; }
.les-ext { color: var(--amber) !important; }

/* ---------- Actuele EW-ontwikkelingen (crosscheck.json van ru-mil-tracker) ---------- */
.ewt-block { margin: 34px 0 10px; padding-top: 22px; border-top: 1px solid var(--border); }
.ewt-head h2 { font-size: 18px; margin: 0 0 6px; color: var(--text); }
.ewt-head p { font-size: 12.5px; line-height: 1.6; color: var(--text-faint); margin: 0 0 16px; max-width: 720px; }
.ewt-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.ewt-group { background: var(--bg-raised); border: 1px solid var(--border); border-radius: 9px; overflow: hidden; }
.ewt-group-h {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent); background: var(--accent-bg); padding: 7px 12px;
  border-bottom: 1px solid var(--border-soft);
}
.ewt-count { color: var(--text-faint); font-size: 10.5px; }
.ewt-item { display: block; padding: 7px 12px; border-bottom: 1px solid var(--border-soft); text-decoration: none; }
.ewt-item:last-child { border-bottom: none; }
.ewt-item:hover { background: var(--bg-hover); }
.ewt-title { display: block; color: var(--text); font-size: 12.5px; line-height: 1.45; }
.ewt-item:hover .ewt-title { color: #fff; }
.ewt-meta { display: block; font-family: var(--mono); font-size: 10px; color: var(--text-faint); margin-top: 2px; letter-spacing: 0.03em; }
.ewt-more { display: inline-block; margin-top: 14px; font-size: 12.5px; color: var(--accent); text-decoration: none; }
.ewt-more:hover { text-decoration: underline; }

/* ---------- Print-weergave (Ctrl+P / Opslaan als PDF) ---------- */
@media print {
  .topbar, .sidebar, .sidebar-overlay, #search-results, .nav-toggle,
  .print-fab, .fc-bar, .fc-wrap, .card-audio, audio, video,
  .les-share, .les-topline, .les-modal-back { display: none !important; }
  .content { display: block !important; margin: 0 !important; padding: 0 !important; max-width: none !important; }
  a { color: #111 !important; text-decoration: underline; }
  .note, .warn, .example, .keypt, .simpel { border: 1px solid #999 !important; background: #f5f5f5 !important; color: #111 !important; }
  .note .lbl, .warn .lbl, .example .lbl, .keypt .lbl, .simpel .lbl { color: #111 !important; }
  table.data th { color: #111 !important; border-bottom-color: #999 !important; }
  table.data td { border-bottom-color: #ccc !important; }
  figure.diagram, figure.illustration, table.data, .note, .warn, .example, .keypt, .simpel { break-inside: avoid; }
  figure.diagram svg { max-width: 100% !important; }
}
