/* Handbuch – baut auf theme.css auf (Farben, Hell/Dunkel) */

.hb-inhalt { margin-top: 18px; }
.hb-brot { font-size: 12px; color: var(--text-muted); margin-bottom: 10px; }
.hb-brot a { color: var(--text-muted); text-decoration: none; }
.hb-brot a:hover { color: var(--accent); }

/* ---------- Suche */
.hb-suche { position: relative; }
.hb-suche input {
  width: 100%; box-sizing: border-box; font: inherit; font-size: 15px; padding: 12px 14px 12px 40px;
  border-radius: 10px; border: 1px solid var(--border); background: var(--panel); color: var(--text);
}
.hb-suche input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.hb-suche::before { content: "🔍"; position: absolute; left: 13px; top: 50%; transform: translateY(-50%); font-size: 15px; opacity: .7; }
.hb-treffer { margin-top: 10px; display: grid; gap: 8px; }
.hb-treffer a { display: block; text-decoration: none; color: var(--text); background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; }
.hb-treffer a:hover { border-color: var(--accent); }
.hb-treffer .t-kopf { font-weight: 700; font-size: 13px; }
.hb-treffer .t-kopf span { color: var(--text-muted); font-weight: 500; }
.hb-treffer .t-text { font-size: 13px; color: var(--text-muted); margin-top: 3px; line-height: 1.45; }
.hb-treffer mark { background: var(--accent-soft); color: var(--text); border-radius: 3px; padding: 0 2px; }
.hb-treffer .t-leer { color: var(--text-muted); font-size: 13px; padding: 6px 2px; }

