/* legal.css — Shared styles for all legal/compliance pages.
   Components: LegalPageTemplate, LegalSectionNav, LegalPageHeader,
   PlainEnglishSummary, DistrictReviewerCard, PageTableOfContents,
   LegalBodyContent, RelatedLegalLinks, LegalContactCard, MobileLegalNav, MobilePageToc */

/* ===== RESET & VARIABLES ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }

:root {
    --ink: #0a0a0a;
    --chalk: #fafaf8;
    --slate: #3a3a3a;
    --pencil: #6b6b6b;
    --color-accent: #C17E1A;
    --amber: var(--color-accent);
    --amber-glow: rgba(193, 126, 26, 0.125);
    --amber-dim: rgba(193, 126, 26, 0.1);
    --rule-line: #d8d4cc;
    --surface: #f3f1ec;
    --warm-bg: #f9f7f3;
}

body {
    font-family: Georgia, serif;
    background: var(--chalk);
    color: var(--ink);
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: 'Space Grotesk', sans-serif; }

/* ===== SITE HEADER NAV ===== */
.site-header {
    border-bottom: 1px solid var(--rule-line);
}
.site-header nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 48px;
    max-width: 1200px;
    margin: 0 auto;
}
.logo {
    font-family: 'Trebuchet MS', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: -0.5px;
    text-decoration: none;
}
.logo span { color: var(--amber); }
.nav-links {
    display: flex;
    align-items: center;
    gap: 16px;
}
.nav-link {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--slate);
    text-decoration: none;
    transition: color 0.2s;
}
.nav-link:hover { color: var(--ink); }
.nav-link.active { color: var(--amber); }
.nav-cta {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    background: var(--ink);
    color: white;
    padding: 8px 20px;
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.2s;
}
.nav-cta:hover { background: var(--slate); }
.nav-cta-mobile {
    display: none;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    background: var(--color-accent);
    color: white;
    padding: 8px 20px;
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.2s;
}
.nav-cta-mobile:hover { background: #a86c17; }

/* ===== HAMBURGER MENU ===== */
.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 6px;
    font-size: 1.6rem;
    color: var(--ink);
    line-height: 1;
    z-index: 1001;
    position: relative;
}
.mobile-menu {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(10, 10, 10, 0.96);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 80px 24px 56px;
}
.mobile-menu.open { display: flex; }
.mobile-menu-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 1.75rem;
    color: rgba(255, 255, 255, 0.65);
    cursor: pointer;
    padding: 8px;
    line-height: 1;
    transition: color 0.2s;
}
.mobile-menu-close:hover { color: #fff; }
.mobile-nav-link {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.2rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.82);
    text-decoration: none;
    padding: 13px 28px;
    border-radius: 10px;
    transition: color 0.2s, background 0.2s;
    width: 100%;
    max-width: 300px;
    text-align: center;
}
.mobile-nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}
.mobile-nav-cta {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    background: var(--color-accent, #C17E1A);
    text-decoration: none;
    padding: 14px 32px;
    border-radius: 10px;
    transition: background 0.2s;
    width: 100%;
    max-width: 300px;
    text-align: center;
    margin-top: 12px;
}
.mobile-nav-cta:hover { background: #a86c17; }

/* ===== LegalPageTemplate — three-column grid ===== */
.legal-template {
    max-width: 1140px;
    margin: 0 auto;
    padding: 32px 36px 0;
    display: grid;
    grid-template-columns: 210px 1fr 210px;
    grid-template-rows: auto;
    gap: 0 32px;
    grid-template-areas:
        "leftnav  content  toc";
    align-items: start;
}

/* ===== LegalSectionNav — sticky left sidebar ===== */
.legal-section-nav {
    grid-area: leftnav;
    position: sticky;
    top: 28px;
    align-self: start;
    padding-bottom: 40px;
}
.legal-section-nav__title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--pencil);
    margin-bottom: 14px;
}
.legal-section-nav__links {
    display: flex;
    flex-direction: column;
    gap: 2px;
    list-style: none;
}
.legal-section-nav__link {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.84rem;
    font-weight: 500;
    color: var(--pencil);
    text-decoration: none;
    padding: 7px 14px;
    border-radius: 6px;
    transition: color 0.2s, background 0.2s;
    display: block;
}
.legal-section-nav__link:hover {
    color: var(--ink);
    background: var(--surface);
    text-decoration: none;
}
.legal-section-nav__link[aria-current="page"] {
    color: var(--amber);
    background: var(--amber-dim);
    font-weight: 600;
}
.legal-section-nav__helper {
    font-family: Georgia, serif;
    font-size: 0.74rem;
    color: var(--pencil);
    line-height: 1.5;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--rule-line);
}

