/* Long-form legal pages: vilkar.php and personvern.php (fc_legal_page_html(), includes/legal_page.php).
   Tokens only (css/fc-tokens.css), so dark mode follows html.dark-mode. */

.fc-legal-card .card-body {
    padding: var(--space-2xl);
}

.fc-legal {
    max-width: 44rem;
    margin: 0 auto;
    color: var(--text);
    font-family: var(--font-system);
    font-size: 1rem;
    line-height: 1.65;
    overflow-wrap: break-word;
}

.fc-legal h2 {
    font: var(--type-section);
    color: var(--heading);
    margin: var(--space-2xl) 0 var(--space-md);
    scroll-margin-top: 88px;
}

.fc-legal section:first-of-type h2 {
    margin-top: 0;
}

.fc-legal h3 {
    font: var(--type-heading);
    color: var(--heading);
    margin: var(--space-xl) 0 var(--space-xs);
}

.fc-legal p,
.fc-legal ul {
    margin: 0 0 var(--space-md);
}

.fc-legal ul {
    padding-left: 1.25rem;
}

.fc-legal li {
    margin-bottom: var(--space-sm);
}

.fc-legal li::marker {
    color: var(--text-secondary);
}

.fc-legal a {
    color: var(--primary);
    overflow-wrap: anywhere;
}

/* Contents */
.fc-legal-toc {
    background: var(--surface-variant);
    border-radius: var(--radius-md);
    padding: var(--space-base) var(--space-lg);
    margin-bottom: var(--space-2xl);
}

.fc-legal .fc-legal-toc-title {
    font: var(--type-overline);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
}

.fc-legal-toc ul {
    list-style: none;
    padding: 0;
    margin: 0;
    columns: 2;
    column-gap: var(--space-2xl);
}

.fc-legal-toc li {
    margin: 0 0 var(--space-xs);
    break-inside: avoid;
}

.fc-legal-toc a {
    text-decoration: none;
}

.fc-legal-toc a:hover,
.fc-legal-toc a:focus-visible {
    text-decoration: underline;
}

/* Tables (legal basis, processors) */
.fc-legal-table-wrap {
    margin: 0 0 var(--space-base);
}

.fc-legal-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9375rem;
    line-height: 1.5;
}

.fc-legal-table th,
.fc-legal-table td {
    text-align: left;
    vertical-align: top;
    padding: var(--space-sm) var(--space-md);
    border-bottom: var(--border-hairline) solid var(--border);
}

.fc-legal-table thead th {
    background: var(--surface-variant);
    color: var(--heading);
    font-weight: 600;
}

.fc-legal .fc-legal-related {
    margin-top: var(--space-2xl);
    padding-top: var(--space-base);
    border-top: var(--border-hairline) solid var(--border);
    color: var(--text-secondary);
}

/* Phones: one column of contents, each table row a small card with its column names. */
@media (max-width: 575.98px) {
    .fc-legal-card .card-body {
        padding: var(--space-base);
    }

    .fc-legal-toc {
        padding: var(--space-md) var(--space-base);
    }

    .fc-legal-toc ul {
        columns: 1;
    }

    .fc-legal-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }

    .fc-legal-table,
    .fc-legal-table tbody,
    .fc-legal-table tr,
    .fc-legal-table td {
        display: block;
        width: 100%;
    }

    .fc-legal-table tr {
        border: var(--border-hairline) solid var(--border);
        border-radius: var(--radius-md);
        padding: var(--space-sm) var(--space-md);
        margin-bottom: var(--space-sm);
    }

    .fc-legal-table td {
        border: 0;
        padding: var(--space-xs) 0;
    }

    .fc-legal-table td::before {
        content: attr(data-label);
        display: block;
        font: var(--type-overline);
        color: var(--text-secondary);
    }
}
