/* Handbuch (handbuch.html, erzeugt von scripts/build-handbuch.cjs) — Aufbau wie die Bedienungsanleitung
   von Marcus'Mind, Gestaltung mit den Tokens aus theme.css. */

/* Hero: Aufbau und Abstände kommen aus den Klassen der Startseite (partials/03-hero.html).
   Der unsichtbare Hero-Text der Startseite (.hb-hero-mass) liegt in derselben Rasterzelle wie der
   Handbuch-Text und gibt die Höhe vor – so ist die Bildzone in jeder Sprache und Breite gleich hoch. */
.hb-hero { display: grid; }
.hb-hero > .hb-hero-mass, .hb-hero > .hb-hero-inhalt { grid-area: 1 / 1; min-width: 0; }
.hb-hero-mass { visibility: hidden; pointer-events: none; user-select: none; }
.hb-actions { flex-wrap: wrap; }
.hb-stand { margin-top: 1.5rem; font-size: 0.75rem; line-height: 1.5; color: var(--text-muted); }

.hb-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 4rem; align-items: start; padding-block: 3.5rem 5rem; }
.hb-toc { position: sticky; top: 6rem; max-height: calc(100vh - 7rem); overflow-y: auto; }
.hb-toc ol { list-style: none; padding: 0; margin: 0; }
.hb-toc a { display: grid; grid-template-columns: 1.6rem 1fr; gap: 0.5rem; padding: 0.4rem 0; font-size: 0.85rem; line-height: 1.45; color: var(--text-primary); text-decoration: none; }
.hb-toc a:hover { color: var(--interactive); }
.hb-toc a span { color: var(--text-muted); font-variant-numeric: tabular-nums; }

.hb-chapter { padding-bottom: 3rem; margin-bottom: 3rem; border-bottom: 1px solid var(--border-subtle); scroll-margin-top: 5.5rem; }
.hb-chapter:last-child { border-bottom: 0; margin-bottom: 0; }
.hb-kicker { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--secondary-container); margin: 0 0 0.5rem; }
.hb-chapter h2 { font-size: clamp(1.8rem, 3.4vw, 2.3rem); font-weight: 800; margin: 0 0 1.25rem; }
.hb-chapter h3 { font-size: 1.3rem; font-weight: 700; margin: 2.25rem 0 0.75rem; scroll-margin-top: 5.5rem; }
.hb-chapter h4 { font-size: 1.05rem; font-weight: 700; margin: 1.5rem 0 0.5rem; }
.hb-chapter p, .hb-chapter li { font-size: 0.98rem; line-height: 1.75; color: var(--text-secondary); }
.hb-chapter p { margin: 0 0 1rem; }
.hb-chapter strong { color: var(--text-primary); }
.hb-chapter a { color: var(--interactive); }
.hb-chapter code { font-size: 0.9em; background: var(--accent-surface); padding: 0.1em 0.35em; border-radius: 4px; }

.hb-sub { display: grid; grid-template-columns: minmax(0, 1fr) 180px; gap: 2rem; align-items: start; }
.hb-sub figure { margin: 0.25rem 0 0; }
.hb-sub img { width: 100%; height: auto; display: block; border-radius: var(--radius-md); border: 1px solid var(--border-medium); background: var(--primary); }
.hb-zoom { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; border-radius: var(--radius-md); }
.hb-zoom:focus-visible { outline: 2px solid var(--interactive); outline-offset: 2px; }
.hb-lb-close { position: absolute; top: 1rem; right: 1rem; width: 2.75rem; height: 2.75rem; display: flex; align-items: center; justify-content: center; border-radius: 50%; border: 1px solid var(--interactive); background: var(--interactive-surface); color: var(--interactive); cursor: pointer; }
.hb-lb-close svg { width: 1.4rem; height: 1.4rem; }
@media (max-width: 768px) {
  .lightbox-overlay { gap: 0; }
  .lightbox-overlay .lb-arrow { display: none; }
  .lightbox-overlay img { max-width: 100vw; max-height: 100dvh; border-radius: 0; }
}
.hb-sub figcaption { margin-top: 0.5rem; font-size: 0.75rem; line-height: 1.45; color: var(--text-muted); }

/* Tailwind-Preflight setzt list-style: none – hier ausdrücklich wieder einschalten */
.hb-chapter ul { list-style: disc; }
.hb-chapter ol { list-style: decimal; }
.hb-chapter ul ul { list-style: circle; }
.hb-list { margin: 0.25rem 0 1.25rem; padding-left: 1.3rem; }
.hb-list ul, .hb-list ol { margin: 0.25rem 0 0.25rem; padding-left: 1.2rem; }
.hb-list li { margin-bottom: 0.3rem; }
.hb-list li::marker { color: var(--teal); }

.hb-table-wrap { overflow-x: auto; margin: 0.75rem 0 1.5rem; }
.hb-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; line-height: 1.6; }
.hb-table th, .hb-table td { text-align: left; vertical-align: top; padding: 0.6rem 0.9rem 0.6rem 0; border-bottom: 1px solid var(--border-subtle); color: var(--text-secondary); }
.hb-table thead th { font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); }
.hb-table td:first-child { color: var(--text-primary); }