/* ===== MobileLegalNav — dropdown for mobile ===== */
.mobile-legal-nav {
    display: none;
}
.mobile-legal-nav__toggle {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--rule-line);
    border-radius: 8px;
    padding: 10px 16px;
    width: 100%;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: border-color 0.2s;
}
.mobile-legal-nav__toggle:hover {
    border-color: var(--amber);
}
.mobile-legal-nav__toggle::after {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--pencil);
    border-bottom: 2px solid var(--pencil);
    transform: rotate(45deg);
    margin-left: 8px;
    transition: transform 0.2s;
}
.mobile-legal-nav__toggle[aria-expanded="true"]::after {
    transform: rotate(-135deg);
}
.mobile-legal-nav__dropdown {
    display: none;
    background: white;
    border: 1px solid var(--rule-line);
    border-radius: 8px;
    margin-top: 6px;
    padding: 6px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}
.mobile-legal-nav__dropdown.open {
    display: block;
}
.mobile-legal-nav__dropdown a {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.84rem;
    font-weight: 500;
    color: var(--slate);
    text-decoration: none;
    padding: 9px 14px;
    border-radius: 6px;
    display: block;
    transition: background 0.15s, color 0.15s;
}
.mobile-legal-nav__dropdown a:hover {
    background: var(--surface);
    color: var(--ink);
    text-decoration: none;
}
.mobile-legal-nav__dropdown a[aria-current="page"] {
    color: var(--amber);
    background: var(--amber-dim);
    font-weight: 600;
}

/* ===== Main content area ===== */
.legal-main {
    grid-area: content;
    min-width: 0;
    padding-bottom: 72px;
}

/* ===== LegalPageHeader ===== */
.legal-page-header {
    margin-bottom: 28px;
}
.legal-page-header__eyebrow {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--amber);
    margin-bottom: 8px;
}
.legal-page-header h1 {
    font-size: 2.2rem;
    letter-spacing: -0.8px;
    margin-bottom: 6px;
    line-height: 1.15;
}
.legal-page-header__meta {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
.legal-page-header__date {
    font-size: 0.82rem;
    color: var(--pencil);
}
.legal-page-header__print {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--pencil);
    background: none;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0;
    transition: color 0.2s;
}
.legal-page-header__print:hover {
    color: var(--ink);
}
.legal-page-header__intro {
    font-size: 0.95rem;
    color: var(--slate);
    line-height: 1.7;
    margin-top: 14px;
}

/* ===== PlainEnglishSummary ===== */
.plain-english-summary {
    background: var(--warm-bg);
    border: 1px solid #e8dfcc;
    border-left: 3px solid var(--amber);
    border-radius: 0 8px 8px 0;
    padding: 18px 22px;
    margin-bottom: 20px;
}
.plain-english-summary__label {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--amber);
    margin-bottom: 8px;
}
.plain-english-summary p {
    font-size: 0.9rem;
    color: var(--slate);
    line-height: 1.7;
    margin-bottom: 0;
}

/* ===== DistrictReviewerCard ===== */
.district-reviewer-card {
    background: var(--surface);
    border: 1px solid var(--rule-line);
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 28px;
}
.district-reviewer-card__title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 6px;
}
.district-reviewer-card p {
    font-size: 0.84rem;
    color: var(--pencil);
    line-height: 1.6;
    margin-bottom: 0;
}
.district-reviewer-card a {
    color: var(--amber);
    text-decoration: none;
}
.district-reviewer-card a:hover {
    text-decoration: underline;
}

