/**
 * Reflow und Viewport-Halt (WCAG 2.1 1.4.10).
 * Keine neuen Layout-Systeme — nur Begrenzung, Umbruch, erkennbare Bedienung.
 */

html {
    overflow-x: clip;
}

.hdr-site-content,
.hdr-reader-wrapper,
.hdr-inhaltsverzeichnis,
.hdr-gesamtwerk,
.hdr-archive-main,
.hdr-content-wrapper,
.hdr-artikel-content,
.hdr-artikel-grid {
    max-width: 100%;
    min-width: 0;
}

/* Reader: 1fr hat sonst min-content 900px → 280+900+300 = 1480px Mindestbreite */
.hdr-reader-wrapper {
    width: 100%;
    grid-template-columns: minmax(0, 16rem) minmax(0, 1fr) minmax(0, 18rem);
}

.hdr-reader-wrapper > * {
    min-width: 0;
}

.hdr-reader-wrapper .hdr-reader-content {
    width: 100%;
    max-width: min(56rem, 100%);
    padding-left: clamp(1rem, 4vw, 4rem);
    padding-right: clamp(1rem, 4vw, 4rem);
}

.hdr-reader-wrapper .hdr-article-title {
    font-size: clamp(1.35rem, 4vw, 2.2rem);
    overflow-wrap: anywhere;
}

.hdr-article-meta,
.hdr-article-nav,
.hdr-action-buttons,
.hdr-tags {
    flex-wrap: wrap;
    min-width: 0;
}

.hdr-article-body,
.hdr-article-body * {
    max-width: 100%;
}

.hdr-article-body {
    overflow-wrap: anywhere;
}

.hdr-article-body p {
    text-align: start;
}

.hdr-article-body img,
.hdr-article-body video,
.hdr-article-body iframe {
    height: auto;
}

.hdr-article-body table {
    display: block;
    width: 100%;
    overflow-x: auto;
}

.hdr-reader-wrapper .hdr-nav-btn {
    max-width: 100%;
    min-width: 0;
    flex: 1 1 12rem;
}

.hdr-reader-wrapper .hdr-nav-btn .title {
    white-space: normal;
}

@media (max-width: 1400px) {
    .hdr-reader-wrapper {
        grid-template-columns: 1fr;
    }

    .hdr-reader-nav,
    .hdr-reader-discover {
        width: min(20rem, 88vw);
        max-width: 100%;
    }
}

.hdr-mobile-toggle {
    min-width: 2.75rem;
    min-height: 2.75rem;
}

/* Inhaltsverzeichnisse: Hero nicht per Negativmargin aus dem Viewport schieben */
.hdr-inhaltsverzeichnis .hdr-iv-hero {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    box-sizing: border-box;
    padding: clamp(1.5rem, 4vw, 3rem) clamp(1rem, 3vw, 2rem);
}

.hdr-inhaltsverzeichnis {
    padding-left: clamp(0.75rem, 3vw, 1.5rem);
    padding-right: clamp(0.75rem, 3vw, 1.5rem);
}

.hdr-iv-artikel-item,
.hdr-artikel-item,
.hdr-iv-kapitel-header,
.hdr-kapitel-header,
.hdr-iv-info-content {
    min-width: 0;
}

.hdr-iv-artikel-titel,
.hdr-artikel-titel,
.hdr-iv-kapitel-titel,
.hdr-kapitel-titel,
.hdr-article-card .hdr-article-title {
    min-width: 0;
    overflow-wrap: anywhere;
}

/* Aktion nicht nur per Hover — sonst unsichtbar für Tastatur und Touch */
.hdr-iv-artikel-action {
    opacity: 1;
}

@media (max-width: 768px) {
    .hdr-iv-artikel-item,
    .hdr-artikel-item {
        flex-wrap: wrap;
    }

    .hdr-iv-unterkapitel,
    .hdr-unterkapitel {
        margin-left: 0.5rem;
    }

    .hdr-iv-hero h1,
    .hdr-gesamtwerk-title {
        font-size: clamp(1.4rem, 6vw, 2rem);
    }
}

/* Artikelverzeichnis */
.hdr-content-wrapper {
    width: 100%;
    max-width: min(var(--hdr-container-width, 1200px), 100%);
    padding-left: clamp(0.75rem, 3vw, 1.5rem);
    padding-right: clamp(0.75rem, 3vw, 1.5rem);
}

.hdr-artikel-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 21rem);
}

@media (max-width: 768px) {
    .hdr-artikel-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}
