/* ═══════════════════════════════════════════════════
   SHARED LEGAL STYLESHEET for privacy.html & terms-of-service.html
   ═══════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --legal-dark: #151921;
    --legal-gold: #FFD166;
    --legal-mint: #06D6A0;
    --legal-bg: #F8F9FA;
    --legal-card: #FFFFFF;
    --legal-text: #1F2937;
    --legal-muted: #6B7280;
    --legal-border: #E5E7EB;
    --legal-footer-bg: #11161D;
}

html { scroll-behavior: smooth; }

body {
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.75;
    color: var(--legal-text);
    background-color: var(--legal-bg);
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a { text-decoration: none; color: inherit; }

ul { list-style: none; }

h1, h2, h3, h4 {
    font-family: 'Georgia', 'Times New Roman', serif;
    line-height: 1.25;
}

.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ─── LEGAL NAVIGATION ─── */
.legal-nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 72px;
    background-color: var(--legal-dark);
    box-shadow: 0 2px 12px rgba(0,0,0,0.12);
    z-index: 1000;
    display: flex;
    align-items: center;
}

.legal-nav .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.legal-nav .nav-logo {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--legal-gold);
    letter-spacing: 0.02em;
}

.legal-nav .nav-links {
    display: flex;
    align-items: center;
    gap: 28px;
}

.legal-nav .nav-links a {
    font-size: 0.95rem;
    font-weight: 500;
    color: #ffffff;
    transition: color 0.25s;
}

.legal-nav .nav-links a:hover {
    color: var(--legal-gold);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
}

.nav-toggle span {
    display: block;
    width: 26px;
    height: 2.5px;
    background-color: #ffffff;
    border-radius: 2px;
    transition: transform 0.3s, opacity 0.3s;
}

.nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

@media (max-width: 860px) {
    .nav-toggle { display: flex; }

    .legal-nav .nav-links {
        position: fixed;
        top: 0; right: -100%;
        width: 280px; height: 100vh;
        background-color: var(--legal-dark);
        flex-direction: column;
        align-items: flex-start;
        padding: 100px 32px 40px;
        gap: 28px;
        transition: right 0.35s ease;
        box-shadow: -4px 0 24px rgba(0,0,0,0.25);
    }

    .legal-nav .nav-links.open { right: 0; }

    .legal-nav .nav-links a { font-size: 1.1rem; }
}

/* ─── LEGAL PAGE HEADER (div/header element, NOT section) ─── */
.legal-header {
    padding: 120px 0 64px;
    background: linear-gradient(135deg, var(--legal-dark) 0%, #1E2530 100%);
    text-align: center;
}

.legal-header h1 {
    font-size: 2.8rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 12px;
}

.legal-header p {
    font-size: 1rem;
    color: #94A3B8;
}

/* ─── LEGAL CONTENT ─── */
.legal-content {
    padding: 56px 0 64px;
}

.legal-content .container {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 48px;
    align-items: start;
}

/* ─── TABLE OF CONTENTS ─── */
nav.toc {
    position: sticky;
    top: 96px;
    background-color: var(--legal-card);
    border: 1px solid var(--legal-border);
    border-radius: 12px;
    padding: 24px;
}

nav.toc h2 {
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--legal-mint);
    margin-bottom: 14px;
}

nav.toc ol {
    list-style: decimal;
    padding-left: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

nav.toc ol li {
    font-size: 0.88rem;
    color: var(--legal-muted);
    line-height: 1.5;
}

nav.toc ol li a {
    color: var(--legal-text);
    transition: color 0.2s;
}

nav.toc ol li a:hover {
    color: var(--legal-mint);
}

/* ─── LEGAL ARTICLE ─── */
.legal-article { min-width: 0; }

.legal-article section {
    margin-bottom: 40px;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--legal-border);
}

.legal-article section:last-child { border-bottom: none; }

.legal-article h2 {
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--legal-dark);
    margin-bottom: 14px;
}

.legal-article p {
    font-size: 1rem;
    color: var(--legal-text);
    line-height: 1.8;
    margin-bottom: 14px;
}

.legal-article p:last-child { margin-bottom: 0; }

.legal-article ul {
    list-style: disc;
    padding-left: 22px;
    margin-bottom: 14px;
}

.legal-article ul li {
    font-size: 1rem;
    color: var(--legal-text);
    line-height: 1.8;
    margin-bottom: 6px;
}

.legal-article strong {
    color: var(--legal-dark);
}

.back-home {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 32px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--legal-mint);
    transition: color 0.25s;
}

.back-home:hover { color: var(--legal-gold); }

@media (max-width: 860px) {
    .legal-content .container {
        grid-template-columns: 1fr;
    }

    nav.toc {
        position: static;
        margin-bottom: 24px;
    }

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

/* ═══════════════════════════════════════════════════
   SCOPE ISOLATION RULE
   Guarantees legal page sections are never polluted
   by homepage-specific section background styling.
   Applied to body content ONLY, never header/footer.
   ═══════════════════════════════════════════════════ */
.legal-page .legal-content section {
    background-color: transparent !important;
}

/* ─── FOOTER ─── */
.legal-footer {
    background-color: var(--legal-footer-bg);
    color: #ffffff;
    padding: 32px 0;
    text-align: center;
}

.legal-footer p {
    font-size: 0.82rem;
    color: #64748B;
}

.legal-footer a {
    color: var(--legal-mint);
    transition: color 0.25s;
}

.legal-footer a:hover { color: var(--legal-gold); }
