/* Readable legal pages, using the shared ecolix colour and type system. */
.legal-page {
    padding-top: var(--site-header-height);
    font-family: var(--font-family-base);
    font-size: 1.09375rem;
    line-height: 1.75;
}

.legal-reading-width {
    width: min(70ch, calc(100% - 64px));
    margin-inline: auto;
    min-width: 0;
}

.legal-intro {
    padding-block: 48px 44px;
    background: linear-gradient(110deg, #e7f3f4 0%, #f0f8f3 100%);
    border-bottom: 1px solid #dceae8;
}

.legal-intro h1 {
    max-width: 24ch;
    margin: 0;
    color: #194c57;
    font-size: clamp(2rem, 4.2vw, 3.125rem);
    font-weight: 650;
    line-height: 1.15;
    letter-spacing: -.04em;
    text-wrap: balance;
    overflow-wrap: anywhere;
    hyphens: auto;
}

.legal-body {
    padding-block: 20px 64px;
}

.legal-index {
    margin-bottom: 32px;
    border-bottom: 1px solid var(--color-line, #dbe6e6);
    color: var(--color-text-main, #0c1f25);
    font-size: .9375rem;
    line-height: 1.5;
}

.legal-toc summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: 52px;
    padding-block: 12px;
    cursor: pointer;
    list-style: none;
    color: #245f6b;
    font-weight: 600;
}

.legal-toc summary::-webkit-details-marker {
    display: none;
}

.legal-toc summary::after {
    content: '';
    width: 8px;
    height: 8px;
    margin-right: 3px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg);
    flex: 0 0 auto;
}

.legal-toc[open] summary::after {
    transform: rotate(225deg);
}

.legal-toc summary:focus-visible,
.legal-toc a:focus-visible {
    outline: 3px solid var(--color-primary-end, #488995);
    outline-offset: 4px;
}

.legal-toc ol {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2px 28px;
    padding: 4px 0 20px;
    margin: 0;
    list-style: none;
}

.legal-toc li {
    min-width: 0;
}

.legal-toc a {
    display: block;
    padding-block: 8px;
    color: #344e56;
    text-decoration: underline;
    text-decoration-color: #bed0d3;
    text-underline-offset: 4px;
    overflow-wrap: anywhere;
    hyphens: auto;
}

.legal-toc a:hover {
    color: #245f6b;
    text-decoration-color: currentColor;
}

.legal-content {
    color: #34484e;
}

.legal-section + .legal-section {
    margin-top: 32px;
}

.legal-section h2 {
    margin: 0 0 12px;
    color: #163b45;
    font-size: clamp(1.25rem, 2vw, 1.5rem);
    font-weight: 650;
    line-height: 1.4;
    letter-spacing: -.02em;
    text-wrap: pretty;
    scroll-margin-top: 16px;
}

.legal-section h3 {
    margin: 24px 0 8px;
    color: #244d56;
    font-size: 1.125rem;
    font-weight: 650;
    line-height: 1.45;
    letter-spacing: -.01em;
}

.legal-content p {
    margin: 0 0 16px;
    color: inherit;
    line-height: inherit;
    overflow-wrap: anywhere;
}

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

.legal-content strong {
    color: #24444d;
    font-weight: 650;
}

.legal-content a {
    color: #236b78;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    overflow-wrap: anywhere;
}

.legal-content a:hover {
    color: #154956;
    text-decoration-thickness: 2px;
}

@media (max-width: 767px) {
    .legal-page {
        padding-top: var(--site-header-height);
        font-size: 1.03125rem;
        line-height: 1.7;
    }

    .legal-reading-width {
        width: min(70ch, calc(100% - 40px));
    }

    .legal-intro {
        padding-block: 32px;
    }

    .legal-intro h1 {
        font-size: clamp(1.875rem, 5.8vw, 2.5rem);
    }

    .legal-body {
        padding-block: 12px 44px;
    }

    .legal-index {
        margin-bottom: 26px;
    }

    .legal-toc ol {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
    }

    .legal-toc a {
        padding-block: 10px;
    }

    .legal-section + .legal-section {
        margin-top: 28px;
    }

    .legal-section h2 {
        scroll-margin-top: 12px;
    }
}

@media print {
    .legal-page {
        padding-top: 0;
        font-size: 11pt;
    }

    .legal-reading-width {
        width: 100%;
    }

    .legal-intro {
        padding-block: 0 20px;
        background: none;
    }

    .legal-index {
        display: none;
    }

    .legal-section h2,
    .legal-section h3 {
        break-after: avoid;
    }
}
