/* =============================================================================
   LEGAL (Terms / Privacy) — page-specific document layout
   =============================================================================
   Requires ax-system.css (loaded first): tokens, type scale, buttons, section
   shell, hero, header/footer, motion. This file styles ONLY the legal document
   body — the hero reuses the shared .ax-hero. Reveals use the shared
   [data-ax-fade] runtime (ax-system.js), so no reveal CSS lives here.

   A readable, editorial document: a quiet sticky table of contents beside
   numbered sections set at a comfortable reading measure.
   ============================================================================= */


/* HERO — single-line title + the preserved "Last updated" line. */
.lg-hero__title { font-size: clamp(40px, 7vw, 84px); }

.lg-hero__updated {
    font-family: var(--ax-font-body);
    font-size: clamp(13px, 1.1vw, 15px);
    color: var(--ax-text-3);
    margin: clamp(24px, 3vw, 32px) 0 0;
}
.lg-hero__updated strong { color: var(--ax-text-2); font-weight: 600; }


/* =============================================================================
   DOCUMENT BODY — sticky TOC (desktop) + numbered sections.
   ============================================================================= */
.lg-doc__shell {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: clamp(32px, 5vw, 80px);
    align-items: start;
    padding-top: clamp(48px, 6vw, 80px);
}

/* Table of contents — quiet, hairline, sticky on desktop. */
.lg-toc {
    position: sticky;
    top: calc(var(--ax-header-h) + 28px);
}

.lg-toc__title {
    font-family: var(--ax-font-head);
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ax-accent-soft);
    margin: 0 0 16px;
}

.lg-toc ol {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.lg-toc li + li { border-top: 1px solid var(--ax-border-2); }

.lg-toc a {
    display: grid;
    grid-template-columns: 24px 1fr;
    gap: 0 10px;
    align-items: baseline;
    padding: 11px 0;
    font-family: var(--ax-font-body);
    font-size: 14px;
    line-height: 1.4;
    color: var(--ax-text-2);
    text-decoration: none;
    transition: color 0.2s var(--ax-ease);
}
.lg-toc a:hover { color: var(--ax-accent); }

.lg-toc__num {
    font-family: var(--ax-font-head);
    font-weight: 500;
    font-size: 12px;
    color: var(--ax-text-3);
    font-variant-numeric: tabular-nums;
}
.lg-toc a:hover .lg-toc__num { color: var(--ax-accent-soft); }


/* The sections themselves. */
.lg-body { min-width: 0; }

.lg-section {
    scroll-margin-top: calc(var(--ax-header-h) + 24px);
    padding-bottom: clamp(32px, 4vw, 52px);
    margin-bottom: clamp(32px, 4vw, 52px);
    border-bottom: 1px solid var(--ax-border);
}
.lg-section:last-of-type { border-bottom: 0; }

.lg-section__title {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0 16px;
    align-items: baseline;
    font-family: var(--ax-font-head);
    font-weight: 600;
    font-size: clamp(22px, 2.6vw, 32px);
    line-height: 1.12;
    letter-spacing: -0.026em;
    color: var(--ax-text);
    margin: 0 0 20px;
    text-wrap: balance;
}

.lg-section__num {
    font-family: var(--ax-font-head);
    font-weight: 500;
    font-size: 14px;
    color: var(--ax-accent-soft);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
}

/* Document prose — a comfortable reading measure and rhythm. */
.lg-section__body {
    color: var(--ax-text-2);
    font-family: var(--ax-font-body);
    font-size: clamp(15px, 1.1vw, 16.5px);
    line-height: 1.78;
    max-width: var(--ax-read);
}
.lg-section__body p { margin: 0 0 16px; }
.lg-section__body p:last-child { margin-bottom: 0; }

.lg-section__body a {
    color: var(--ax-accent);
    font-weight: 500;
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-color: rgba(33, 49, 100, 0.35);
    word-break: break-word;
    transition: text-decoration-color 0.2s var(--ax-ease);
}
.lg-section__body a:hover { text-decoration-color: currentColor; }

.lg-section__body ul {
    list-style: none;
    margin: 0 0 16px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.lg-section__body ul:last-child { margin-bottom: 0; }

.lg-section__body li {
    position: relative;
    padding-left: 26px;
    line-height: 1.7;
}
/* A small navy tick instead of a bullet. */
.lg-section__body li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.7em;
    width: 14px;
    height: 1.5px;
    background: var(--ax-accent);
    border-radius: 1px;
}


/* Contact prompt — a quiet bordered block, not a glossy dark card. */
.lg-contact {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 18px 28px;
    margin-top: clamp(40px, 5vw, 64px);
    padding-top: clamp(32px, 4vw, 44px);
    border-top: 1px solid var(--ax-border);
}

.lg-contact__h {
    font-family: var(--ax-font-head);
    font-weight: 600;
    font-size: clamp(19px, 2vw, 25px);
    letter-spacing: -0.022em;
    color: var(--ax-text);
    margin: 0 0 8px;
    text-wrap: balance;
}
.lg-contact__p {
    font-family: var(--ax-font-body);
    font-size: clamp(14.5px, 1.2vw, 16px);
    line-height: 1.6;
    color: var(--ax-text-2);
    margin: 0;
    max-width: 52ch;
}
.lg-contact__btn { flex: 0 0 auto; }


/* =============================================================================
   RESPONSIVE
   ============================================================================= */
@media (max-width: 980px) {
    .lg-doc__shell { grid-template-columns: 1fr; gap: 32px; }
    /* TOC moves above the body and unsticks; lay it out in two columns. */
    .lg-toc { position: static; order: -1; }
    .lg-toc ol { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; }
    .lg-toc li + li { border-top: none; }
    .lg-toc li:nth-child(n+3) { border-top: 1px solid var(--ax-border-2); }
}

@media (max-width: 640px) {
    .lg-toc ol { grid-template-columns: 1fr; }
    .lg-toc li:nth-child(n+2) { border-top: 1px solid var(--ax-border-2); }
    .lg-contact { flex-direction: column; align-items: flex-start; }
}
