/* =============================================================================
   Legal and support pages (/privacy/, /terms/, /support/, /contact/,
   /delete-account/). Loaded after styles.css: reuses its theme tokens, fonts
   and light mode, and overrides the landing-page globals that hurt long-form
   reading (list bullets, section padding, muted paragraph colour).
   ============================================================================= */

/* Long documents: jump straight to sections instead of the landing page's
   smooth scrolling (this file is only loaded on the legal pages). */
html {
    scroll-behavior: auto;
}

body.legal-page {
    --legal-text: #CBD5E1;
    --legal-rule: rgba(255, 255, 255, 0.08);
    --legal-surface: rgba(255, 255, 255, 0.03);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

body.legal-page.light-mode {
    --legal-text: #1E293B;
    --legal-rule: rgba(15, 23, 42, 0.1);
    --legal-surface: rgba(15, 23, 42, 0.03);
}

.legal-page [hidden] {
    display: none !important;
}

.skip-link {
    position: absolute;
    left: 1rem;
    top: -3rem;
    padding: 0.5rem 0.875rem;
    border-radius: 6px;
    background: var(--primary-blue);
    color: #fff;
    font-weight: 600;
    z-index: 10;
}

.skip-link:focus {
    top: 1rem;
}

.legal-page a:focus-visible,
.legal-page button:focus-visible {
    outline: 2px solid var(--primary-blue);
    outline-offset: 3px;
    border-radius: 4px;
}

/* ── Header ── */
.legal-header {
    border-bottom: 1px solid var(--legal-rule);
}

.legal-header-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0.875rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.legal-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    color: var(--text-main);
    font-family: var(--font-title);
    font-weight: 800;
    font-size: 1.05rem;
    margin-right: auto;
}

.legal-brand img {
    height: 40px;
    width: auto;
}

.legal-lang {
    display: flex;
    gap: 0.25rem;
}

.legal-lang a {
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.legal-lang a[aria-current="true"] {
    background: var(--legal-surface);
    color: var(--text-main);
    box-shadow: inset 0 0 0 1px var(--legal-rule);
}

.legal-theme-toggle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid var(--legal-rule);
    background: transparent;
    color: var(--text-main);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.legal-theme-toggle svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.legal-theme-toggle .icon-moon,
body.light-mode .legal-theme-toggle .icon-sun {
    display: none;
}

body.light-mode .legal-theme-toggle .icon-moon {
    display: block;
}

/* ── Document ── */
.legal-main {
    flex: 1;
    width: 100%;
    max-width: 46rem;
    margin: 0 auto;
    padding: 2.75rem 1.25rem 4rem;
}

.legal-doc h1 {
    font-size: clamp(1.9rem, 4.5vw, 2.5rem);
    margin-bottom: 0.5rem;
}

.legal-doc h2 {
    font-size: 1.3rem;
    margin: 2.5rem 0 0.75rem;
    scroll-margin-top: 1rem;
}

.legal-doc h3 {
    font-size: 1.05rem;
    margin: 1.75rem 0 0.5rem;
    scroll-margin-top: 1rem;
}

.legal-doc p,
.legal-doc li,
.legal-doc dd {
    color: var(--legal-text);
    font-size: 1rem;
    line-height: 1.7;
}

.legal-doc p {
    margin-bottom: 1rem;
}

.legal-doc ul,
.legal-doc ol {
    margin: 0 0 1rem 1.35rem;
}

.legal-doc ul {
    list-style: disc;
}

.legal-doc ol {
    list-style: decimal;
}

.legal-doc li {
    margin-bottom: 0.4rem;
    padding-left: 0.2rem;
}

.legal-doc strong {
    color: var(--text-main);
    font-weight: 600;
}

.legal-doc a {
    text-decoration: underline;
    text-underline-offset: 2px;
    overflow-wrap: anywhere;
}

.legal-doc section {
    padding: 0;
    border-top: 0;
    background: none;
}

.legal-meta {
    font-size: 0.9rem !important;
    color: var(--text-secondary) !important;
    margin-bottom: 1.75rem !important;
}

.legal-lead {
    font-size: 1.075rem !important;
}

.legal-notice {
    border-left: 3px solid var(--primary-blue);
    background: var(--legal-surface);
    padding: 1rem 1.125rem;
    border-radius: 0 8px 8px 0;
    margin: 1.5rem 0;
}

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

.legal-toc {
    border-top: 1px solid var(--legal-rule);
    border-bottom: 1px solid var(--legal-rule);
    padding: 1.25rem 0 0.75rem;
    margin: 1.5rem 0 1rem;
}

.legal-toc h2 {
    margin: 0 0 0.75rem;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
}

.legal-toc ol {
    columns: 2;
    column-gap: 2rem;
    margin-left: 1.25rem;
}

.legal-toc li {
    font-size: 0.925rem;
    break-inside: avoid;
}

.legal-list {
    margin: 0 0 1.25rem;
}

.legal-list dt {
    font-family: var(--font-title);
    font-weight: 700;
    color: var(--text-main);
    margin-top: 1rem;
}

.legal-list dd {
    margin: 0.2rem 0 0;
}

.legal-address {
    font-style: normal;
    color: var(--legal-text);
    line-height: 1.7;
    margin-bottom: 1rem;
}

.legal-language-note {
    margin-top: 2.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--legal-rule);
    font-size: 0.9rem !important;
    color: var(--text-secondary) !important;
}

/* ── Footer ── */
.legal-footer {
    border-top: 1px solid var(--legal-rule);
    padding: 2rem 1.25rem 2.5rem;
}

.legal-footer-inner {
    max-width: 1100px;
    margin: 0 auto;
}

.legal-footer nav ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
    margin-bottom: 1.25rem;
}

.legal-footer nav a {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

.legal-footer nav a:hover,
.legal-footer nav a[aria-current="page"] {
    color: var(--text-main);
}

.legal-footer p {
    font-size: 0.825rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    max-width: 60rem;
}

@media (max-width: 640px) {
    .legal-brand span {
        display: none;
    }

    .legal-main {
        padding-top: 2rem;
    }

    .legal-toc ol {
        columns: 1;
    }
}

@media print {
    .legal-header,
    .legal-footer nav,
    .skip-link {
        display: none;
    }

    .legal-page [hidden] {
        display: block !important;
    }
}
