/* Rechtstexte: Nutzungsbedingungen, Datenschutzerklaerung, Impressum.
   Laeuft zusammen mit header.css, footer.css und landing.css (Hintergrund,
   Grundschrift) wie /telemetry und /pricing. Alles Eigene steht unter
   .legal. Vorrang hat die Lesbarkeit: der Text liegt auf einer
   undurchsichtigen Flaeche statt auf dem Muster, Grundschrift 17 px mit
   1.75 Zeilenhoehe, Zeilen hoechstens ~70 Zeichen. */

body.legal-seite {
    display: flex;
    flex-direction: column;
}

.legal {
    position: relative;
    z-index: 1;
    flex: 1 0 auto;
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 24px clamp(16px, 4vw, 40px) 88px;
    color: #fff;
}

/* Impressum: ohne Inhaltsverzeichnis, deshalb als schmale Mittelspalte */
.legal--schmal {
    max-width: 980px;
}

.legal--schmal .legal-text {
    max-width: none;
}

/* Kopf */
.legal-kopf {
    margin: 16px 0 36px;
}

.legal-dach {
    font-family: 'Titillium Web', sans-serif;
    font-weight: 900;
    font-size: 14px;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: #ffb533;
    margin: 0 0 10px;
}

.legal-titel {
    font-family: 'Titillium Web', sans-serif;
    font-weight: 900;
    font-style: italic;
    text-transform: uppercase;
    font-size: clamp(36px, 5.2vw, 64px);
    line-height: 1;
    margin: 0 0 14px;
    overflow-wrap: anywhere;
}

.legal-stand {
    font-size: 15px;
    color: #bdbdbd;
    margin: 0;
}

/* Reiter zwischen den drei Rechtstexten */
.legal-reiter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 26px;
}

.legal-reiter a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 18px;
    border: 1px solid #3a3a3a;
    border-radius: 7px;
    background: rgba(17, 17, 17, 0.92);
    color: #ddd;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.legal-reiter a:hover {
    border-color: #ffb533;
    color: #fff;
}

.legal-reiter a[aria-current="page"] {
    background: #ffb533;
    border-color: #ffb533;
    color: #111;
}

.legal a:focus-visible {
    outline: 2px solid #ffb533;
    outline-offset: 3px;
    border-radius: 3px;
}

/* Rumpf: Inhaltsverzeichnis links, Text rechts */
.legal-rumpf {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 40px;
    align-items: start;
}

.legal-rumpf--einspaltig {
    grid-template-columns: minmax(0, 1fr);
}

.legal-inhalt {
    position: sticky;
    top: 24px;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    background: rgba(17, 17, 17, 0.94);
    border: 1px solid #2a2a2a;
    border-top: 3px solid #ffb533;
    border-radius: 0 0 8px 8px;
    padding: 18px 14px;
}

.legal-inhalt-titel {
    font-family: 'Titillium Web', sans-serif;
    font-weight: 900;
    font-size: 13px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #ffb533;
    margin: 0 0 10px 10px;
}

.legal-inhalt ol {
    list-style: none;
    margin: 0;
    padding: 0;
}

.legal-inhalt a {
    display: block;
    padding: 7px 10px;
    border-radius: 5px;
    color: #ccc;
    font-size: 14px;
    line-height: 1.4;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease;
}

.legal-inhalt a:hover {
    background: rgba(255, 181, 51, 0.1);
    color: #fff;
}

/* Textflaeche */
.legal-text {
    max-width: 820px;
    background: #111;
    border: 1px solid #2a2a2a;
    border-radius: 10px;
    padding: clamp(24px, 4vw, 48px);
}

.legal-text section {
    scroll-margin-top: 24px;
}

.legal-text section + section {
    margin-top: 40px;
    padding-top: 32px;
    border-top: 1px solid #262626;
}

.legal-text h2 {
    font-family: 'Titillium Web', sans-serif;
    font-weight: 700;
    font-size: clamp(22px, 2.2vw, 27px);
    line-height: 1.25;
    color: #fff;
    margin: 0 0 14px;
}

.legal-text h2::before {
    content: '';
    display: block;
    width: 36px;
    height: 3px;
    background: #ffb533;
    margin-bottom: 12px;
}

.legal-text h3 {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
    color: #ffb533;
    margin: 24px 0 8px;
}

.legal-text p,
.legal-text li,
.legal-text address,
.legal-text dd {
    font-size: 17px;
    line-height: 1.75;
    color: #e2e2e2;
}

.legal-text p {
    max-width: 70ch;
    margin: 0 0 16px;
}

.legal-text p:last-child,
.legal-text ul:last-child {
    margin-bottom: 0;
}

.legal-text ul {
    max-width: 70ch;
    margin: 0 0 16px;
    padding-left: 1.4em;
}

