/* ============================================
   LEGAL PAGES — Privacy Policy & Terms
   Extends style.css
   ============================================ */

/* --- Page Layout --- */
.legal-page {
    padding-top: 120px;
    padding-bottom: var(--section-pad);
    min-height: 100vh;
}

/* --- Header --- */
.legal-header {
    margin-bottom: 48px;
    border-bottom: 1px solid var(--gray-600);
    padding-bottom: 32px;
}

.legal-header h1 {
    font-size: clamp(2.2rem, 5vw, 3.5rem);
    margin-bottom: 12px;
}

.legal-updated {
    font-size: 0.85rem;
    color: var(--gray-300);
}

/* --- Two-column Layout: TOC + Content --- */
.legal-layout {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 64px;
    align-items: start;
}

/* --- Table of Contents --- */
.legal-toc {
    position: sticky;
    top: 96px;
}

.legal-toc-title {
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--gray-400);
    margin-bottom: 16px;
}

.legal-toc ol {
    list-style: none;
    margin: 0;
    padding: 0;
    counter-reset: toc;
}

.legal-toc li {
    counter-increment: toc;
}

.legal-toc a {
    display: block;
    padding: 6px 0;
    font-size: 0.8rem;
    color: var(--gray-300);
    text-decoration: none;
    line-height: 1.4;
    border-left: 2px solid transparent;
    padding-left: 12px;
    transition: color 0.2s, border-color 0.2s;
}

.legal-toc a:hover,
.legal-toc a:focus-visible {
    color: var(--white);
    border-left-color: var(--gray-400);
}

.legal-toc a.active {
    color: var(--white);
    border-left-color: var(--white);
}

/* --- Article Content --- */
.legal-content {
    max-width: 720px;
}

.legal-content section {
    margin-bottom: 48px;
    scroll-margin-top: 96px;
}

.legal-content h2 {
    font-size: clamp(1.2rem, 2vw, 1.5rem);
    margin-bottom: 16px;
    color: var(--gray-100);
}

.legal-content h3 {
    font-size: 1.05rem;
    margin-top: 24px;
    margin-bottom: 10px;
    color: var(--gray-100);
}

.legal-content p {
    font-size: 0.95rem;
    color: var(--gray-200);
    line-height: 1.75;
    margin-bottom: 12px;
}

.legal-content ul {
    margin: 12px 0 16px 0;
    padding: 0;
    list-style: none;
}

.legal-content ul li {
    position: relative;
    padding-left: 20px;
    font-size: 0.95rem;
    color: var(--gray-200);
    line-height: 1.75;
    margin-bottom: 6px;
}

.legal-content ul li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 12px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--gray-400);
}

.legal-content a {
    color: var(--white);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: var(--gray-400);
    transition: text-decoration-color 0.2s;
}

.legal-content a:hover {
    text-decoration-color: var(--white);
}

.legal-content a:focus-visible {
    outline: 2px solid var(--white);
    outline-offset: 2px;
    border-radius: 2px;
}

.legal-content strong {
    color: var(--white);
    font-weight: 600;
}

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

/* --- Active nav link --- */
.nav-links a[aria-current="page"],
.footer-links a[aria-current="page"] {
    color: var(--white);
}

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

    .legal-toc {
        position: static;
        margin-bottom: 40px;
        padding: 20px 24px;
        background: var(--gray-600);
        border-radius: 16px;
        border: 1px solid var(--gray-500);
    }

    .legal-toc a {
        border-left: none;
        padding-left: 0;
        padding: 8px 0;
    }

    .legal-toc a:hover,
    .legal-toc a:focus-visible {
        border-left: none;
    }
}

@media (max-width: 768px) {
    .legal-page {
        padding-top: 100px;
    }

    .legal-header {
        margin-bottom: 32px;
        padding-bottom: 24px;
    }

    .legal-content section {
        margin-bottom: 36px;
        scroll-margin-top: 80px;
    }
}

/* --- Print Styles --- */
@media print {
    body {
        background: white;
        color: black;
    }

    .grain-overlay,
    .navbar,
    .mobile-menu,
    .legal-toc,
    .skip-link,
    footer {
        display: none !important;
    }

    .legal-page {
        padding-top: 0;
    }

    .legal-layout {
        display: block;
    }

    .legal-header {
        border-bottom: 2px solid #000;
    }

    .legal-header h1 {
        font-size: 2rem;
        color: black;
    }

    .legal-updated {
        color: #666;
    }

    .legal-content {
        max-width: 100%;
    }

    .legal-content h2 {
        color: black;
        page-break-after: avoid;
    }

    .legal-content h3 {
        color: black;
        page-break-after: avoid;
    }

    .legal-content p,
    .legal-content li {
        color: #333;
    }

    .legal-content strong {
        color: black;
    }

    .legal-content a {
        color: black;
        text-decoration: underline;
    }

    .legal-content a[href^="http"]::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #666;
    }

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