/* Footer Styles */
footer {
    background: var(--background-alt);
    color: var(--text);
    padding: 64px 0 40px;
    border-top: 1px solid var(--border-subtle);
    /* Keep consistent vertical rhythm across Mission/Offices/Pages */
    --footer-item-gap: 10px;
}

footer .container {
    max-width: 1100px;
}

/* Top layout */
footer .footer-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    column-gap: clamp(28px, 5vw, 64px);
    row-gap: 28px;
    align-items: start;
    max-width: 960px;
    margin: 0 auto;
}

footer .footer-left {
    display: flex;
    flex-direction: column;
    gap: 22px;
    min-width: 0;
}

footer .footer-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
    min-width: 0;
}

footer .footer-pages {
    justify-self: end;
    width: 100%;
}

/* Column headings */
footer .footer-heading {
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--accent);
    margin: 0;
}

/* Mission tagline */
footer .footer-tagline {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    /* Match the visual spacing between footer items (Offices/Pages use flex `gap`) */
    line-height: calc(1.5em + var(--footer-item-gap));
    margin: 0;
    max-width: 340px;
    text-wrap: balance;
}

/* Offices section */
footer .footer-offices {
    display: flex;
    flex-direction: column;
    gap: var(--footer-item-gap);
}

footer .footer-office {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
    font-weight: 500;
}

footer a.footer-office {
    text-decoration: none;
    transition: color 0.2s ease, transform 0.2s ease;
}

footer a.footer-office:hover {
    color: var(--accent);
    transform: translateX(2px);
}

footer .footer-logo {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

footer .footer-logo img,
footer .footer-logo .logo-img {
    width: 150px;
    height: auto;
    transition: var(--transition);
}

footer .footer-logo:hover img,
footer .footer-logo:hover .logo-img {
    opacity: 0.8;
}

footer .copyright {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
    font-weight: 600;
    letter-spacing: 0.01em;
}

/* Navigation links */
footer .footer-nav {
    display: flex;
    flex-direction: column;
    gap: var(--footer-item-gap);
    align-items: flex-start;
    /* Override global nav styles (navigation.css) */
    padding: 0;
    margin: 0;
    justify-content: flex-start;
}

footer .footer-nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.01em;
    line-height: 1.5;
    transition: color 0.2s ease, transform 0.2s ease, text-decoration-color 0.2s ease;
    display: inline-block;
}

footer .footer-nav a:hover {
    color: var(--accent);
    transform: translateX(2px);
}

/* Bottom bar */
footer .footer-bottom {
    margin-top: 36px;
    padding-top: 18px;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    flex-direction: column;
    justify-content: center;
    gap: 12px;
    text-align: center;
    max-width: 960px;
    margin-left: auto;
    margin-right: auto;
}

/* Responsive - Tablet */
@media screen and (max-width: 900px) {
    footer {
        padding: 56px 0 36px;
    }

    footer .footer-grid {
        grid-template-columns: 1fr 1fr;
        column-gap: 32px;
        row-gap: 24px;
    }

    footer .footer-pages {
        justify-self: start;
        max-width: none;
    }
}

/* Responsive - Mobile */
@media screen and (max-width: 640px) {
    footer {
        padding: 48px 0 32px;
        --footer-item-gap: 6px;
    }

    footer .footer-grid {
        /* Balance mobile footer: left column (Mission + Offices), right column (Pages) */
        grid-template-columns: minmax(0, 1fr) minmax(0, 150px);
        column-gap: 28px;
        row-gap: 18px;
    }

    footer .footer-left {
        gap: 18px;
    }

    footer .footer-nav a {
        padding: 2px 0;
    }

    footer .footer-pages {
        justify-self: end;
        width: max-content;
        max-width: 100%;
    }

    footer .footer-tagline {
        max-width: 100%;
    }

    footer .footer-bottom {
        margin-top: 24px;
    }
}

/* Extra small phones: stack again to avoid cramped columns */
@media screen and (max-width: 380px) {
    footer .footer-grid {
        grid-template-columns: 1fr;
        row-gap: 22px;
    }

    footer .footer-pages {
        justify-self: start;
        width: 100%;
        max-width: none;
    }
}

@media screen and (max-width: 480px) {
    footer {
        padding: 40px 0 28px;
    }

    footer .footer-logo img,
    footer .footer-logo .logo-img {
        width: 130px;
    }

    footer .footer-tagline {
        font-size: 14px;
        max-width: 280px;
    }

    footer .footer-nav a {
        font-size: 14px;
    }

    footer .footer-office {
        font-size: 13px;
    }

    footer .copyright {
        font-size: 12px;
    }
}
