.footer-container {
    width: 100%;
    background-color: var(--black);
    margin-top: var(--spacing-6xl);
}

.footer-wrapper {
    width: var(--content-width);
    margin: 0 auto;
}

/* Split wrappers keep the columns inside the content width, while the divider
   between them is free to span the full width. */
.footer-wrapper--columns {
    padding-top: var(--spacing-2xl);
}

.footer-wrapper--copyright {
    padding-bottom: var(--spacing-lg);
}

.footer-columns {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    align-items: stretch;
    gap: var(--spacing-xl);
}

.footer-column {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--spacing-xl);
    text-align: left;
}

/* The logo is taken out of flow so its intrinsic aspect ratio cannot drive the
   row height: the text columns set the height and the logo scales to match it. */
.footer-column-logo {
    position: relative;
}

.footer-logo-image {
    position: absolute;
    top: 0;
    left: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: left center;
}

.footer-column-title {
    color: var(--off-white);
    text-transform: uppercase;
    margin: 0;
}

.footer-links-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--spacing-sm);
}

.footer-links-list a {
    color: var(--off-white);
    text-decoration: none;
}

.footer-links-list a:hover {
    text-decoration: underline;
}

.socials {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.socials a {
    display: inline-block;
    transition: transform 0.3s;
}

.socials a:hover {
    transform: scale(1.1);
}

.socials img {
    width: 2rem;
    height: 2rem;
    display: block;
}

/* Sits outside .footer-wrapper so it spans the full width, not --content-width */
.footer-divider {
    width: 100%;
    border: 0;
    border-top: 1px solid var(--light-grey);
    margin: var(--spacing-2xl) 0 var(--spacing-md);
}

.footer-copyright {
    text-align: right;
}

.footer-copyright p {
    color: var(--off-white);
    margin: 0;
}

/* Responsive */
@media (max-width: 1200px) {
    .footer-columns {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-xl) var(--spacing-lg);
    }

    .footer-column {
        gap: var(--spacing-lg);
    }

    /* Logo spans its own row, so it must size itself again instead of collapsing */
    .footer-column-logo {
        position: static;
        grid-column: 1 / -1;
    }

    .footer-logo-image {
        position: static;
        width: auto;
        height: var(--spacing-2xl);
        max-width: 100%;
    }
}

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

    .footer-column {
        gap: var(--spacing-md);
    }

    .footer-copyright {
        text-align: left;
    }
}

/* ===== AI Transparency Statement modal ===== */
[x-cloak] {
    display: none !important;
}

.footer-ai-link {
    -webkit-appearance: none;
    appearance: none;
    background: none;
    border: 0;
    margin: 0;
    padding: 0;
    font: inherit;
    color: var(--off-white);
    text-decoration: none;
    cursor: pointer;
}

.footer-ai-link:hover {
    text-decoration: underline;
}

.ai-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(18, 18, 18, 0.6);
    pointer-events: none;
}

.ai-modal-overlay.is-open {
    pointer-events: auto;
}

.ai-modal {
    position: relative;
    background: var(--off-white);
    color: var(--black);
    width: min(90%, 560px);
    max-height: 80vh;
    overflow-y: auto;
    padding: var(--spacing-xl);
    display: flex;
    flex-direction: column;

}

.ai-modal-close {
    position: absolute;
    top: var(--spacing-sm);
    right: var(--spacing-sm);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--black);
    padding: 0.25rem;
    line-height: 1;
}

.ai-modal-close:hover {
    opacity: 0.6;
}

.ai-modal-header {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
    border-bottom: 2px solid var(--black);
}

.ai-modal-icon {
    align-self: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: var(--black);
    color: var(--off-white);
}

.ai-modal-overlay.is-open .ai-modal-icon {
    animation: ai-icon-pop 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.3) both;
}

.ai-modal-title {
    font-weight: 800;
    color: var(--black);
    margin: 0;
    text-align: left;
}

.ai-modal-sentence {
    color: var(--black);
    margin: 0;
    text-align: left;
}

@keyframes ai-icon-pop {
    0% {
        transform: scale(0.3) rotate(-10deg);
        opacity: 0;
    }
    55% {
        transform: scale(1.18) rotate(4deg);
        opacity: 1;
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}