.legal-text li {
    margin-bottom: 8px;
    padding-left: 4px;
}

.legal-text li::marker {
    color: #ffb533;
}

.legal-text strong {
    color: #fff;
    font-weight: 600;
}

.legal-text a {
    color: #ffc65c;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    overflow-wrap: anywhere;
}

.legal-text a:hover {
    color: #fff;
}

/* Hervorgehobene Hinweise (Zusammenfassung, Loeschwunsch) */
.legal-hinweis {
    background: rgba(255, 181, 51, 0.08);
    border-left: 4px solid #ffb533;
    border-radius: 0 8px 8px 0;
    padding: 18px 22px;
    margin: 0 0 36px;
}

.legal-text section + .legal-hinweis,
.legal-text .legal-hinweis:last-child {
    margin: 40px 0 0;
}

.legal-hinweis-titel {
    display: block;
    font-family: 'Titillium Web', sans-serif;
    font-weight: 900;
    font-size: 13px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #ffb533;
    margin-bottom: 6px;
}

/* Impressum: Anbieter und Kontakt als Karten */
.legal-karten {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
}

/* Die dritte Karte (Verantwortlicher) bekommt die volle Breite statt
   einer halben Zeile mit Luecke daneben */
.legal-karten > .legal-karte:nth-child(3):last-child {
    grid-column: 1 / -1;
}

.legal-text .legal-karte {
    background: #171717;
    border: 1px solid #2a2a2a;
    border-top: 3px solid #ffb533;
    border-radius: 0 0 8px 8px;
    padding: 20px 22px;
    margin: 0;
}

.legal-text .legal-karte h2 {
    font-size: 19px;
    margin-bottom: 10px;
}

.legal-text .legal-karte h2::before {
    display: none;
}

.legal-text address {
    font-style: normal;
}

.legal-text .legal-karte-label {
    font-size: 15px;
    font-weight: 600;
    color: #bdbdbd;
    margin: 0 0 2px;
}

/* Textabschnitte unter den Karten wie die uebrigen Abschnitte trennen */
.legal-karten + section {
    margin-top: 40px;
    padding-top: 32px;
    border-top: 1px solid #262626;
}

.legal-kontakt {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 6px 16px;
    margin: 0;
}

.legal-kontakt dt {
    font-size: 15px;
    line-height: 1.75;
    font-weight: 600;
    color: #ffb533;
}

.legal-kontakt dd {
    margin: 0;
}

.legal-unterzeile {
    font-size: 15px;
    color: #bdbdbd;
    margin-top: 6px;
}

/* Responsive */
@media (max-width: 960px) {
    .legal-rumpf {
        grid-template-columns: minmax(0, 1fr);
        gap: 20px;
    }

    .legal-inhalt {
        position: static;
        max-height: none;
    }
}

@media (max-width: 600px) {
    .legal {
        padding-top: 8px;
        padding-bottom: 56px;
    }

    .legal-kopf {
        margin: 12px 0 24px;
    }

    /* „Datenschutzerklärung“ soll auf 320-375 px in eine Zeile passen;
       sonst wenigstens mit Trennstrich statt mitten im Wort umbrechen */
    .legal-titel {
        font-size: clamp(25px, 8vw, 40px);
        hyphens: auto;
    }

    .legal-text {
        padding: 22px 18px;
        border-radius: 8px;
    }

    .legal-text p,
    .legal-text li,
    .legal-text address,
    .legal-text dd {
        font-size: 16px;
    }

    .legal-text section + section {
        margin-top: 32px;
        padding-top: 26px;
    }

    .legal-reiter a {
        flex: 1 1 auto;
        justify-content: center;
    }

    .legal-kontakt {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
    }

    .legal-kontakt dd + dt {
        margin-top: 8px;
    }
}

/* Druck: Rechtstexte werden ausgedruckt oder als PDF gesichert */
@media print {
    body.legal-seite {
        background: #fff;
        color: #000;
    }

    body.legal-seite::before,
    .legal-seite .navbar,
    .legal-seite .footer,
    .legal-reiter,
    .legal-inhalt,
    .bug-report-trigger {
        display: none !important;
    }

    .legal {
        padding: 0;
        color: #000;
    }

    .legal-rumpf {
        display: block;
    }

    .legal-text,
    .legal-text .legal-karte {
        background: none;
        border: 0;
        padding: 0;
        max-width: none;
    }

    .legal-titel,
    .legal-text h2,
    .legal-text h3,
    .legal-text strong,
    .legal-dach,
    .legal-hinweis-titel,
    .legal-kontakt dt {
        color: #000;
    }

    .legal-text p,
    .legal-text li,
    .legal-text address,
    .legal-text dd,
    .legal-stand,
    .legal-unterzeile,
    .legal-text a {
        color: #000;
    }

    .legal-text section {
        break-inside: avoid-page;
    }
}
