/* Produktdokumentation (/doku · /en/docs): Seitenleiste, Suche, Artikel, Bildschirmfotos, Lightbox, „Auf dieser Seite“.
   Nur auf Doku-Seiten eingebunden (src/layout.mjs › meta.doku). Keine Inline-Styles (CSP). */

.doc-wrap { padding: 28px 0 72px; }
.doc-wrap > .wrap { max-width: 1440px; }
.doc-grid { display: grid; grid-template-columns: 248px minmax(0, 1fr) 212px; gap: 44px; align-items: start; }

/* ---------- Seitenleiste ---------- */
.doc-side { position: sticky; top: 14px; z-index: 5; padding: 2px 0 0 2px; font-size: 0.92rem; }
.doc-nav { max-height: calc(100vh - 86px); overflow: auto; padding: 0 6px 24px 0; scrollbar-width: thin; }
.doc-nav .doc-side-h { font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 700; color: var(--muted); margin: 20px 0 6px 10px; }
.doc-nav ul { list-style: none; margin: 0; padding: 0; }
.doc-nav a { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 5px 10px; border-radius: 8px; color: var(--ink); text-decoration: none; border-left: 2px solid transparent; line-height: 1.35; }
.doc-nav a:hover { background: var(--surface); }
.doc-nav a[aria-current="page"] { background: var(--surface); border-left-color: var(--brand); font-weight: 650; box-shadow: 0 1px 2px rgba(20, 19, 29, 0.06); }
.doc-side-ed { flex: none; font-size: 0.64rem; font-weight: 700; line-height: 1; border: 1px solid currentColor; border-radius: 4px; padding: 2px 4px; opacity: 0.85; }
.doc-nav-toggle { display: none; }

