/* Export-Doku – EIN Styling für beide Ausgaben:
   - Bildschirm: mehrseitige Web-Doku mit Sidebar-TOC + Weiter/Zurück
   - Druck/PDF: einspaltig, jedes Kapitel beginnt auf neuer Seite
   Bewusst schlicht gehalten, angelehnt an die frühere RoboHelp-Optik (Calibri). */

:root {
  --text: #222;
  --muted: #666;
  --accent: #1f5c99;
  --link: #1f5c99;
  --border: #d6dbe0;
  --th-bg: #eef2f6;
  --row-alt: #fafbfc;
  --code-bg: #f4f6f8;
  --sidebar-bg: #f7f9fb;
  --sidebar-w: 270px;
  --content-max: 820px;
  --font: "Calibri", "Carlito", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  --mono: "Consolas", "SFMono-Regular", "Menlo", monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: #fff;
  line-height: 1.5;
  font-size: 12pt;
}

/* ---------- Kopfzeile ---------- */
.doc-header {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 16px;
  padding: 14px 24px;
  border-bottom: 2px solid var(--accent);
}
.doc-header .doc-title { font-size: 16pt; font-weight: bold; color: var(--accent); }
.doc-header .doc-version { font-size: 10pt; color: var(--muted); }

/* ---------- Layout: Sidebar + Inhalt ---------- */
.doc-layout { display: flex; align-items: flex-start; }

.doc-toc {
  flex: 0 0 var(--sidebar-w);
  align-self: stretch;
  min-height: 100vh;
  padding: 18px 14px;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  position: sticky;
  top: 0;
}
.doc-toc ul { list-style: none; margin: 0; padding: 0; }
.doc-toc li { margin: 2px 0; }
.doc-toc a {
  display: block;
  padding: 6px 10px;
  border-radius: 4px;
  color: var(--text);
  text-decoration: none;
  font-size: 11pt;
}
.doc-toc a:hover { background: #e6edf4; }
.doc-toc li.active > a { background: var(--accent); color: #fff; font-weight: bold; }

.doc-content {
  flex: 1 1 auto;
  max-width: var(--content-max);
  padding: 22px 34px 60px;
}

/* ---------- Typografie ---------- */
h1 { font-size: 24pt; font-weight: bold; color: var(--accent); margin: 0 0 .5em; }
h2 { font-size: 16pt; font-weight: bold; margin: 1.4em 0 .4em; }
h3 { font-size: 13pt; font-weight: bold; margin: 1.2em 0 .3em; }
h4 { font-size: 11.5pt; font-weight: bold; margin: 1em 0 .3em; }
p  { margin: 0 0 .7em; }
a  { color: var(--link); }
ul, ol { margin: 0 0 .7em; padding-left: 1.4em; }
li { margin: .15em 0; }
hr { border: none; border-top: 1px solid var(--border); margin: 1.4em 0; }

/* ---------- Tabellen ---------- */
table { border-collapse: collapse; width: 100%; margin: .3em 0 1em; font-size: 11pt; }
th, td { border: 1px solid var(--border); padding: 6px 9px; text-align: left; vertical-align: top; }
th { background: var(--th-bg); font-weight: bold; }
tbody tr:nth-child(even) td { background: var(--row-alt); }

/* ---------- Code ---------- */
code { font-family: var(--mono); font-size: 10.5pt; background: var(--code-bg); padding: 1px 5px; border-radius: 3px; }
pre  { background: var(--code-bg); border: 1px solid var(--border); border-radius: 5px; padding: 12px 14px; overflow: auto; }
pre code { background: none; padding: 0; font-size: 10.5pt; }

/* ---------- Weiter / Zurück ---------- */
.doc-pager {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 40px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.doc-pager a { color: var(--link); text-decoration: none; font-size: 11pt; }
.doc-pager .prev::before { content: "\2190\00a0"; }   /* ← */
.doc-pager .next::after  { content: "\00a0\2192"; }    /* → */

/* ---------- Responsiv ---------- */
@media (max-width: 768px) {
  .doc-layout { flex-direction: column; }
  .doc-toc {
    position: static;
    min-height: 0;
    flex-basis: auto;
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .doc-content { max-width: none; padding: 18px 18px 40px; }
}

/* ================= PDF / Druck ================= */
/* Chrome rendert das kombinierte PDF im print-Modus – hier greifen diese Regeln. */
@media print {
  /* Im PDF bewusst größer als am Bildschirm – bessere Lesbarkeit auf Papier. */
  body { font-size: 14.5pt; }
  table { font-size: 14pt; }
  code, pre code { font-size: 13.5pt; }
  .doc-header, .doc-toc, .doc-pager { display: none !important; }
  .doc-content { max-width: none; padding: 0; }
  a { color: var(--text); text-decoration: none; }
  thead { display: table-header-group; }     /* Tabellenkopf pro Seite wiederholen */
  tr, img { break-inside: avoid; }
  h1, h2, h3, h4 { break-after: avoid; }      /* Überschrift nicht allein am Seitenende */
}

/* Kombiniertes PDF-Dokument (build.mjs setzt <body class="pdf">) */
.pdf .pdf-cover {
  padding-top: 110mm;
  text-align: center;
}
.pdf .cover-title   { font-size: 30pt; color: var(--accent); margin: 0 0 10px; }
.pdf .cover-sub     { font-size: 14pt; color: var(--muted); margin: 0 0 26px; }
.pdf .cover-version { font-size: 11pt; color: var(--muted); }
.pdf .pdf-topic { break-before: page; }
