/*
 * Legal pages (Terms, Privacy, Imprint)
 * Scoped to .legal-page / .legal-content — used only on these 3 pages.
 * Reuses existing --theme-* tokens; dark-mode color overrides for
 * .legal-content already live in general.css.
 */

.legal-page {
    max-width: 56rem;
    margin: 0 auto;
    padding: 1rem 1rem 5rem;
}

/* Content typography */
.legal-content {
    color: var(--theme-foreground);
    font-size: 1rem;
    line-height: 1.7;
}

/* The markdown's own leading "# Title" becomes the page header */
.legal-content > h1:first-child {
    margin: 0 0 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--theme-border-color);
    font-size: 2.75rem;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
}

.legal-content h2 {
    margin: 3rem 0 1rem;
    padding-top: 2rem;
    border-top: 1px solid var(--theme-border-color);
    font-size: 1.875rem;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.01em;
}

.legal-content > h1:first-child + h2 {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.legal-content h3 {
    margin: 2rem 0 0.75rem;
    font-size: 1.375rem;
    font-weight: 600;
    line-height: 1.3;
}

.legal-content h4,
.legal-content h5,
.legal-content h6 {
    margin: 1.5rem 0 0.5rem;
    font-size: 1.0625rem;
    font-weight: 600;
}

.legal-content p {
    margin: 0 0 1.1rem;
}

.legal-content ul,
.legal-content ol {
    margin: 0 0 1.1rem;
    padding-left: 1.375rem;
}

.legal-content li {
    margin-bottom: 0.5rem;
}

.legal-content li:last-child {
    margin-bottom: 0;
}

.legal-content li > ul,
.legal-content li > ol {
    margin-top: 0.5rem;
}

.legal-content a {
    color: var(--theme-interactive);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.legal-content a:hover {
    color: var(--theme-interactive-hover);
}

.legal-content strong,
.legal-content b {
    font-weight: 600;
}

.legal-content hr {
    margin: 2.5rem 0;
    border: none;
    border-top: 1px solid var(--theme-border-color);
}

/* Tables */
.legal-content table {
    width: 100%;
    margin: 0.5rem 0 2rem;
    border-collapse: collapse;
    font-size: 0.9375rem;
    line-height: 1.5;
}

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

.legal-content th {
    background: var(--theme-subtle-background);
    font-weight: 600;
    white-space: nowrap;
}

@media (max-width: 576px) {
    .legal-page {
        padding: 0.5rem 1rem 3rem;
    }

    .legal-content > h1:first-child {
        font-size: 2rem;
    }

    .legal-content h2 {
        font-size: 1.5rem;
    }
}
