/* Handbuch: schlicht, zum Nachschlagen. Inhalt links fest, am Handy oben zum Aufklappen (Carsten, 6.11.2026) */

.hb { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 28px; align-items: start; }

/* Inhaltsverzeichnis */
.hb-inhalt {
	position: sticky; top: 84px; max-height: calc(100vh - 104px); overflow-y: auto; overscroll-behavior: contain;
	padding: 18px 16px; border-radius: 22px; background: var(--weiss); box-shadow: var(--schatten-gross);
	font-size: .9375rem; line-height: 1.35;
}
.hb-liste a { display: flex; align-items: center; min-height: 44px; padding: 6px 10px; border-radius: 10px; color: var(--text); text-decoration: none; font-weight: 650; }
.hb-liste a:hover { background: var(--auswahl); }
.hb-liste a[aria-current] { background: var(--kachel); color: var(--blau); }
.hb-liste > li + li { margin-top: 4px; }
.hb-liste ol { margin: 2px 0 6px 10px; }
.hb-liste ol a { font-weight: 500; color: var(--neben); padding-block: 4px; }
.hb-liste ol a[aria-current] { color: var(--blau); font-weight: 650; }
/* Am Rechner mit Maus: alle Unterpunkte sichtbar, dafür etwas dichter (Usability-Tester, 6.11.2026: sonst findet man „Widerruf“ nicht) */
@media (min-width: 900px) and (pointer: fine) { .hb-liste ol a { min-height: 32px; padding-block: 3px; } }
.hb-inhalt__knopf { display: none; }

/* Inhalt */
.hb-text { max-width: none; }
.hb-kapitel + .hb-kapitel { margin-top: 56px; padding-top: 40px; border-top: 2px solid var(--linie); }
.hb-kapitel > h2 { margin-top: 0; }
.hb-kapitel > p { margin-top: .7em; max-width: 44em; }
.hb-teil { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px 32px; align-items: start; margin-top: 32px; padding-top: 28px; border-top: 1px solid var(--linie); }
.hb-kapitel > .hb-teil:first-of-type { border-top: 0; padding-top: 0; }
#einleitung .hb-teil { margin-top: 16px; }
.hb-teil h3 { margin-top: 0; font-size: clamp(1.15rem, 1.05rem + .4vw, 1.3rem); }
.hb-teil p, .hb-teil ul, .hb-teil ol { max-width: 40em; }
.hb-teil li::marker { color: var(--blau); font-weight: 700; }
.hb-klein { font-size: .9375rem; color: var(--neben); }
.hb-ende { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--linie); }

/* Bildschirmfotos, Tippen zeigt sie groß */
.hb-bilder { display: flex; flex-wrap: wrap; gap: 12px; }
/* KI-Personen: „KI-generiert“ unter jeder Bildgruppe und in der Großansicht (Carsten, 11.11.2026), Stil aus seite.css */
.hb-bilder .ki-marke { flex-basis: 100%; margin-top: -2px; }
.hb-vergleich .ki-marke { grid-column: 1 / -1; margin-top: 2px; }
.hb-bild { display: block; width: 170px; border-radius: 18px; overflow: hidden; box-shadow: 0 0 0 1px var(--linie), var(--schatten); cursor: zoom-in; }
.hb-bild img { width: 100%; }
.hb-vergleich { display: grid; grid-template-columns: repeat(3, minmax(0, 140px)); gap: 10px; margin-top: 12px; }
.hb-vergleich a { display: block; color: var(--neben); text-decoration: none; cursor: zoom-in; }
.hb-vergleich img { width: 100%; border-radius: 14px; box-shadow: 0 0 0 1px var(--linie); }
.hb-vergleich span { display: block; margin-top: 4px; font-size: .875rem; font-weight: 650; }

.hb-tabelle { width: 100%; max-width: 40em; margin-top: 1em; border-collapse: collapse; font-size: .9375rem; line-height: 1.4; }
.hb-tabelle caption { text-align: left; font-weight: 700; padding-bottom: 6px; }
.hb-tabelle th, .hb-tabelle td { text-align: left; vertical-align: top; padding: 8px 10px; border-bottom: 1px solid var(--linie); }
.hb-tabelle th { color: var(--neben); font-weight: 650; }
.hb-tabelle td:first-child { font-weight: 650; }

.hb-gross { max-width: none; max-height: none; width: 100%; height: 100%; margin: 0; padding: 16px; border: 0; background: rgba(15, 44, 71, .92); }
.hb-gross[open] { display: flex; align-items: center; justify-content: center; }
.hb-gross img { max-width: 100%; max-height: 100%; width: auto; border-radius: 22px; }
.hb-gross__ki { position: absolute; top: max(12px, env(safe-area-inset-top)); left: 16px; margin: 0; line-height: 48px; color: var(--kopf-neben); font-size: .9375rem; font-weight: 650; }
.hb-gross__ki[hidden] { display: none; }
.hb-gross__zu { position: absolute; top: max(12px, env(safe-area-inset-top)); right: 12px; width: 48px; height: 48px; border: 0; border-radius: 50%; background: var(--weiss); color: var(--blau); font: 700 1.75rem/1 inherit; cursor: pointer; }

@media (max-width: 1100px) {
	.hb-teil { grid-template-columns: minmax(0, 1fr); }
	.hb-bild { width: 150px; }
}

@media (max-width: 899.98px) {
	.hb { grid-template-columns: minmax(0, 1fr); gap: 16px; }
	.hb-inhalt { top: 72px; z-index: 5; max-height: none; overflow: visible; padding: 4px; }
	.js .hb-inhalt__knopf {
		display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 48px; padding: 0 14px;
		border: 0; border-radius: 16px; background: none; color: var(--blau); font: inherit; font-weight: 750; cursor: pointer;
	}
	.js .hb-inhalt__knopf::after { content: "▾"; margin-left: 8px; font-size: 1.1rem; transition: transform .2s; }
	.js .hb-inhalt.offen .hb-inhalt__knopf::after { transform: rotate(180deg); }
	.js .hb-inhalt:not(.offen) .hb-liste { display: none; }
	.hb-liste { padding: 4px 8px 10px; }
	/* Die offene Liste liegt über dem Text, damit beim Zuklappen nichts verrutscht */
	.js .hb-liste { position: absolute; left: 0; right: 0; top: calc(100% + 6px); max-height: calc(100vh - 150px); overflow-y: auto; overscroll-behavior: contain; border-radius: 18px; background: var(--weiss); box-shadow: var(--schatten-gross); }
	.hb-inhalt__wo { flex: 1; min-width: 0; margin-left: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--neben); font-weight: 600; text-align: left; }
	.hb-inhalt__wo:not(:empty)::before { content: "· "; }
	.hb-bild { width: calc(50% - 6px); max-width: 190px; }
}

/* Sprungziele nicht unter Kopf und Inhaltsleiste verstecken */
html { scroll-padding-top: 100px; }
@media (max-width: 899.98px) { html { scroll-padding-top: 140px; } }
