/* ============================================================================
   CastandCurtain — Shared Legal Page Styles (Terms & Privacy)
   ============================================================================ */

/* ── Legal page layout ── */
.legal-page {
    padding-top: 7rem;
    padding-bottom: 6rem;
}

.legal-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 3.5rem;
    max-width: 1020px;
    margin: 0 auto;
    padding: 0 1.5rem;
    align-items: start;
}

/* ── TOC ── */
.legal-toc {
    position: sticky;
    top: 5.5rem;
}

.legal-toc-title {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #f59e0b;
    margin-bottom: 0.75rem;
}

.legal-toc ol {
    list-style: none;
    padding: 0;
    margin: 0;
    border-left: 2px solid rgba(245,158,11,0.25);
}

.legal-toc ol li a {
    display: block;
    padding: 0.35rem 0 0.35rem 0.85rem;
    font-size: 0.8125rem;
    color: #8892a4;
    line-height: 1.4;
    transition: color 0.18s;
}

.legal-toc ol li a:hover {
    color: #f59e0b;
}

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

.legal-content h1 {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: 0.5rem;
    color: #f0f2f5;
}

.legal-content h1::after {
    content: '';
    display: block;
    width: 3rem;
    height: 3px;
    background: linear-gradient(90deg, #D97706, #EAB308);
    border-radius: 2px;
    margin-top: 0.75rem;
}

.legal-meta {
    color: #8892a4;
    font-size: 0.875rem;
    margin: 1rem 0 2.5rem;
}

.legal-content h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #f0f2f5;
    margin-top: 3rem;
    margin-bottom: 0.75rem;
    padding-top: 0.25rem;
    scroll-margin-top: 6rem;
}

.legal-content h2::before {
    content: '';
    display: block;
    width: 100%;
    height: 1px;
    background: rgba(245,158,11,0.18);
    margin-bottom: 1.25rem;
}

.legal-content h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #c8d0e0;
    margin-top: 1.75rem;
    margin-bottom: 0.5rem;
}

.legal-content p {
    font-size: 1.0625rem;
    line-height: 1.75;
    color: #8892a4;
    margin: 0.75rem 0;
}

.legal-content ul {
    padding-left: 0;
    margin: 0.75rem 0;
    list-style: none;
}

.legal-content ul li {
    font-size: 1.0625rem;
    line-height: 1.75;
    color: #8892a4;
    margin-bottom: 0.4rem;
    padding-left: 1.4rem;
    position: relative;
}

.legal-content ul li::before {
    content: '›';
    position: absolute;
    left: 0;
    color: #f59e0b;
    font-weight: 700;
}

.legal-content a {
    color: #f59e0b;
    text-decoration: underline;
    text-decoration-color: rgba(245,158,11,0.4);
}

.legal-content a:hover {
    color: #EAB308;
    text-decoration-color: #EAB308;
}

/* ── Billing callout (terms page) ── */
#billing {
    position: relative;
}

.billing-notice {
    background: rgba(245,158,11,0.07);
    border: 1px solid rgba(245,158,11,0.28);
    border-left: 3px solid #f59e0b;
    border-radius: 0 8px 8px 0;
    padding: 0.875rem 1.125rem;
    margin: 0.75rem 0 1.25rem;
}

.billing-notice p {
    color: #c8a43c;
    font-size: 0.9375rem;
    margin: 0;
}

/* ── Footer rule ── */
.legal-footer-note {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.06);
    font-size: 0.8rem;
    color: #8892a4;
}

/* ── Mobile: collapse TOC ── */
@media (max-width: 860px) {
    .legal-layout {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .legal-toc {
        position: static;
        background: rgba(16,20,30,0.9);
        border: 1px solid rgba(255,255,255,0.07);
        border-radius: 10px;
        padding: 1rem 1.25rem;
        margin-bottom: 2rem;
    }

    .legal-toc-toggle {
        display: flex;
        align-items: center;
        justify-content: space-between;
        cursor: pointer;
        user-select: none;
    }

    .legal-toc-toggle .arrow {
        font-size: 0.75rem;
        color: #8892a4;
        transition: transform 0.2s;
    }

    .legal-toc.open .arrow {
        transform: rotate(180deg);
    }

    .legal-toc ol {
        display: none;
        border-left: none;
        margin-top: 0.75rem;
    }

    .legal-toc.open ol {
        display: block;
    }

    .legal-content h1 {
        font-size: 1.875rem;
    }

    .legal-content p,
    .legal-content ul li {
        font-size: 1rem;
    }
}
