.header-content,
.site-header .header-inner,
.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    min-height: var(--nav-height);
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 8px rgba(15, 61, 79, 0.06);
}

.header-content .logo,
.logo-link {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    min-height: 44px;
    color: var(--primary);
    font-size: 1.3rem;
    font-weight: 600;
    letter-spacing: 0;
    text-decoration: none;
}

.header-content .logo::before,
.logo-link::before {
    content: "";
    display: inline-block;
    width: 36px;
    height: 36px;
    border-radius: var(--radius);
    background: var(--primary) url("../icons/rundpfung-logo.svg") center / 30px 30px no-repeat;
    flex: 0 0 auto;
}

.site-nav,
.footer-nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.nav-link,
.footer-link,
.nav-link--highlight {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0.55rem 0.85rem;
    border-radius: var(--radius-small);
    color: var(--text-muted);
    font-size: 0.92rem;
    font-weight: 700;
    text-decoration: none;
}

.nav-link:hover,
.nav-link:focus,
.footer-link:hover,
.footer-link:focus {
    background: var(--surface-muted);
    color: var(--text);
    text-decoration: none;
}

.nav-link--active,
.nav a[aria-current="page"],
.site-nav a[aria-current="page"] {
    color: var(--primary-dark);
    background: #fff8e6;
    box-shadow: inset 0 0 0 2px var(--accent);
    text-decoration: none;
}

.nav-link--active:hover,
.nav-link--active:focus,
.nav a[aria-current="page"]:hover,
.nav a[aria-current="page"]:focus,
.site-nav a[aria-current="page"]:hover,
.site-nav a[aria-current="page"]:focus {
    color: var(--primary-dark);
    background: #fff3cc;
}

.nav-link--highlight {
    color: #000000;
    background: var(--accent);
    border-radius: var(--radius-pill);
}

.nav-link--highlight:hover,
.nav-link--highlight:focus {
    color: #000000;
    background: var(--accent-dark);
}

.page-hero,
.legal-hero,
.a11y-hero,
.werbung-hero {
    padding: 4.5rem 0 5.25rem;
    color: #ffffff;
    background:
        linear-gradient(135deg, rgba(21, 82, 108, 0.96), rgba(15, 61, 79, 0.96)),
        var(--primary-dark);
}

.page-hero h1,
.legal-hero h1,
.a11y-hero h1,
.werbung-hero-title {
    max-width: 12ch;
    margin: 0 0 1rem;
    color: #ffffff;
    font-size: clamp(2.15rem, 6vw, 4rem);
    line-height: 1.05;
    overflow-wrap: anywhere;
}

.page-hero p,
.legal-hero p,
.a11y-hero p,
.werbung-hero-lead {
    max-width: 70ch;
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.12rem;
}

.site-main,
.legal-content,
.a11y-content {
    padding: 3rem 0;
}

.legal-body,
.a11y-body,
.content-body {
    max-width: 78ch;
}

.legal-body h2,
.a11y-body h2,
.content-body h2,
.section-heading {
    margin: 2rem 0 0.85rem;
    padding-bottom: 0.5rem;
    color: var(--primary-dark);
    font-size: 1.35rem;
    line-height: 1.25;
    border-bottom: 2px solid var(--accent);
}

.legal-body h3,
.a11y-body h3,
.content-body h3 {
    margin: 1.4rem 0 0.55rem;
    color: var(--text);
    font-size: 1.05rem;
}

.legal-body p,
.a11y-body p,
.content-body p,
.legal-body li,
.a11y-body li,
.content-body li {
    color: var(--text);
    line-height: 1.75;
}

.legal-body ul,
.legal-body ol,
.a11y-body ul,
.a11y-body ol,
.content-body ul,
.content-body ol {
    margin: 0 0 1.1rem 1.35rem;
}

.legal-body address,
.a11y-body address,
.notice,
.a11y-note,
.rechtsgrundlage,
.toc,
.plaetze-item,
.ablauf-item {
    margin: 1rem 0 1.4rem;
    padding: 1rem 1.15rem;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    border-radius: var(--radius);
}

