/* ============================================
   LEGAL PAGES
   One reading column for the Lenhac and SISU OPUS policies.
   Tokens come from main.css.
   ============================================ */

.legal-page {
    background: var(--paper);
    padding: clamp(48px, 7vw, 96px) 0 var(--section-y);
}

/* A reading column sized to the text block: paragraphs wrap at 56ch, list rows add their indent. */
.legal-page .container {
    max-width: calc(56ch + 32px + 2 * var(--container-padding));
}

/* ============================================
   HEAD
   ============================================ */

.legal-header {
    margin-bottom: 48px;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--line);
}

.legal-kicker {
    margin: 0 0 16px;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--forest);
}

.legal-header h1 {
    margin: 0 0 16px;
}

.legal-header .subtitle {
    font-size: 1.125rem;
    line-height: 1.6;
    color: var(--ink-3);
    max-width: 56ch;
    margin: 0 0 16px;
}

.last-updated,
.policy-jurisdiction {
    margin: 0;
    font-size: 0.9375rem;
    color: var(--ink-4);
}

.last-updated span {
    color: inherit;
    font-weight: inherit;
}

.policy-jurisdiction {
    margin-top: 4px;
}

/* ============================================
   SECTIONS
   ============================================ */

.legal-section {
    margin: 0 0 56px;
    padding: 0;
    background: none;
    border: 0;
}

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

.legal-section h2 {
    font-size: clamp(1.75rem, 2.6vw, 2rem);
    letter-spacing: -0.02em;
    line-height: 1.15;
    margin: 0 0 20px;
}

.legal-section h2 .section-number {
    display: inline-block;
    min-width: 1.3em;
    color: var(--forest);
}

.legal-section h3 {
    font-size: 1.125rem;
    font-weight: 600;
    letter-spacing: -0.005em;
    line-height: 1.35;
    margin: 32px 0 12px;
}

.legal-section h4 {
    font-size: 1rem;
    font-weight: 600;
    margin: 20px 0 8px;
}

.legal-section p {
    font-size: 1.0625rem;
    line-height: 1.65;
    color: var(--ink-2);
    max-width: 56ch;
    margin: 0 0 16px;
}

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

.legal-section strong {
    color: var(--ink);
    font-weight: 600;
}

.legal-section em {
    color: var(--ink-3);
}

.legal-section a,
.back-link a {
    color: var(--ink);
    text-decoration: underline;
    text-decoration-color: var(--line-strong);
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
    transition: color var(--transition-fast), text-decoration-color var(--transition-fast);
}

.legal-section a:hover,
.back-link a:hover {
    color: var(--forest);
    text-decoration-color: var(--forest);
}

/* Lists as hairline rows */
.legal-section ul,
.legal-section ol {
    list-style: none;
    margin: 4px 0 20px;
    padding: 0;
    border-top: 1px solid var(--line);
}

.legal-section li {
    position: relative;
    padding: 12px 0 12px 24px;
    border-bottom: 1px solid var(--line);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--ink-2);
}

.legal-section ul li::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 22px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--forest);
}

.legal-section ol {
    counter-reset: legal;
}

.legal-section ol li {
    counter-increment: legal;
    padding-left: 32px;
}

.legal-section ol li::before {
    content: counter(legal) ".";
    position: absolute;
    left: 0;
    top: 12px;
    font-weight: 600;
    color: var(--forest);
}

/* Notes and panels */
.highlight-box {
    margin: 20px 0;
    padding: 4px 0 4px 20px;
    border-left: 2px solid var(--line-strong);
}

.highlight-box p {
    color: var(--ink-3);
    margin: 0;
}

.scope-box {
    margin: 24px 0;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--paper);
}

.scope-box h3,
.scope-box h4 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 12px;
    font-size: 1.0625rem;
    font-weight: 600;
}

.scope-box h3 i,
.scope-box h4 i {
    font-size: 1rem;
    color: var(--forest);
}

.scope-box p {
    font-size: 1rem;
    margin-bottom: 12px;
}

.scope-box ul {
    margin: 4px 0 16px;
}

.scope-box > :last-child {
    margin-bottom: 0;
}

.scope-name {
    color: var(--ink-3);
}

.legal-section code {
    font-family: inherit;
    font-size: 0.9375rem;
    padding: 1px 7px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--mist);
    color: var(--ink);
}

/* Contact */
.contact-card,
.contact-info {
    margin-top: 20px;
    padding: 20px 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
}

.contact-card p,
.contact-info p {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
    margin: 0 0 8px;
    font-size: 1rem;
}

.contact-card p:last-child,
.contact-info p:last-child {
    margin-bottom: 0;
}

.contact-card .label {
    min-width: 80px;
    color: var(--ink-4);
}

.contact-info p:first-child {
    font-size: 1.0625rem;
    margin-bottom: 12px;
}

/* Back links */
.back-link {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 28px;
    margin-top: 56px;
    padding-top: 28px;
    border-top: 1px solid var(--line);
    font-size: 1rem;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .legal-header {
        margin-bottom: 36px;
        padding-bottom: 24px;
    }

    .legal-section {
        margin-bottom: 44px;
    }

    .scope-box {
        padding: 20px;
    }

    .contact-card p {
        flex-direction: column;
        gap: 2px;
    }
}
