/* ==========================================================================
   Legal page (2026) — page-templates/legal.php
   Built on sx-system.css tokens. Hero + document switcher + sticky TOC + prose.
   ========================================================================== */

.sxl { background: #fff; color: var(--sx-ink); font-family: var(--sx-font-body); }

/* ── Hero ────────────────────────────────────────────────────────────────── */

.sxl-hero { position: relative; isolation: isolate; padding: clamp(44px, 6vw, 84px) 0 clamp(28px, 3vw, 40px); border-bottom: 1px solid var(--sx-line); background: var(--sx-canvas); }
.sxl-hero__inner { display: flex; flex-direction: column; align-items: center; text-align: center; }
.sxl-hero__title { max-width: 18ch; margin: 12px 0 0; font-size: clamp(40px, 6vw, 76px); line-height: 1.02; }
.sxl-hero__meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 10px; margin: 18px 0 0; color: var(--sx-muted); font-size: 15px; }
.sxl-hero__meta time { color: var(--sx-ink); font-weight: 600; }

/* Document switcher (pills) */
.sxl-docs { margin-top: clamp(28px, 4vw, 44px); }
.sxl-docs__list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin: 0 auto;
    padding: 8px;
    width: fit-content;
    max-width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--sx-line);
    border-radius: 32px;
    background: #fff;
    list-style: none;
}
.sxl-docs__list li { margin: 0; }
.sxl-docs__link {
    display: block;
    padding: 10px 18px;
    border-radius: 999px;
    color: var(--sx-muted) !important;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    text-decoration: none !important;
    transition: background-color .2s ease, color .2s ease;
}
.sxl-docs__link:hover { background: var(--sx-soft); color: var(--sx-ink) !important; }
.sxl-docs__link[aria-current="page"] { background: var(--sx-brand-deep); color: #fff !important; }

/* ── Body: sticky TOC + document ─────────────────────────────────────────── */

.sxl-body { padding: clamp(36px, 5vw, 72px) 0 clamp(56px, 7vw, 104px); }
.sxl-layout { display: grid; grid-template-columns: 270px minmax(0, 760px); justify-content: center; gap: clamp(32px, 5vw, 80px); align-items: start; }
.sxl-layout--single { grid-template-columns: minmax(0, 760px); }
.sxl-side { align-self: stretch; } /* full row height, so the TOC inside can stick */

.sxl-toc {
    position: sticky;
    top: calc(var(--sx-bar-h) + 24px);
    max-height: calc(100vh - var(--sx-bar-h) - 48px);
    overflow-y: auto;
    padding: 4px 0;
    scrollbar-width: thin;
}
.sxl-toc__title,
.sxl-summary__title { margin: 0 0 12px; color: var(--sx-muted); font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.sxl-toc ol,
.sxl-toc-m ol { margin: 0; padding: 0; list-style: none; }
.sxl-toc li,
.sxl-toc-m li { margin: 0; }
.sxl-toc a {
    display: block;
    padding: 7px 0 7px 16px;
    border-left: 2px solid var(--sx-line);
    color: var(--sx-muted) !important;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    text-decoration: none !important;
    transition: border-color .2s ease, color .2s ease;
}
.sxl-toc a:hover { color: var(--sx-ink) !important; }
.sxl-toc a.is-active { border-left-color: var(--sx-brand); color: var(--sx-brand-deep) !important; font-weight: 700; }

/* Mobile TOC */
.sxl-toc-m { display: none; margin: 0 0 28px; border: 1px solid var(--sx-line); border-radius: 18px; background: var(--sx-canvas); }
.sxl-toc-m summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; cursor: pointer; font-weight: 700; list-style: none; }
.sxl-toc-m summary::-webkit-details-marker { display: none; }
.sxl-toc-m summary::after { content: ''; width: 9px; height: 9px; margin-left: auto; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-3px) rotate(45deg); transition: transform .2s ease; }
.sxl-toc-m[open] summary::after { transform: translateY(2px) rotate(-135deg); }
.sxl-toc-m__count { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 12px; background: var(--sx-tint); color: var(--sx-brand-deep); font-size: 12px; }
.sxl-toc-m ol { padding: 0 18px 14px; }
.sxl-toc-m a { display: block; padding: 9px 0; border-top: 1px solid var(--sx-line); color: var(--sx-ink) !important; font-size: 15px; text-decoration: none !important; }