.legal-body address,
.a11y-body address {
    font-style: normal;
}

.notice {
    color: #3f2d06;
    background: #fff8e6;
    border-color: var(--accent-dark);
}

.rechtsgrundlage {
    display: inline-block;
    font-size: 0.9rem;
}

.toc {
    background: var(--surface-muted);
}

.toc h2 {
    margin-top: 0;
}

.toc a,
.legal-body a,
.a11y-body a,
.content-body a,
.werbung-kontakt a {
    color: var(--primary-dark);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 0.16em;
}

.table-scroll {
    margin: 1.5rem 0;
    overflow-x: auto;
    border: 1px solid var(--color-border, #c8d5da);
    border-radius: 0.5rem;
}

.table-scroll:focus-visible {
    outline: 3px solid var(--color-focus, #f2a900);
    outline-offset: 3px;
}

.legal-body table {
    width: 100%;
    min-width: 42rem;
    border-collapse: collapse;
    background: #fff;
}

.legal-body caption {
    padding: 1rem;
    font-weight: 700;
    text-align: left;
    color: var(--color-text, #1f2933);
}

.legal-body th,
.legal-body td {
    padding: 0.875rem 1rem;
    border-top: 1px solid var(--color-border, #c8d5da);
    text-align: left;
    vertical-align: top;
}

.legal-body thead th {
    background: #edf4f6;
}

.legal-body tbody th {
    width: 34%;
}

.werbung-plaetze,
.werbung-ablauf,
.werbung-kontakt,
.submit-alternative {
    padding: 3rem 0;
}

.submit-alternative {
    margin-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.submit-alternative p {
    max-width: 70ch;
    margin-bottom: 1rem;
}

.plaetze-list,
.ablauf-list {
    display: grid;
    gap: 1rem;
    list-style: none;
    margin: 1rem 0 0;
}

.plaetze-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.plaetze-title,
.ablauf-title {
    margin-bottom: 0.4rem;
    color: var(--primary-dark);
    font-size: 1.08rem;
}

.ablauf-item {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1rem;
}

.ablauf-nr {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    color: #000000;
    background: var(--accent);
    border-radius: var(--radius-pill);
    font-weight: 700;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0.65rem 1rem;
    border-radius: var(--radius-pill);
    font-weight: 700;
    text-decoration: none;
}

.btn--primary {
    color: #000000;
    background: var(--accent);
}

.btn--primary:hover,
.btn--primary:focus {
    color: #000000;
    background: var(--accent-dark);
    text-decoration: none;
}

.site-footer {
    margin-top: 3rem;
    padding: 2rem 0;
    color: #ffffff;
    background: var(--primary-dark);
}

.site-footer a,
.site-footer .footer-link {
    color: rgba(255, 255, 255, 0.88);
}

.site-footer a:hover,
.site-footer a:focus {
    color: #ffffff;
}

.footer-copy {
    margin: 0;
    color: rgba(255, 255, 255, 0.78);
}

@media (max-width: 900px) {
    .site-nav {
        display: none;
    }

    .header-content,
    .site-header .header-inner {
        align-items: center;
        flex-direction: row;
        padding: 0;
    }

    .footer-inner {
        align-items: flex-start;
        flex-direction: column;
        padding: 0.85rem 0;
    }

    .page-hero,
    .legal-hero,
    .a11y-hero,
    .werbung-hero {
        padding: 3rem 0 3.5rem;
    }

    .plaetze-list,
    .ablauf-item {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 420px) {
    /*
     * Bei stark vergrößerter Schrift darf die Wortmarke den Menüschalter
     * nicht aus dem Viewport drücken. Normal große Schrift bleibt einzeilig;
     * bei Platzmangel darf der Header kontrolliert umbrechen und wachsen.
     */
    .header {
        height: auto;
        min-height: var(--nav-height);
    }

    .header-content,
    .site-header .header-inner {
        flex-wrap: wrap;
        gap: 0.5rem 0.75rem;
        padding-block: 0.5rem;
    }
}