/* ---------- Startseite */
.hb-start-kopf { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; max-width: 900px; }
.hb-gruppe { margin-top: 26px; }
.hb-gruppe h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); margin: 0 0 10px; }
.hb-kacheln { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.hb-kachel { display: flex; gap: 12px; align-items: flex-start; text-decoration: none; color: var(--text); background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; }
.hb-kachel:hover { border-color: var(--accent); }
.hb-kachel .k-icon { font-size: 26px; line-height: 1; }
.hb-kachel .k-titel { font-weight: 700; font-size: 14px; }
.hb-kachel .k-kurz { font-size: 12.5px; color: var(--text-muted); margin-top: 3px; line-height: 1.4; }
.hb-start-spalten { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 22px; margin-top: 26px; align-items: start; }
@media (max-width: 960px) { .hb-start-spalten { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Kapitel */
.hb-kapitel { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 28px; align-items: start; }
.hb-seite { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow-y: auto; display: grid; gap: 14px; }
.hb-toc { font-size: 13px; }
.hb-toc .toc-titel { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); font-weight: 700; margin-bottom: 6px; }
.hb-toc a { display: block; color: var(--text-muted); text-decoration: none; padding: 4px 8px; border-left: 2px solid var(--border); line-height: 1.35; }
.hb-toc a.h3 { padding-left: 20px; font-size: 12.5px; }
.hb-toc a:hover, .hb-toc a.aktiv { color: var(--text); border-left-color: var(--accent); }
.hb-seite .hb-suche input { font-size: 13px; padding: 9px 10px 9px 34px; }
.hb-seite .hb-suche::before { left: 11px; font-size: 13px; }
@media (max-width: 960px) {
  .hb-kapitel { grid-template-columns: minmax(0, 1fr); }
  .hb-seite { position: static; max-height: none; }
}

.hb-kapitel-kopf { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.hb-kapitel-kopf .k-icon { font-size: 34px; }
.hb-kapitel-kopf h1 { margin: 0; font-size: 26px; }
.hb-kapitel-kopf .k-kurz { color: var(--text-muted); font-size: 14px; }
.hb-aktionen { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 4px; }
.hb-aktionen .btn { font-size: 12.5px; }
.hb-aktionen .btn.zweit { background: var(--panel); color: var(--text); border: 1px solid var(--border); }
.hb-aktionen .btn.zweit:hover { border-color: var(--accent); }

/* ---------- Fließtext */
.hb-text { max-width: 860px; font-size: 15px; line-height: 1.65; color: var(--text); }
.hb-text h2 { font-size: 21px; margin: 38px 0 10px; padding-top: 14px; border-top: 1px solid var(--border); scroll-margin-top: 14px; }
.hb-text h3 { font-size: 17px; margin: 28px 0 8px; scroll-margin-top: 14px; }
.hb-text h4 { font-size: 15px; margin: 20px 0 6px; }
.hb-text p, .hb-text ul, .hb-text ol { margin: 0 0 12px; }
.hb-text li { margin: 4px 0; }
.hb-text ol > li::marker { font-weight: 700; color: var(--accent); }
.hb-text a { color: var(--accent); }
.hb-text code { background: var(--muted-bg); color: var(--text); border-radius: 4px; padding: 1px 5px; font-size: .9em; }
.hb-text kbd { border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; font-size: .88em; background: var(--panel); }
.hb-text hr { border: 0; border-top: 1px solid var(--border); margin: 24px 0; }
.hb-tabelle { overflow-x: auto; margin: 0 0 14px; }
.hb-text table { border-collapse: collapse; width: 100%; font-size: 14px; }
.hb-text th, .hb-text td { border: 1px solid var(--border); padding: 7px 10px; text-align: left; vertical-align: top; }
.hb-text th { background: var(--panel-alt); }

/* Hinweiskästen: Blockzitat, das mit 💡 ⚠️ ℹ️ 🔑 beginnt */
.hb-text blockquote { margin: 0 0 14px; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--border); border-left-width: 5px; background: var(--panel); }
.hb-text blockquote p:last-child { margin-bottom: 0; }
.hb-text blockquote.tipp { border-left-color: #3ecf6d; background: var(--success-bg); }
.hb-text blockquote.achtung { border-left-color: #e6a23c; background: var(--warn-bg); }
.hb-text blockquote.hinweis { border-left-color: var(--accent); background: var(--accent-soft); }
.hb-text blockquote.rolle { border-left-color: var(--accent-strong); background: var(--panel-alt); font-size: 14px; }

/* Abbildungen */
.hb-text figure { margin: 6px 0 18px; }
.hb-text figure img { display: block; max-width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--border); cursor: zoom-in; box-shadow: 0 2px 10px rgba(0,0,0,.12); }
.hb-text figcaption { font-size: 12.5px; color: var(--text-muted); margin-top: 6px; }
.hb-text figure.schmal img { max-width: 560px; }

/* Legende zu nummerierten Markierungen: Liste mit ①②③ */
.hb-text ol.legende { list-style: none; padding-left: 0; }
.hb-text ol.legende li { display: grid; grid-template-columns: 30px 1fr; gap: 6px; }
.hb-text ol.legende li .nr { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #e0457b; color: #fff; font-size: 12px; font-weight: 800; margin-top: 2px; }

/* Lightbox */
.hb-lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.82); display: grid; place-items: center; z-index: 1000; padding: 24px; cursor: zoom-out; }
.hb-lightbox[hidden] { display: none; }
.hb-lightbox img { max-width: 100%; max-height: calc(100vh - 90px); border-radius: 8px; background: #fff; }
.hb-lightbox-text { color: #eee; font-size: 13px; margin-top: 8px; text-align: center; }

.hb-nachoben { position: fixed; right: 20px; bottom: 20px; width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--border); background: var(--panel); color: var(--text); font-size: 18px; cursor: pointer; box-shadow: 0 2px 10px rgba(0,0,0,.2); z-index: 50; }
.hb-nachoben:hover { border-color: var(--accent); }
.hb-nachoben[hidden] { display: none; }

.hb-fehler { background: var(--danger-bg); color: var(--danger-text); border-radius: 10px; padding: 14px 16px; }

/* ---------- Druck: nur der Inhalt, hell, ohne Navigation */
@media print {
  :root, [data-theme] { --bg: #fff; --panel: #fff; --panel-alt: #f3f3f3; --text: #000; --text-muted: #444; --border: #bbb; --accent: #1f5135; --accent-soft: #eef4ef; --success-bg: #f0f8f1; --warn-bg: #fff6e6; --muted-bg: #f2f2f2; }
  body { background: #fff !important; color: #000; }
  .header .header-actions, .back-link, .hb-seite, .hb-aktionen, .hb-nachoben, .hb-brot, .hb-suche, .hb-treffer { display: none !important; }
  .hb-kapitel { display: block; }
  .hb-text { max-width: none; font-size: 11pt; }
  .hb-text h2, .hb-text h3, .hb-text h4 { break-after: avoid; }
  .hb-text figure, .hb-text blockquote, .hb-text table { break-inside: avoid; }
  .hb-text figure img { box-shadow: none; max-height: 120mm; width: auto; }
  .hb-text a { color: #000; text-decoration: none; }
  .hb-kapitel-druck { break-before: page; }
}
