/* ==========================================================================
   Shared styling for the legal pages (Datenschutz, Impressum).
   Loaded after styles.css - reuses the same tokens, adds long-form document
   typography: narrow measure, clear heading hierarchy, readable lists.
   ========================================================================== */

/* The legal pages have no link list in the nav, so the CTA needs to claim the
   free space itself. Scoped by the sibling selector, so the home page (where a
   <nav> sits between brand and button) is unaffected. */
.nav__brand + .btn { margin-left: auto; }

.legal-page {
    /* Comfortable reading measure. Legal text is dense; a wide line hurts. */
    width: min(100% - (var(--gutter) * 2), 760px);
    margin-inline: auto;
    padding-top: clamp(7rem, 14vw, 9rem);
    padding-bottom: clamp(3rem, 8vw, 5rem);
}

.legal-page__head {
    padding-bottom: 2.2rem;
    margin-bottom: 2.8rem;
    border-bottom: 1px solid var(--hairline);
}

.legal-page h1 {
    /* German legal headings are long single words ("Datenschutzerklärung").
       The lower bound has to be small enough that they fit a 320px screen, and
       hyphenation gives the browser a place to break if they still do not. */
    font-size: clamp(1.7rem, 7vw, 3.2rem);
    hyphens: auto;
    -webkit-hyphens: auto;
    overflow-wrap: break-word;
}

.legal-page__meta {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--ink-3);
}

.legal-page h2 {
    font-size: clamp(1.22rem, 3vw, 1.6rem);
    margin-top: 3rem;
    margin-bottom: 0.9rem;
    scroll-margin-top: 7rem;
    hyphens: auto;
    -webkit-hyphens: auto;
    overflow-wrap: break-word;
}

.legal-page h3 {
    font-size: 1.06rem;
    margin-top: 2rem;
    margin-bottom: 0.6rem;
}

.legal-page p,
.legal-page li {
    color: var(--ink-2);
    font-size: 1rem;
    line-height: 1.68;
}

.legal-page p + p { margin-top: 0.9rem; }

.legal-page ul,
.legal-page ol {
    margin: 0.9rem 0 0;
    padding-left: 1.3rem;
}

.legal-page li + li { margin-top: 0.5rem; }

.legal-page a {
    color: var(--crimson);
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-thickness: 1px;
    overflow-wrap: anywhere;
}

.legal-page a:hover { color: var(--crimson-deep); }

.legal-page strong { color: var(--ink); font-weight: 700; }

/* Address / responsible-party block */
.legal-card {
    margin-top: 1.2rem;
    padding: 1.3rem 1.5rem;
    border-radius: var(--radius);
    background: var(--card);
    box-shadow: inset 0 0 0 1px var(--hairline);
}

.legal-card p { color: var(--ink); }
.legal-card p + p { margin-top: 0.2rem; }

/* Highlighted note (e.g. "this app collects nothing") */
.legal-note {
    margin-top: 1.4rem;
    padding: 1.2rem 1.4rem;
    border-radius: var(--radius);
    background: var(--gold-soft);
    box-shadow: inset 0 0 0 1px rgba(204, 153, 26, 0.3);
}

.legal-note p { color: var(--ink); }

/* Table of contents */
.legal-toc {
    margin-top: 2rem;
    padding: 1.3rem 1.5rem;
    border-radius: var(--radius);
    background: var(--bg-deep);
    box-shadow: inset 0 0 0 1px var(--hairline);
}

.legal-toc h2 {
    margin: 0 0 0.8rem;
    font-size: 0.78rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--crimson);
    font-family: var(--body);
    font-weight: 700;
}

.legal-toc ol {
    margin: 0;
    padding-left: 1.2rem;
}

.legal-toc a {
    color: var(--ink);
    text-decoration: none;
}

.legal-toc a:hover { color: var(--crimson); text-decoration: underline; }

/* Language divider for the English section */
.legal-divider {
    margin-top: 4rem;
    padding-top: 2.4rem;
    border-top: 2px solid var(--hairline);
}

.legal-warning {
    margin-top: 1.2rem;
    padding: 1.1rem 1.3rem;
    border-radius: var(--radius);
    background: rgba(204, 38, 38, 0.06);
    box-shadow: inset 0 0 0 1px rgba(204, 38, 38, 0.25);
}

.legal-warning p { color: var(--ink); font-weight: 600; }

/* Back link */
.legal-back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 3.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--crimson);
    text-decoration: none;
}

.legal-back::before {
    content: '';
    width: 8px;
    height: 8px;
    border-left: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg);
}

.legal-back:hover { color: var(--crimson-deep); }