.hb-note { margin: 1rem 0 1.5rem; padding: 1rem 1.25rem; background: var(--teal-surface); border-left: 3px solid var(--teal); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.hb-note.hb-warn { background: var(--error-surface); border-left-color: var(--error); }
.hb-note p { margin: 0 !important; font-size: 0.92rem; }
.hb-fineprint { margin-top: 2rem !important; font-size: 0.8rem !important; color: var(--text-muted) !important; }

@media (max-width: 960px) {
  .hb-layout { grid-template-columns: 1fr; gap: 2.5rem; }
  .hb-toc { position: static; max-height: none; border-bottom: 1px solid var(--border-subtle); padding-bottom: 2rem; }
  .hb-toc ol { columns: 2; column-gap: 2rem; }
  .hb-toc li { break-inside: avoid; }
}
@media (max-width: 600px) {
  .hb-toc ol { columns: 1; }
  .hb-sub { grid-template-columns: 1fr; gap: 1rem; }
  .hb-sub figure { order: -1; width: 160px; margin: 0 auto 0.5rem; }
  .hb-table th, .hb-table td { padding-right: 0.6rem; font-size: 0.86rem; }
}
.hb-schluss { display: none; }
@media print {
  @page { size: A4; margin: 16mm 16mm 18mm; }
  /* Schlussseite wie in der Produktvorstellung; padding statt margin, weil Chromium Außenabstände am Seitenanfang verwirft */
  .hb-schluss { display: block; break-before: page; break-inside: avoid; padding-top: 95mm; color: #16161C; }
  .hb-merksatz { font-size: 15pt; font-weight: 700; line-height: 1.32; letter-spacing: -.01em; margin: 0; }
  .hb-schwestern { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7mm; border-top: .5pt solid #E2E1E8; padding-top: 6mm; margin-top: 16mm; }
  .hb-schwestern > div { display: flex; flex-direction: column; }
  .hb-marke { height: 11mm; margin-bottom: 3.5mm; }
  .hb-marke img { height: 9mm; width: auto; max-width: 100%; }
  .hb-schwestern p { font-size: 8.8pt; line-height: 1.4; color: #4A4A55; margin: 0 0 3mm; }
  .hb-links { margin-top: auto; }
  .hb-schwestern a, .hb-kanal a { display: block; font-size: 7.5pt; color: #16161C; text-decoration: none; margin-bottom: 1mm; }
  .hb-schwestern a span, .hb-kanal a span { color: oklch(0.53 0.261 269); font-weight: 700; letter-spacing: .06em; }
  .hb-kanal { display: grid; grid-template-columns: 22mm 1fr; gap: 6mm; align-items: center; background: #F4F3F8; border-radius: 2.5mm; padding: 5mm 6mm; margin-top: 7mm; }
  .hb-kanal img { width: 22mm; border-radius: 50%; }
  .hb-kanal-titel { font-weight: 700; font-size: 11pt; margin: 0 0 1.5mm; }
  .hb-kanal p { font-size: 9.2pt; line-height: 1.4; color: #4A4A55; margin: 0 0 2mm; }
  .hb-kanal a { font-size: 8.6pt; }
  .hb-schluss-fuss { display: flex; justify-content: space-between; border-top: .5pt solid #E2E1E8; padding-top: 3.5mm; margin-top: 6mm; font-size: 8.6pt; color: #7C7C88; letter-spacing: .06em; }
  body { background: #fff; }
  nav.sticky, .hb-toc, .hb-actions, footer, .hero-bg-img, .hb-hero-mass, #hb-lightbox { display: none !important; }
  .hb-layout { display: block; padding: 0; }
  .hb-chapter { break-before: page; border: 0; margin: 0; padding: 0; }
  /* Setzt scripts/handbuch-pdf.cjs, wenn die Seite davor sonst mehr als halb leer bliebe */
  .hb-chapter.hb-fliesst { break-before: auto; margin-top: 12mm; }
  .hb-kicker { break-after: avoid; }
  /* Setzt handbuch-pdf.cjs, wenn die Überschrift sonst allein unten stünde (Raster mit Bild ist unteilbar) */
  .hb-chapter h3.hb-umbruch { break-before: page; }
  /* Notlösung (Nutzer 13.10.2026): Bild unten abschneiden, mindestens die Hälfte bleibt sichtbar (80 mm → 41 mm) */
  .hb-sub figure.hb-kurz img { height: 41mm; object-fit: cover; object-position: top;
    -webkit-mask-image: linear-gradient(to bottom, #000 80%, transparent); mask-image: linear-gradient(to bottom, #000 80%, transparent); }
  .hb-fineprint { margin-top: 3mm !important; }
  .hb-chapter h2 { font-size: 22pt; }
  .hb-chapter p, .hb-chapter li, .hb-table { font-size: 9.5pt; }
  .hb-sub { grid-template-columns: minmax(0, 1fr) 36mm; gap: 6mm; }
  .hb-sub figure, .hb-note, .hb-table tr { break-inside: avoid; }
  h3, h4 { break-after: avoid; }
}
