/*
 * Rechtsseiten (Impressum, Datenschutz, AGB, Cookie-Richtlinie)
 * Wird nach style.css geladen und gilt nur für <body class="legal-page">.
 * Schwerpunkt: gute Lesbarkeit und sauberes Layout auf dem Smartphone.
 */

.legal-page {
    --legal-accent: #5a67d8;
    --legal-text: #2d3748;
    --legal-muted: #4a5568;
    --legal-border: #e2e8f0;
    --legal-gutter: clamp(12px, 3vw, 20px);
    padding: var(--legal-gutter);
    color: var(--legal-text);
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

.legal-page .container {
    max-width: 900px;
}

/* ---------- Kopfzeile ---------- */

.legal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 4px 0 clamp(14px, 3vw, 22px);
    color: #fff;
    text-align: left;
}

.legal-header h1 {
    margin: 0;
    font-size: clamp(1.45rem, 5.5vw, 2.4rem);
    line-height: 1.2;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    overflow-wrap: anywhere;
    hyphens: auto;
}

/* Zurück-Pfeil als gut treffbare Schaltfläche (min. 44 × 44 px) */
.legal-back {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    line-height: 0;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

/* SVG statt Schriftzeichen: exakt mittig im Kreis, unabhängig von der Schrift */
.legal-back svg {
    display: block;
}

.legal-back:hover,
.legal-back:focus-visible {
    background: rgba(255, 255, 255, 0.32);
}

.legal-back:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 2px;
}

/* ---------- Inhaltskarte ---------- */

.legal-card {
    background: rgba(255, 255, 255, 0.96);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    padding: clamp(18px, 5vw, 40px);
}

.legal-content {
    font-size: 1rem;
    line-height: 1.65;
    overflow-wrap: break-word;
    hyphens: auto;
}

.legal-content h2 {
    font-size: clamp(1.1rem, 4vw, 1.3rem);
    line-height: 1.3;
    color: var(--legal-accent);
    font-weight: 700;
    margin: 32px 0 10px;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--legal-border);
}

.legal-content h2:first-child {
    margin-top: 0;
}

.legal-content h3 {
    font-size: clamp(0.98rem, 3.6vw, 1.08rem);
    line-height: 1.35;
    color: var(--legal-text);
    font-weight: 700;
    margin: 22px 0 6px;
}

.legal-content h2 + h3 {
    margin-top: 12px;
}

.legal-content p {
    margin: 0 0 12px;
}

.legal-content ul,
.legal-content ol {
    margin: 0 0 14px;
    padding-left: 1.3em;
}

.legal-content li {
    margin-bottom: 6px;
}

.legal-content li::marker {
    color: var(--legal-accent);
}

.legal-content strong {
    color: var(--legal-text);
}

/* Lange URLs (z. B. Google-Links) dürfen umbrechen statt die Seite zu verbreitern */
.legal-content a {
    color: var(--legal-accent);
    overflow-wrap: anywhere;
    word-break: break-word;
    text-underline-offset: 2px;
}

.legal-content a:hover {
    color: #434190;
}

/* ---------- Abschluss ---------- */

.legal-footer {
    margin-top: 28px;
    padding-top: 18px;
    border-top: 2px solid var(--legal-border);
}

.legal-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 18px;
    border-radius: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff !important;
    font-weight: 600;
    text-decoration: none;
    overflow-wrap: normal;
    word-break: normal;
}

.legal-button:hover,
.legal-button:focus-visible {
    filter: brightness(1.08);
}

/* ---------- Kleine Bildschirme ---------- */

@media (max-width: 480px) {
    .legal-card {
        border-radius: 12px;
    }

    .legal-content {
        font-size: 0.97rem;
        line-height: 1.6;
    }

    .legal-content h2 {
        margin-top: 26px;
    }

    .legal-button {
        width: 100%;
        justify-content: center;
    }
}

/* ---------- Druck ---------- */

@media print {
    .legal-page {
        background: #fff;
        padding: 0;
    }

    .legal-header {
        color: #000;
    }

    .legal-header h1 {
        text-shadow: none;
    }

    .legal-back,
    .legal-footer {
        display: none;
    }

    .legal-card {
        box-shadow: none;
        padding: 0;
    }
}