/* ---------- Suche ---------- */
.doc-search { position: relative; margin: 0 0 6px; }
.doc-search input { width: 100%; padding: 9px 34px 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; font-size: 0.92rem; }
.doc-search input:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
.doc-search-k { position: absolute; right: 9px; top: 8px; font: 600 0.72rem/1 var(--mono); color: var(--muted); border: 1px solid var(--line); border-radius: 5px; padding: 3px 6px; background: var(--bg); }
.doc-hits { position: absolute; left: 0; top: calc(100% + 6px); z-index: 40; width: min(560px, 86vw); max-height: 70vh; overflow: auto; margin: 0; padding: 6px; list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.doc-hits a { display: block; padding: 8px 10px; border-radius: 8px; color: var(--ink); text-decoration: none; }
.doc-hits a b { display: block; font-size: 0.92rem; }
.doc-hits a i { font-style: normal; color: var(--brand); }
.doc-hits a span { display: block; font-size: 0.8rem; color: var(--muted); margin-top: 2px; }
.doc-hits li[aria-selected="true"] a, .doc-hits a:hover { background: var(--bg); }
.doc-hits mark { background: var(--marker-soft); color: inherit; padding: 0; }
.doc-hits .doc-hits-leer { padding: 10px; color: var(--muted); font-size: 0.88rem; }

/* ---------- Artikel ---------- */
.doc-main { min-width: 0; max-width: 900px; }
.doc-crumbs { font-size: 0.82rem; color: var(--muted); margin: 4px 0 10px; }
.doc-crumbs a { color: inherit; }
.doc-main h1 { font-size: clamp(2rem, 3.3vw, 2.8rem); line-height: 1.08; margin: 0 0 14px; letter-spacing: -0.01em; }
.doc-lead { font-size: 1.16rem; line-height: 1.55; margin: 0 0 18px; max-width: 62ch; }
.doc-facts { display: flex; flex-wrap: wrap; gap: 8px 26px; margin: 18px 0; padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); font-size: 0.9rem; }
.doc-facts div { display: flex; gap: 8px; align-items: baseline; }
.doc-facts dt { color: var(--muted); font-weight: 600; }
.doc-facts dd { margin: 0; }
.doc-fragen { margin: 18px 0 8px; padding: 12px 18px; border-left: 3px solid var(--marker-line); background: var(--surface); border-radius: 0 10px 10px 0; font-size: 0.93rem; }
.doc-fragen-h { margin: 0 0 4px; font-weight: 700; font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.doc-fragen ul { margin: 0; padding-left: 18px; }
.doc-fragen li { margin: 2px 0; }

.doc-body { font-size: 1.02rem; }
.doc-body h2, .doc-siehe h2 { font-size: 1.6rem; line-height: 1.2; margin: 46px 0 12px; scroll-margin-top: 18px; }
.doc-body h3 { font-size: 1.18rem; line-height: 1.3; margin: 30px 0 8px; scroll-margin-top: 18px; }
.doc-body h4 { font-size: 1rem; margin: 22px 0 6px; }
.doc-body p, .doc-body li { line-height: 1.65; }
.doc-body ul, .doc-body ol { padding-left: 22px; }
.doc-body code { font-family: var(--mono); font-size: 0.86em; background: var(--surface); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; overflow-wrap: anywhere; }
.doc-body pre { background: var(--code-bg); color: var(--code-ink); border-radius: 10px; padding: 14px 16px; overflow: auto; font-size: 0.86rem; line-height: 1.55; }
.doc-body pre code { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; }
.doc-body kbd, .doc-main kbd { font-family: var(--mono); font-size: 0.82em; font-weight: 600; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px; background: var(--surface); white-space: nowrap; }
.doc-body b.ui, .doc-body .ui { font-weight: 650; }
.doc-body a { overflow-wrap: anywhere; }

/* Tabellen (Knöpfe und Einstellungen) – breite Tabellen scrollen, nie die Seite */
.doc-table { overflow-x: auto; margin: 16px 0 22px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.doc-body table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.doc-body th, .doc-body td { text-align: left; vertical-align: top; padding: 9px 12px; border-bottom: 1px solid var(--line); line-height: 1.5; }
.doc-body tr:last-child td { border-bottom: 0; }
.doc-body th { font-size: 0.76rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); background: var(--bg); }
.doc-body td:first-child { font-weight: 600; min-width: 150px; }

/* Schrittfolgen und Ziffern im Bild */
ol.steps { counter-reset: s; list-style: none; padding: 0; margin: 14px 0 20px; }
ol.steps > li { counter-increment: s; position: relative; padding-left: 44px; margin: 0 0 12px; min-height: 30px; }
ol.steps > li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: var(--bg); display: grid; place-items: center; font-weight: 700; font-size: 0.88rem; }
ol.callouts { counter-reset: c; list-style: none; padding: 0; margin: -6px 0 24px; font-size: 0.95rem; }
ol.callouts > li { counter-increment: c; position: relative; padding-left: 34px; margin: 0 0 7px; }
ol.callouts > li::before { content: counter(c); position: absolute; left: 0; top: 1px; width: 23px; height: 23px; border-radius: 50%; background: #e5007d; color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 0.78rem; box-shadow: 0 0 0 2px #fff; }

/* Hinweise */
.doc-note { margin: 18px 0; padding: 12px 16px; border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: 10px; background: var(--surface); font-size: 0.96rem; }
.doc-note > :first-child { margin-top: 0; }
.doc-note > :last-child { margin-bottom: 0; }
.doc-note.doc-prod { border-left-color: var(--danger); }
.doc-note.doc-warn { border-left-color: var(--marker-line); }
.doc-note-k { display: block; font-size: 0.74rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }

/* Bildschirmfotos */
.doc-shot { margin: 22px 0 26px; }
.doc-shot-a { display: block; cursor: zoom-in; border-radius: 10px; }
.doc-shot img { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); background: #fff; }
.doc-shot figcaption { font-size: 0.88rem; color: var(--muted); margin-top: 9px; line-height: 1.5; }
.doc-shot-leer { aspect-ratio: 16 / 10; display: grid; place-items: center; border: 2px dashed var(--danger); border-radius: 10px; color: var(--danger); font-weight: 600; }
.doc-shot-schmal img { max-width: 560px; }

/* Editionen */
.ed-badge { display: inline-block; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.03em; line-height: 1.2; padding: 3px 9px; border-radius: 999px; border: 1px solid currentColor; white-space: nowrap; vertical-align: 0.12em; }
.ed-community { color: #0f7a57; }
.ed-pro { color: #0064d9; }
.ed-team { color: #6b3fe0; }
.ed-enterprise { color: #a2470a; }
[data-mode="dark"] .ed-community { color: #4fd1a5; }
[data-mode="dark"] .ed-pro { color: #6aaeff; }
[data-mode="dark"] .ed-team { color: #b49cff; }
[data-mode="dark"] .ed-enterprise { color: #ffad6b; }

/* Siehe auch, Weiter/Zurück */
.doc-siehe ul { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.doc-siehe li { padding: 10px 16px; border-bottom: 1px solid var(--line); line-height: 1.5; }
.doc-siehe li:last-child { border-bottom: 0; }
.doc-siehe-k { display: inline-block; min-width: 10.5em; font-size: 0.76rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.doc-pn { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 48px; }
.doc-pn a { display: block; padding: 14px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); text-decoration: none; color: var(--ink); }
.doc-pn a:hover { border-color: var(--brand); }
.doc-pn span { display: block; font-size: 0.78rem; color: var(--muted); }
.doc-pn b { display: block; margin-top: 2px; }
.doc-pn-prev span::before { content: "← "; }
.doc-pn-next { text-align: right; grid-column: 2; }
.doc-pn-next span::after { content: " →"; }

/* Auf dieser Seite */
.doc-toc { position: sticky; top: 14px; max-height: calc(100vh - 28px); overflow: auto; font-size: 0.86rem; padding-top: 6px; }
.doc-toc-h { margin: 0 0 8px; font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 700; color: var(--muted); }
.doc-toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.doc-toc a { display: block; padding: 4px 12px; margin-left: -1px; color: var(--muted); text-decoration: none; border-left: 2px solid transparent; line-height: 1.35; }
.doc-toc a:hover { color: var(--ink); }
.doc-toc a.on { color: var(--ink); border-left-color: var(--brand); font-weight: 600; }

/* Startseite der Doku: alle Seiten als Karten */
.doc-cards { list-style: none; padding: 0; margin: 12px 0 8px; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 12px; }
.doc-card { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; height: 100%; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); text-decoration: none; color: var(--ink); }
.doc-card:hover { border-color: var(--brand); }
.doc-card span:last-child { color: var(--muted); font-size: 0.9rem; line-height: 1.45; }

/* Lightbox (assets/js/doku.js) */
.lb { padding: 0; border: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; margin: 0; }
.lb::backdrop { background: rgba(9, 9, 16, 0.86); }
.lb-in { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; width: 100%; height: 100%; padding: 28px 64px; box-sizing: border-box; }
.lb img { display: block; max-width: 100%; max-height: calc(100vh - 120px); width: auto; height: auto; border-radius: 8px; background: #fff; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5); }
.lb-cap { color: #f1f0f7; font-size: 0.92rem; max-width: 900px; text-align: center; line-height: 1.5; margin: 0; }
.lb button { position: absolute; border: 0; background: rgba(255, 255, 255, 0.12); color: #fff; width: 44px; height: 44px; border-radius: 50%; font-size: 1.4rem; line-height: 1; cursor: pointer; }
.lb button:hover, .lb button:focus-visible { background: rgba(255, 255, 255, 0.24); }
.lb-close { top: 16px; right: 16px; }
.lb-prev { left: 12px; top: 50%; }
.lb-next { right: 12px; top: 50%; }

/* ---------- Schmalere Fenster ---------- */
@media (max-width: 1200px) {
  .doc-grid { grid-template-columns: 236px minmax(0, 1fr); gap: 36px; }
  .doc-toc { display: none; }
}
@media (max-width: 860px) {
  .doc-wrap { padding-top: 16px; }
  .doc-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .doc-side { position: static; padding: 0; }
  .doc-nav { max-height: none; overflow: visible; }
  .doc-nav-toggle { display: flex; justify-content: space-between; align-items: center; width: 100%; margin-top: 8px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; }
  .doc-nav-toggle::after { content: "▾"; }
  .doc-nav-toggle[aria-expanded="true"]::after { content: "▴"; }
  .doc-nav { display: none; padding: 4px 0 8px; }
  .doc-nav.open { display: block; }
  .doc-hits { width: 100%; }
  .doc-pn { grid-template-columns: 1fr; }
  .doc-pn-next { grid-column: 1; }
  .doc-siehe-k { display: block; min-width: 0; }
  .lb-in { padding: 56px 10px 20px; }
  .lb-prev, .lb-next { top: auto; bottom: 14px; }
}