/* ===== PageTableOfContents — sticky right sidebar ===== */
.page-toc {
    grid-area: toc;
    position: sticky;
    top: 28px;
    align-self: start;
    padding-bottom: 40px;
}
.page-toc__title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--pencil);
    margin-bottom: 12px;
}
.page-toc__list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.page-toc__item {
    margin-bottom: 1px;
}
.page-toc__link {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--pencil);
    text-decoration: none;
    display: block;
    padding: 5px 12px;
    border-left: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s;
    line-height: 1.4;
}
.page-toc__link:hover {
    color: var(--ink);
    text-decoration: none;
}
.page-toc__link.active {
    color: var(--amber);
    border-left-color: var(--amber);
    font-weight: 600;
}

/* ===== MobilePageToc — collapsible accordion ===== */
.mobile-page-toc {
    display: none;
    margin-bottom: 24px;
}
.mobile-page-toc__toggle {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--rule-line);
    border-radius: 8px;
    padding: 10px 16px;
    width: 100%;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: border-color 0.2s;
}
.mobile-page-toc__toggle:hover {
    border-color: var(--amber);
}
.mobile-page-toc__toggle::after {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--pencil);
    border-bottom: 2px solid var(--pencil);
    transform: rotate(45deg);
    transition: transform 0.2s;
}
.mobile-page-toc__toggle[aria-expanded="true"]::after {
    transform: rotate(-135deg);
}
.mobile-page-toc__panel {
    display: none;
    background: white;
    border: 1px solid var(--rule-line);
    border-radius: 8px;
    margin-top: 6px;
    padding: 10px 6px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}
.mobile-page-toc__panel.open {
    display: block;
}
.mobile-page-toc__panel a {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--pencil);
    text-decoration: none;
    display: block;
    padding: 6px 14px;
    border-radius: 4px;
    transition: background 0.15s, color 0.15s;
}
.mobile-page-toc__panel a:hover {
    background: var(--surface);
    color: var(--ink);
    text-decoration: none;
}

/* ===== LegalBodyContent ===== */
.legal-body h2 {
    font-size: 1.15rem;
    font-weight: 600;
    margin: 36px 0 12px;
    color: var(--ink);
    padding-top: 4px;
    scroll-margin-top: 80px;
}
.legal-body h2:first-child { margin-top: 0; }
.legal-body p {
    font-size: 0.95rem;
    color: var(--slate);
    line-height: 1.7;
    margin-bottom: 14px;
}
.legal-body ul, .legal-body ol {
    padding-left: 22px;
    margin-bottom: 14px;
}
.legal-body ul li, .legal-body ol li {
    font-size: 0.95rem;
    color: var(--slate);
    line-height: 1.7;
    margin-bottom: 6px;
}
.legal-body a {
    color: var(--amber);
    text-decoration: none;
}
.legal-body a:hover { text-decoration: underline; }
.legal-body strong { color: var(--ink); font-weight: 600; }

/* Tables in legal body */
.legal-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 18px 0 26px;
    font-size: 0.9rem;
}
.legal-body th {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: 0.76rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-align: left;
    padding: 9px 14px;
    background: var(--surface);
    border-bottom: 2px solid var(--rule-line);
    color: var(--ink);
}
.legal-body td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--rule-line);
    color: var(--slate);
    vertical-align: top;
    line-height: 1.55;
}
.legal-body tr:last-child td { border-bottom: none; }
.legal-body td strong { color: var(--ink); }

/* Callout box (used in data-privacy, security) */
.legal-body .callout {
    background: var(--amber-dim);
    border-left: 3px solid var(--amber);
    border-radius: 0 6px 6px 0;
    padding: 16px 20px;
    margin: 20px 0 24px;
}
.legal-body .callout p {
    margin-bottom: 0;
    font-size: 0.9rem;
    color: var(--ink);
}
.legal-body .callout ul {
    margin-top: 8px;
    margin-bottom: 0;
}
.legal-body .callout li {
    font-size: 0.88rem;
}

/* ===== RelatedLegalLinks ===== */
.related-legal-links {
    border-top: 1px solid var(--rule-line);
    padding-top: 28px;
    margin-top: 40px;
}
.related-legal-links__title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--pencil);
    margin-bottom: 12px;
}
.related-legal-links__list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    padding: 0;
}
.related-legal-links__list a {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--slate);
    text-decoration: none;
    padding: 6px 14px;
    border: 1px solid var(--rule-line);
    border-radius: 6px;
    transition: border-color 0.2s, color 0.2s, background 0.2s;
    display: inline-block;
}
.related-legal-links__list a:hover {
    border-color: var(--amber);
    color: var(--amber);
    background: var(--amber-dim);
    text-decoration: none;
}

