/* AI-design footer. Colors from the design tokens (1-settings/_tokens.scss); on-dark text levels meet WCAG AA. */
.ce-footer {
    background-color: var(--pap-color-surface-dark);
    color: var(--pap-color-on-dark);
    font-size: 16px;

    @media (min-width: 768px) {
        padding-block: 2em;
    }

    @media (min-width: 992px) {
        padding-block: 4em;
    }

    p {
        font-size: 13px;
        line-height: 1.7;
        color: var(--pap-color-on-dark-muted);
        font-weight: 300; /* design: 200 – Lato Thin is too faint at 13px */

        &:last-child {
            margin-block-end: 0;
        }
    }

    a {
        display: block;
        color: var(--pap-color-on-dark-muted);
        text-decoration: none;
        font-size: 13px;
        font-weight: 300;
        margin-bottom: 0.6em;
        transition: color 0.3s;

        &:last-child {
            margin-block-end: 0;
        }

        &:hover, &:focus-visible {
            color: var(--pap-color-primary);
        }
    }

    /* column labels: h2 for a sequential outline, styled as the former small h5 labels */
    .ce-footer__heading {
        font-weight: 500;
        font-size: 11px;
        line-height: 1.1;
        letter-spacing: var(--pap-letter-spacing-label);
        text-transform: uppercase;
        margin-block: 1em;
    }

    .ce-footer__links,
    .ce-footer__social,
    .ce-footer__legal ul {
        list-style: none;
        margin: 0;
        padding: 0;
    }

    .ce-footer__links li:not(:last-child) > a {
        margin-bottom: 0.6em;
    }

    .ce-footer__logo {
        display: block;
        width: 100%;
        height: auto;
        max-width: 10em;
        margin-block-end: 1.5em;
    }

    .ce-footer__showhouse {
        background: rgba(255, 255, 255, 0.04);
        border: 1px solid var(--pap-color-border-on-dark-subtle);
        padding: 1.5em;

        .ce-footer__heading {
            color: var(--pap-color-primary);
            margin-block-start: 0;
        }

        a {
            color: white;
            letter-spacing: 0.08em;
            text-transform: uppercase;
            font-weight: 400;
            font-size: 11px;

            &:hover, &:focus-visible {
                color: var(--pap-color-primary);
            }
        }
    }

    .ce-footer__social {
        display: flex;
        gap: 1rem;
        align-items: center;

        a {
            width: 36px;
            height: 36px;
            display: flex;
            align-items: center;
            justify-content: center;
            border: 1px solid var(--pap-color-border-on-dark);
            border-radius: 50%;
            color: var(--pap-color-on-dark-muted);
            transition: all 0.3s;
            text-decoration: none;
            margin: 0;

            &:hover, &:focus-visible {
                border-color: var(--pap-color-primary);
                color: var(--pap-color-primary);
            }
        }

        svg {
            width: 16px;
            height: 16px;
        }
    }

    .ce-footer__certs {
        display: flex;
        gap: 1.5rem;
        align-items: center;

        .ce-footer__cert {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            font-size: 11px;
            letter-spacing: 0.08em;
            text-transform: uppercase;
            color: var(--pap-color-on-dark-subtle);

            svg {
                width: 18px;
                height: 18px;
                color: var(--pap-color-primary);
            }
        }
    }

    .ce-footer__legal ul {
        display: flex;
        flex-wrap: wrap;
        column-gap: 1.2rem;
    }

    .ce-footer__legal li {
        display: flex; /* links and button sit on the same line box as before (no 16px strut of the li) */
    }

    .ce-footer__main,
    .ce-footer__middle,
    .ce-footer__bottom {
        max-width: 100%;
        width: 100%;
        margin-inline: auto;
        padding-inline: 15px;

        @media (min-width: 768px) {
            width: 750px;
        }

        @media (min-width: 992px) {
            width: 970px;
        }

        @media (min-width: 1200px) {
            width: 1170px;
        }

        @media (min-width: 1560px) {
            width: 1560px;
        }
    }

    .ce-footer__main {
        margin: 0 auto;
        display: grid;
        grid-template-columns: 1fr;
        gap: 2em;
        padding-block: 1.5em;

        @media (min-width: 768px) {
            grid-template-columns: 1fr 1fr;
        }

        @media (min-width: 992px) {
            grid-template-columns: 1fr 1fr 1fr 1fr;
        }
    }

    .ce-footer__middle {
        display: flex;
        flex-flow: column;
        gap: 1em;
        padding-block: 1.5em;
        border-top: 1px solid var(--pap-color-border-on-dark-subtle);
        border-bottom: 1px solid var(--pap-color-border-on-dark-subtle);

        @media (min-width: 768px) {
            flex-flow: row nowrap;
            justify-content: space-between;
            align-items: center;
        }
    }

    .ce-footer__bottom {
        display: flex;
        justify-content: space-between;
        align-items: center;
        flex-wrap: wrap;
        gap: 0.8em;
        padding-block: 1.5em;

        p, a {
            font-size: 12px;
            color: var(--pap-color-on-dark-subtle);
            text-decoration: none;
            margin: 0;
            line-height: 1.7;
        }

        a {
            &:hover, &:focus-visible {
                color: var(--pap-color-primary);
            }
        }

        .ce-footer__cookie-settings {
            padding: 0;
            border: 0;
            background: none;
            font-size: 12px;
            font-weight: 300;
            line-height: 1.7;
            color: var(--pap-color-on-dark-subtle);
            cursor: pointer;
            transition: color 0.3s;

            &:hover, &:focus-visible {
                color: var(--pap-color-primary);
            }
        }
    }
}

.ce-footer a:focus-visible,
.ce-footer button:focus-visible {
    outline: var(--pap-focus-ring-width) solid var(--pap-focus-ring-color);
    outline-offset: var(--pap-focus-ring-offset);
}
