/* ============================================================
   Legal pages (Privacy, Terms) — shared layout & typography.
   Designed to match the rest of the site: soft gradient hero,
   white card with rounded corners, restful spacing.
   ============================================================ */

.legal-shell {
    padding: 56px 0 80px;
}

.legal-container {
    max-width: 820px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Hero header on top of every legal page. Same vocabulary as the
   home hero so the reader feels they haven't left the site. */
.legal-hero {
    background: linear-gradient(135deg, rgba(124, 121, 184, 0.10), rgba(124, 121, 184, 0.03));
    border: 1px solid rgba(124, 121, 184, 0.15);
    border-radius: 28px;
    padding: 36px 32px;
    box-shadow: 0 12px 30px rgba(34, 42, 70, 0.06);
    margin-bottom: 28px;
}

.legal-kicker {
    display: inline-flex;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--accent);
    color: var(--primary-dark);
    font-weight: 800;
    font-size: 0.78rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 14px;
}

.legal-title {
    margin: 0 0 8px;
    font-size: clamp(2rem, 4vw, 2.6rem);
    letter-spacing: -0.02em;
    line-height: 1.1;
    color: var(--text);
}

.legal-meta {
    margin: 0;
    color: var(--muted);
    font-size: 0.95rem;
}

/* The main body sits on a white card so the long-form text has
   a comfortable reading width and the headers separate clearly. */
.legal-body {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 32px 36px;
    box-shadow: 0 8px 24px rgba(34, 42, 70, 0.04);
}

.legal-body section {
    padding-top: 28px;
    margin-top: 28px;
    border-top: 1px solid rgba(124, 121, 184, 0.10);
}

.legal-body section:first-child {
    padding-top: 0;
    margin-top: 0;
    border-top: none;
}

.legal-body h2 {
    margin: 0 0 12px;
    font-size: 1.3rem;
    color: var(--text);
    letter-spacing: -0.01em;
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.legal-body h2 .legal-number {
    color: var(--primary);
    font-weight: 800;
    font-size: 0.95rem;
    letter-spacing: 0.04em;
}

.legal-body p,
.legal-body li {
    color: var(--text);
    line-height: 1.7;
    font-size: 0.98rem;
}

.legal-body p {
    margin: 0 0 12px;
}

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

.legal-body ul {
    margin: 0 0 12px;
    padding-left: 1.1rem;
}

.legal-body li {
    margin-bottom: 8px;
}

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

.legal-body a {
    color: var(--primary-dark);
    font-weight: 700;
    border-bottom: 1px solid transparent;
    transition: border-color 0.18s ease;
}

.legal-body a:hover {
    border-bottom-color: var(--primary-dark);
}

/* Contact block at the foot of each policy. Stand-alone card so the
   reader can immediately see how to reach us. */
.legal-contact {
    margin-top: 24px;
    padding: 20px 24px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(124, 121, 184, 0.08), rgba(124, 121, 184, 0.02));
    border: 1px solid rgba(124, 121, 184, 0.16);
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.legal-contact-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    display: grid;
    place-items: center;
    color: var(--primary);
    flex-shrink: 0;
}

.legal-contact-text {
    flex: 1;
    min-width: 200px;
}

.legal-contact-text strong {
    display: block;
    color: var(--text);
    margin-bottom: 2px;
}

.legal-contact-text a {
    color: var(--primary-dark);
    font-weight: 700;
}

@media (max-width: 640px) {
    .legal-shell {
        padding: 32px 0 56px;
    }
    .legal-hero {
        padding: 24px 22px;
        border-radius: 22px;
    }
    .legal-body {
        padding: 24px 22px;
        border-radius: 18px;
    }
}

/* === RGPD additions: purposes table + "to complete" placeholders ======= */
.legal-table-wrap {
    overflow-x: auto;
    margin: 6px 0 4px;
    border-radius: 14px;
    border: 1px solid var(--border);
}
.legal-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
    min-width: 520px;
}
.legal-table th,
.legal-table td {
    text-align: left;
    padding: 11px 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
    line-height: 1.5;
}
.legal-table thead th {
    background: rgba(124, 121, 184, 0.10);
    color: var(--primary-dark);
    font-weight: 800;
    white-space: nowrap;
}
.legal-table tbody tr:last-child td { border-bottom: 0; }
.legal-table tbody tr:nth-child(even) td { background: rgba(124, 121, 184, 0.035); }
.legal-table td:last-child { white-space: nowrap; font-weight: 600; color: var(--primary-dark); }

/* Phones: a 3-column table at 390px forced a 520px horizontal scroll inside an
   otherwise clean page. Each row becomes a card and each cell a label/value
   pair, using the header text carried on the cells as data-label. */
@media (max-width: 760px) {
    .legal-table-wrap {
        overflow-x: visible;
        border: 0;
        border-radius: 0;
    }

    .legal-table {
        min-width: 0;
        display: block;
    }

    .legal-table thead {
        /* Column headers live on each cell down here. */
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }

    .legal-table tbody,
    .legal-table tr,
    .legal-table td {
        display: block;
        width: auto;
    }

    .legal-table tbody tr {
        margin-bottom: 12px;
        border: 1px solid var(--border);
        border-radius: 14px;
        overflow: hidden;
    }

    .legal-table tbody tr:last-child { margin-bottom: 0; }

    .legal-table tbody tr:nth-child(even) td { background: transparent; }

    .legal-table td {
        padding: 10px 14px;
        border-bottom: 1px solid var(--border);
    }

    .legal-table tr td:last-child {
        border-bottom: 0;
        white-space: normal;   /* the "legal basis" column can wrap now */
    }

    .legal-table td::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 3px;
        font-size: 0.7rem;
        font-weight: 800;
        letter-spacing: 0.06em;
        text-transform: uppercase;
        color: var(--muted);
    }
}

/* Amber marker for values the association must fill in before publishing. */
.legal-todo {
    background: #fff3d6;
    color: #8a5418;
    border: 1px dashed #e0b15e;
    border-radius: 6px;
    padding: 0 6px;
    font-size: 0.92em;
    font-weight: 600;
    white-space: nowrap;
}

@media (max-width: 560px) {
    .legal-table td:last-child { white-space: normal; }
    .legal-todo { white-space: normal; }
}
