/*
 * Footer: signup row, link grid, then one bottom bar (copyright + social icons).
 * Loaded by templates/patterns/theme/footer-columns/footer-columns.html.twig.
 * Builds on Bulma and the colour variables defined in custom.css. These rules
 * supersede the older footer rules in custom.css (.footer-social, .footer-meta,
 * .footer .quicklinks li + li).
 *
 * The newsletter embed (footerembed) is raw HTML with its own <style> block that
 * comes after this file, so selectors scoped to .footer-signup carry the
 * .footer prefix to win on specificity. Anything the embed does not use (an
 * unknown provider) simply falls back to the stacked, unstyled form.
 */

.footer {
    padding: 2.5rem 1.5rem 1.5rem;
}

/* One heading style for the signup and every link column */
.footer .subtitle {
    margin-bottom: 0.75rem;
    color: var(--jacobson-ink);
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.3;
}

/* ---- Row 1: signup ---- */
.footer-signup {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--jacobson-border);
}

.footer .footer-signup .form-container {
    max-width: none;
    margin: 0;
}

.footer .footer-signup form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.5rem;
    margin: 0;
}

/* The embed's heading takes the full first line, like the link headings */
.footer .footer-signup .fb-header {
    flex: 0 0 100%;
}

.footer .footer-signup .fb-header .subtitle {
    margin-bottom: 0;
}

.footer .footer-signup .fb-text {
    flex: 1 1 16rem;
    max-width: 28rem;
    margin-top: 0 !important;
}

.footer .footer-signup .fb-button {
    flex: 0 0 auto;
}

.footer .footer-signup .form-group label {
    color: var(--jacobson-ink);
    font-size: 0.9375rem;
}

.footer .footer-signup .form-group input[type="email"],
.footer .footer-signup .form-group input[type="text"] {
    min-height: 44px;
    border: 1px solid var(--jacobson-ink);
    background: var(--jacobson-surface);
    color: var(--jacobson-ink);
}

.footer .footer-signup .form-group button {
    min-height: 44px;
    margin-top: 0;
    background-color: var(--jacobson-blue);
    color: #fff;
}

.footer .footer-signup .form-group button:hover {
    background-color: var(--jacobson-blue-dark);
}

.footer-signup :where(input, button, select, textarea):focus-visible {
    outline: 3px solid var(--jacobson-focus) !important;
    outline-offset: 3px !important;
}

/* ---- Row 2: link columns ---- */
.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
    gap: 1.5rem 2rem;
}

.footer .quicklinks,
.footer .quicklinks li + li {
    margin-top: 0;
}

.footer .quicklinks a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    color: var(--jacobson-blue);
    text-decoration: none;
}

.footer .quicklinks a:hover,
.footer .quicklinks a:focus-visible {
    color: var(--jacobson-blue-dark);
    text-decoration: underline;
}

.footer .quicklinks a:focus-visible,
.footer .social-buttons a:focus-visible {
    outline: 3px solid var(--jacobson-focus);
    outline-offset: 2px;
}

/* ---- Row 3: bottom bar ---- */
.footer-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--jacobson-border);
}

/* No signup and no links: nothing above the bar, so no rule or gap above it */
.footer .container > .footer-bar:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

.footer-bar .footer-meta {
    margin: 0;
    font-size: 0.875rem;
}

.footer-bar--no-social {
    justify-content: center;
    text-align: center;
}

.footer .social-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
}

.footer .social-buttons a {
    border-radius: 50%;
    color: var(--jacobson-blue);
    font-size: 1.25rem;
}

/* A white tint keeps the icon above 4.5:1 (a blue tint would not) */
.footer .social-buttons a:hover {
    background-color: var(--jacobson-surface);
    color: var(--jacobson-blue-dark);
}

/* Small screens: copyright above the icons, both left-aligned */
@media (max-width: 599px) {
    .footer-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .footer-bar--no-social {
        align-items: center;
    }
}
