/* ── Legal (Privacy, Terms, Cookies) ────────────────────────
   Not designed: the contents down the left in a grey card that
   stays in view, the policy beside it in the site's body type.
   ─────────────────────────────────────────────────────────── */

.legal {
    padding: var(--pad-y) var(--pad-x);
}

.legal__inner {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    align-items: start;
    gap: 80px;
    max-width: var(--site-max-w);
    margin: 0 auto;
}

/* No contents (one heading or none): the words alone */
.legal__inner:not(:has(.legal__contents)) {
    grid-template-columns: minmax(0, 1fr);
}

/* The contents: stays in view as the policy scrolls */
.legal__contents {
    position: sticky;
    top: calc(var(--header-offset, 0px) + 24px);
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 24px;
    border-radius: 10px;
    background: var(--color-grey-light);
}

.legal__contents-title {
    font-size: 18px;
    font-weight: 600;
    line-height: 24px;
}

.legal__list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: legal;
}

.legal__list li {
    display: flex;
    gap: 8px;
    counter-increment: legal;
    font-size: 15px;
    line-height: 1.4;
}

.legal__list li::before {
    content: counter(legal) ".";
    flex: 0 0 22px;
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--color-primary);
}

.legal__link {
    color: var(--color-text);
    transition: color var(--transition);
}

.legal__link:hover {
    color: var(--color-primary);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.legal__main {
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-width: 0;
    max-width: 860px;
}

.legal__updated {
    margin: 0;
    font-family: var(--font-meta);
    font-size: 14px;
    color: var(--color-text-muted);
}

/* The policy */
.legal__body {
    display: flex;
    flex-direction: column;
    gap: 16px;
    font-size: 16px;
    line-height: 1.65;
    color: var(--color-text);
}

.legal__body > * {
    margin: 0;
}

.legal__body h2 {
    margin-top: 24px;
    font-size: 28px;
    font-weight: 600;
    line-height: 1.2;
}

.legal__body h3 {
    margin-top: 8px;
    font-size: 20px;
    font-weight: 600;
    line-height: 1.3;
}

.legal__body > :first-child {
    margin-top: 0;
}

.legal__body strong {
    font-weight: 600;
}

.legal__body a {
    color: var(--color-primary);
    text-decoration: underline;
    text-underline-offset: 3px;
    overflow-wrap: anywhere;
}

.legal__body a:hover {
    color: var(--color-primary-hover);
}

.legal__body ul,
.legal__body ol {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-left: 22px;
}

.legal__body ul {
    list-style: disc;
}

.legal__body ol {
    list-style: decimal;
}

/* Tables: the tools we use, and Complianz's list of cookies */
.legal__body table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
    line-height: 1.5;
}

.legal__body th,
.legal__body td {
    padding: 12px 16px 12px 0;
    border-bottom: 1px solid var(--color-border);
    text-align: left;
    vertical-align: top;
}

.legal__body th {
    font-family: var(--font-heading);
    font-weight: 600;
}

/* Complianz's cookie list: each service opens to its cookies */
.legal__body details {
    border-bottom: 1px solid var(--color-border);
}

.legal__body summary {
    padding: 14px 0;
    cursor: pointer;
    font-family: var(--font-heading);
    font-weight: 600;
}


/* Tablet and mobile — 1024px and below: one column, the contents first */
@media (max-width: 1024px) {
    .legal__inner {
        grid-template-columns: minmax(0, 1fr);
        gap: 40px;
    }

    .legal__contents {
        position: static;
    }

    .legal__body h2 {
        font-size: 24px;
    }

    /* Wide tables scroll sideways rather than the page */
    .legal__body table {
        display: block;
        overflow-x: auto;
    }
}

@media (max-width: 767px) {
    .legal__body {
        font-size: 15px;
    }

    .legal__body h2 {
        font-size: 22px;
    }
}