/* Summary box (optional field) */
.sxl-summary { margin: 0 0 36px; padding: 22px 24px; border-radius: 18px; background: var(--sx-tint); }
.sxl-summary p:last-child { margin: 0; line-height: 1.65; }

/* ── Document typography ─────────────────────────────────────────────────── */

.sxl-prose { color: #3a3d48; font-size: 16.5px; line-height: 1.72; overflow-wrap: break-word; }
.sxl-prose > *:first-child { margin-top: 0; }
.sxl-prose p { margin: 0 0 16px; }
.sxl-prose a { color: var(--sx-brand); font-weight: 600; text-decoration: underline; text-decoration-color: rgba(101, 88, 153, .35); text-underline-offset: 3px; }
.sxl-prose a:hover { text-decoration-color: currentColor; }
.sxl-prose strong, .sxl-prose b { color: var(--sx-ink); }

/* Explicit font on every heading: the theme's global rule gives h2–h4 Anton,
   which renders as a smeared faux-bold at weight 700. */
.sxl .sxl-prose h2 {
    scroll-margin-top: calc(var(--sx-bar-h) + 24px);
    margin: 48px 0 16px;
    padding-top: 40px;
    border-top: 1px solid var(--sx-line);
    font-family: var(--sx-font-body);
    font-size: clamp(23px, 2.4vw, 28px);
    font-weight: 800;
    letter-spacing: -.01em;
    line-height: 1.2;
    text-transform: none;
    color: var(--sx-ink);
}
.sxl .sxl-prose > h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.sxl .sxl-prose h3 { scroll-margin-top: calc(var(--sx-bar-h) + 24px); margin: 32px 0 12px; font-family: var(--sx-font-body); font-size: 19px; font-weight: 700; letter-spacing: 0; line-height: 1.35; text-transform: none; color: var(--sx-ink); }
.sxl .sxl-prose h4 { margin: 26px 0 10px; font-family: var(--sx-font-body); font-size: 17px; font-weight: 700; letter-spacing: 0; text-transform: none; color: var(--sx-ink); }

.sxl-prose ul { margin: 0 0 18px; padding: 0; list-style: none; }
.sxl-prose ul li { position: relative; margin: 0 0 9px; padding-left: 22px; }
.sxl-prose ul li::before { content: ''; position: absolute; top: .68em; left: 4px; width: 6px; height: 6px; border-radius: 50%; background: var(--sx-brand); }
.sxl-prose ol { margin: 0 0 18px; padding-left: 24px; }
.sxl-prose ol li { margin: 0 0 9px; padding-left: 4px; }
.sxl-prose ol li::marker { color: var(--sx-brand); font-weight: 700; }
.sxl-prose li > ul, .sxl-prose li > ol { margin: 9px 0 0; }

.sxl-prose img { max-width: 100%; height: auto; border-radius: 14px; }
.sxl-prose figure { margin: 24px 0; }
.sxl-prose figcaption { margin-top: 8px; color: var(--sx-muted); font-size: 14px; text-align: center; }
.sxl-prose hr, .sxl-prose .wp-block-separator { margin: 32px 0; border: 0; border-top: 1px solid var(--sx-line); }
.sxl-prose .wp-block-columns { gap: 20px; margin: 0 0 18px; }

.sxl-table { margin: 24px 0; overflow-x: auto; border: 1px solid var(--sx-line); border-radius: 16px; }
.sxl-prose table { width: 100% !important; height: auto !important; min-width: 520px; margin: 0; border-collapse: collapse; font-size: 15px; line-height: 1.5; }
.sxl-prose th, .sxl-prose td { height: auto !important; padding: 12px 14px; border: 0; border-bottom: 1px solid var(--sx-line); text-align: left; vertical-align: top; }
.sxl-prose th, .sxl-prose thead td { background: var(--sx-canvas); color: var(--sx-ink); font-weight: 700; }
.sxl-prose tr:last-child td { border-bottom: 0; }
.sxl-prose .wp-block-table { margin: 0; }
.sxl-prose .wp-block-table figcaption { margin: 0; padding: 10px 14px; }

/* Contact note */
.sxl-note { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 56px; padding: 24px 26px; border: 1px solid var(--sx-line); border-radius: 20px; background: var(--sx-canvas); }
.sxl-note p { margin: 0; }
.sxl-note__title { color: var(--sx-ink); font-size: 17px; font-weight: 700; }
.sxl-note__text { margin-top: 4px !important; color: var(--sx-muted); font-size: 15px; }
.sxl-note__text a { color: var(--sx-brand) !important; font-weight: 600; }
.sxl-note .sx-btn { flex: 0 0 auto; }

/* Reading progress dock (built by legal-2026.js) */
.sxl-dock {
    position: fixed;
    left: 50%;
    bottom: 16px;
    z-index: 40;
    display: flex;
    align-items: center;
    width: min(560px, calc(100% - 32px));
    box-sizing: border-box;
    padding: 14px 18px;
    border: 1px solid var(--sx-line);
    border-radius: 18px;
    background: rgba(255, 255, 255, .92);
    box-shadow: 0 10px 30px rgba(35, 28, 80, .1);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 16px);
    transition: opacity .3s var(--sx-ease), transform .3s var(--sx-ease);
}
.sxl-dock.is-on { opacity: 1; pointer-events: auto; transform: translate(-50%, 0); }
.sxl-dock__track { position: relative; flex: 1; height: 2px; border-radius: 2px; background: var(--sx-line); }
.sxl-dock__fill { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 2px; background: var(--sx-brand); }
.sxl-dock__dot {
    position: absolute;
    top: 50%;
    width: 18px;
    height: 18px;
    margin: -9px 0 0 -9px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
}
.sxl-dock__dot::before { content: ''; position: absolute; inset: 5px; border-radius: 50%; background: #d6d9e6; transition: background-color .2s ease, transform .2s ease; }
.sxl-dock__dot.is-done::before { background: var(--sx-brand); }
.sxl-dock__dot:hover::before, .sxl-dock__dot:focus-visible::before { transform: scale(1.5); }

/* ── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 1023px) {
    .sxl-layout { grid-template-columns: minmax(0, 760px); }
    .sxl-side { display: none; }
    .sxl-toc-m { display: block; }
}

@media (max-width: 767px) {
    /* Switcher: one scrollable row instead of a wrapped cloud. */
    .sxl-docs { padding-inline: 0; }
    .sxl-docs__list { flex-wrap: nowrap; justify-content: flex-start; width: auto; margin: 0; padding: 6px var(--sx-gutter); overflow-x: auto; border: 0; border-radius: 0; background: transparent; scrollbar-width: none; scroll-padding-inline: var(--sx-gutter); }
    .sxl-docs__list::-webkit-scrollbar { display: none; }
    .sxl-docs__link { padding: 9px 15px; border: 1px solid var(--sx-line); background: #fff; font-size: 14px; }
    .sxl-docs__link[aria-current="page"] { border-color: var(--sx-brand-deep); }
    .sxl-prose { font-size: 16px; }
    .sxl-note { flex-direction: column; align-items: flex-start; padding: 20px; }
    .sxl-dock { bottom: 10px; padding: 12px 14px; }
}

@media (prefers-reduced-motion: reduce) {
    .sxl *, .sxl-dock { transition: none !important; }
}

@media print {
    .site-header, .sx-header, .sx-footer, .sx-prefoot, .sxl-docs, .sxl-side, .sxl-toc-m, .sxl-note, .sxl-dock, .sx-frame { display: none !important; }
    .sxl-hero { padding: 0 0 16px; background: none; }
    .sxl-layout { display: block; }
    .sxl-prose { color: #000; font-size: 11pt; }
    .sxl .sxl-prose h2 { break-after: avoid; }
}