/* ===== LegalContactCard ===== */
.legal-contact-card {
    background: var(--surface);
    border: 1px solid var(--rule-line);
    border-radius: 8px;
    padding: 20px 22px;
    margin-top: 28px;
}
.legal-contact-card__title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 8px;
}
.legal-contact-card p {
    font-size: 0.88rem;
    color: var(--pencil);
    line-height: 1.6;
    margin-bottom: 10px;
}
.legal-contact-card p:last-child { margin-bottom: 0; }
.legal-contact-card a {
    color: var(--amber);
    text-decoration: none;
    font-weight: 500;
}
.legal-contact-card a:hover { text-decoration: underline; }

/* ===== FOOTER (3-col) ===== */
footer {
    border-top: 1px solid var(--rule-line);
    padding: 48px 48px 32px;
    background: var(--chalk);
    margin-top: 0;
}
footer a { color: var(--pencil); text-decoration: none; }
footer a:hover { color: var(--ink); }
.footer-inner { max-width: 1200px; margin: 0 auto; }
.footer-columns {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 32px;
}
.footer-col { display: flex; flex-direction: column; gap: 8px; }
.footer-col h4 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink);
    margin-bottom: 4px;
}
.footer-col a {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.82rem;
    color: var(--pencil);
    text-decoration: none;
    transition: color 0.2s;
}
.footer-col a:hover { color: var(--amber); }
.footer-disclaimer {
    text-align: center;
    font-size: 0.78rem;
    color: var(--pencil);
    max-width: 640px;
    margin: 0 auto 12px;
    line-height: 1.6;
    padding-top: 24px;
    border-top: 1px solid var(--rule-line);
}
.footer-copy {
    text-align: center;
    font-size: 0.75rem;
    color: var(--pencil);
}

/* ===== PRINT ===== */
@media print {
    .site-header, .mobile-menu, .legal-section-nav, .page-toc,
    .mobile-legal-nav, .mobile-page-toc, .legal-page-header__print,
    footer { display: none !important; }
    .legal-template {
        display: block !important;
        padding: 0 !important;
        max-width: none !important;
    }
    .legal-main { padding: 0 !important; }
    .plain-english-summary { break-inside: avoid; }
    .district-reviewer-card { break-inside: avoid; }
    .legal-contact-card { break-inside: avoid; }
}

/* ===== RESPONSIVE — tablet (<=1024px) ===== */
@media (max-width: 1024px) {
    .legal-template {
        grid-template-columns: 200px 1fr;
        grid-template-areas:
            "leftnav content";
        padding: 28px 28px 0;
    }
    .page-toc { display: none; }
    .mobile-page-toc { display: block; }
}

/* ===== RESPONSIVE — mobile (<=768px) ===== */
@media (max-width: 768px) {
    .site-header nav { padding: 20px 24px; }
    .nav-links { display: none; }
    .nav-cta-mobile { display: block; }
    .hamburger { display: block; }

    .legal-template {
        display: block;
        padding: 20px 20px 0;
    }
    .legal-section-nav { display: none; }
    .mobile-legal-nav { display: block; margin-bottom: 20px; }

    .legal-page-header h1 { font-size: 1.8rem; }
    .plain-english-summary { padding: 16px 18px; }
    .district-reviewer-card { padding: 14px 16px; }

    .legal-body table { font-size: 0.82rem; }
    .legal-body th, .legal-body td { padding: 8px 10px; }

    .related-legal-links__list { gap: 6px; }
    .related-legal-links__list a { font-size: 0.78rem; padding: 5px 12px; }

    footer { padding: 32px 24px 24px; }
    .footer-columns { grid-template-columns: 1fr; gap: 28px; }
}

/* ===== Focus states ===== */
.legal-section-nav__link:focus-visible,
.page-toc__link:focus-visible,
.mobile-legal-nav__toggle:focus-visible,
.mobile-page-toc__toggle:focus-visible,
.mobile-legal-nav__dropdown a:focus-visible,
.mobile-page-toc__panel a:focus-visible,
.related-legal-links__list a:focus-visible,
.legal-page-header__print:focus-visible {
    outline: 2px solid var(--amber);
    outline-offset: 2px;
}
