/* Legal Pages (privacy.php, terms.php, cookies.php) */
.c-legal {
    width: 100%;
    max-width: 820px;
    margin: 0 auto;
    padding: 2rem 1rem 4rem;
}

/* Hero Section */
.c-legal__hero {
    text-align: center;
    padding: 3rem 1rem 2rem;
    margin-bottom: 2rem;
}

.c-legal__title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    color: var(--color-text-primary);
}

.c-legal__updated {
    color: var(--color-text-secondary);
    font-size: 0.9rem;
    margin: 0;
}

/* Table of contents */
.c-legal__toc {
    background: var(--color-surface, rgba(255, 255, 255, 0.04));
    border: 1px solid var(--color-border, rgba(255, 255, 255, 0.08));
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 2.5rem;
}

.c-legal__toc-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-text-primary);
    margin: 0 0 0.75rem;
}

.c-legal__toc ol {
    margin: 0;
    padding-left: 1.25rem;
    columns: 2;
    column-gap: 2rem;
}

.c-legal__toc li {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    margin-bottom: 0.35rem;
    break-inside: avoid;
}

.c-legal__toc a {
    color: var(--color-text-secondary);
    text-decoration: none;
    transition: color 0.15s ease;
}

/* Contents links read as a list, not as a wall of underlined text. The colour
   change on hover carries the affordance, so no underline is added. */
.c-legal__toc a:hover,
.c-legal__toc a:focus-visible {
    color: var(--color-primary-hover);
    text-decoration: none;
}

/* Body copy */
.c-legal__body {
    color: var(--color-text-primary);
    font-size: 1rem;
    line-height: 1.75;
}

.c-legal__lead {
    font-size: 1.05rem;
    color: var(--color-text-primary);
    background: rgba(255, 255, 255, 0.03);
    border-left: 3px solid var(--color-primary);
    border-radius: 0 12px 12px 0;
    padding: 1.1rem 1.25rem;
    margin-bottom: 2rem;
}

.c-legal__body h2 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--color-text-primary);
    margin: 2.5rem 0 0.85rem;
    padding-top: 0.5rem;
    scroll-margin-top: 5rem;
}

.c-legal__body h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--color-text-primary);
    margin: 1.75rem 0 0.6rem;
    scroll-margin-top: 5rem;
}

.c-legal__body p {
    margin: 0 0 1rem;
}

.c-legal__body ul {
    margin: 0 0 1.25rem;
    padding-left: 1.4rem;
}

.c-legal__body li {
    margin-bottom: 0.5rem;
}

.c-legal__body strong {
    color: var(--color-text-primary);
    font-weight: 700;
}

/* Inline links in the policy text are distinguished by colour rather than an
   underline, which keeps long blocks of legal copy readable. Hover shifts the
   colour instead of adding a line -- see --color-primary-hover for why the tint
   goes lighter rather than darker on this theme. */
.c-legal__body a {
    color: var(--color-primary);
    text-decoration: none;
    word-break: break-word;
    transition: color 0.15s ease;
}

.c-legal__body a:hover,
.c-legal__body a:focus-visible {
    color: var(--color-primary-hover);
    text-decoration: none;
}

.c-legal__body code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.85em;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    padding: 0.15rem 0.4rem;
    word-break: break-all;
}

/* Contact block */
.c-legal__contact {
    list-style: none;
    padding: 1.25rem 1.5rem !important;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--color-border, rgba(255, 255, 255, 0.08));
    border-radius: 14px;
}

.c-legal__contact li {
    margin-bottom: 0.35rem;
}

/* Cookie / data tables */
.c-legal__table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1.5rem;
    border: 1px solid var(--color-border, rgba(255, 255, 255, 0.08));
    border-radius: 14px;
}

.c-legal__table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    min-width: 560px;
}

.c-legal__table th,
.c-legal__table td {
    text-align: left;
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--color-border, rgba(255, 255, 255, 0.08));
    vertical-align: top;
}

.c-legal__table th {
    font-weight: 700;
    color: var(--color-text-primary);
    background: rgba(255, 255, 255, 0.05);
    white-space: nowrap;
}

.c-legal__table tr:last-child td {
    border-bottom: none;
}

.c-legal__table td {
    color: var(--color-text-secondary);
}

/* Tablet */
@media (max-width: 900px) {
    .c-legal__toc ol {
        columns: 1;
    }
}

/* Phone */
@media (max-width: 600px) {
    .c-legal {
        padding: 1rem 0.9rem 3rem;
    }

    .c-legal__hero {
        padding: 2rem 0.5rem 1.5rem;
    }

    .c-legal__title {
        font-size: 1.9rem;
    }

    .c-legal__toc {
        padding: 1.1rem 1.25rem;
    }

    .c-legal__body {
        font-size: 0.95rem;
        line-height: 1.7;
    }

    .c-legal__body h2 {
        font-size: 1.2rem;
        margin-top: 2rem;
    }

    .c-legal__body h3 {
        font-size: 1rem;
    }

    .c-legal__lead {
        font-size: 1rem;
        padding: 1rem;
    }

    /* Stack the cookie table: the header row is hidden and each cell is
       labelled from its data-label, so the min-width can be dropped. */
    .c-legal__table-wrap {
        border: none;
        border-radius: 0;
    }

    .c-legal__table {
        min-width: 0;
    }

    .c-legal__table thead {
        display: none;
    }

    .c-legal__table,
    .c-legal__table tbody,
    .c-legal__table tr,
    .c-legal__table td {
        display: block;
        width: 100%;
    }

    .c-legal__table tr {
        border: 1px solid var(--color-border, rgba(255, 255, 255, 0.08));
        border-radius: 12px;
        margin-bottom: 0.85rem;
        padding: 0.25rem 0;
    }

    .c-legal__table td {
        border-bottom: none;
        padding: 0.6rem 1rem;
    }

    .c-legal__table td::before {
        content: attr(data-label);
        display: block;
        font-size: 0.7rem;
        font-weight: 700;
        letter-spacing: 0.06em;
        text-transform: uppercase;
        color: var(--color-text-muted, var(--color-text-secondary));
        margin-bottom: 0.15rem;
    }
}
