/* Layout footer with the newsletter built in (see js/footer-newsletter.js) */

/* ---------- Footer ---------- */
footer.mm-footer {
    /* Fit the content instead of 70% of the screen; js measures it and sizes the reveal space */
    height: auto;
    padding-top: 48px;
    padding-bottom: 32px;
}

html.mm-footer-ready .container-margin-bottom,
html.mm-footer-ready .learn-more-section {
    margin-bottom: var(--mm-footer-reveal) !important;
}

/* Footer taller than the screen: show it below the page instead of behind it */
html.mm-footer-static footer.mm-footer {
    position: relative;
    bottom: auto;
}

html.mm-footer-static .container-margin-bottom,
html.mm-footer-static .learn-more-section {
    margin-bottom: 0 !important;
}

footer.mm-footer .footer-menu-custom {
    position: relative;
}

footer.mm-footer .mm-footer-logo {
    position: absolute;
    top: 0;
    left: 50%;
    width: auto;
    padding: 0;
    transform: translateX(-50%);
    pointer-events: none;
}

    footer.mm-footer .mm-footer-logo img {
        display: block;
        max-width: 250px;
        height: auto;
    }

/* Follow Us: icon-font links sized like the Instagram SVG (48px box, white glyph) */
footer.mm-footer .mm-social-link {
    color: #fff;
    text-decoration: none;
}

    footer.mm-footer .mm-social-link .social-icon {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 48px;
        height: 48px;
        /* .footer-links span would otherwise colour it blue */
        color: #fff;
        font-size: 38px;
        line-height: 1;
        transition: opacity 0.2s ease;
    }

    footer.mm-footer .mm-social-link:hover .social-icon,
    footer.mm-footer .mm-social-link:focus-visible .social-icon {
        opacity: 0.8;
    }

/* ---------- Newsletter card ---------- */
.mm-newsletter {
    position: relative;
    z-index: 1;
    margin-bottom: 48px;
}

    .mm-newsletter *,
    .mm-newsletter *::before,
    .mm-newsletter *::after {
        box-sizing: border-box;
    }

.mm-newsletter-card {
    display: grid;
    grid-template-columns: minmax(240px, 0.85fr) minmax(0, 2fr);
    align-items: center;
    gap: 20px 40px;
    padding: 32px 40px;
    border-top: 4px solid var(--ds-blue);
    border-radius: var(--ds-radius-card);
    background: #f5f5f5;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

.mm-newsletter-intro {
    display: flex;
    align-items: center;
    gap: 16px;
}

.mm-newsletter-icon {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: var(--ds-radius-card);
    background: #e3f4fb;
    color: var(--ds-blue-dark);
    font-size: 22px;
}

.mm-newsletter-title {
    margin: 0;
    color: var(--ds-ink);
    font-size: 26px;
    font-weight: 600;
    line-height: 1.25;
}

.mm-newsletter-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 12px;
    margin: 0;
}

.mm-newsletter-field {
    position: relative;
}

.mm-newsletter-field-icon {
    position: absolute;
    top: 50%;
    left: 17px;
    color: #98a3ae;
    font-size: 16px;
    transform: translateY(-50%);
    pointer-events: none;
}

.mm-newsletter-input {
    width: 100%;
    height: 54px;
    padding: 0 16px 0 46px;
    border: 1px solid var(--ds-line-strong);
    border-radius: var(--ds-radius-control);
    background: #fff;
    color: var(--ds-ink);
    /* 16px keeps iOS Safari from zooming in on focus */
    font-size: 16px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

    .mm-newsletter-input::placeholder {
        color: #8a949e;
    }

    .mm-newsletter-input:focus {
        border-color: var(--ds-blue);
        outline: 0;
        box-shadow: var(--ds-focus-ring);
    }

.mm-newsletter-form.has-error .mm-newsletter-input {
    border-color: #dc3545;
    box-shadow: 0 0 0 4px rgba(220, 53, 69, 0.14);
}

.mm-newsletter-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 190px;
    height: 54px;
    padding: 0 28px;
    border: 0;
    border-radius: var(--ds-radius-control);
    background: var(--ds-blue);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    white-space: nowrap;
    transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

    .mm-newsletter-button:hover {
        background: var(--ds-blue-dark);
    }

    .mm-newsletter-button:active {
        transform: translateY(1px);
    }

    .mm-newsletter-button:focus-visible {
        outline: 0;
        box-shadow: var(--ds-focus-ring-strong);
    }

    .mm-newsletter-button:disabled {
        cursor: wait;
        opacity: 0.85;
    }

.mm-newsletter-spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.45);
    border-top-color: #fff;
    border-radius: 50%;
    animation: mmNewsletterSpin 0.7s linear infinite;
}

.mm-newsletter-button.is-busy .mm-newsletter-spinner {
    display: inline-block;
}

.mm-newsletter-message {
    grid-column: 1 / -1;
    margin: 0;
    color: #c82333;
    font-size: 14px;
}

    .mm-newsletter-message:empty {
        display: none;
    }

.mm-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@keyframes mmNewsletterSpin {
    to {
        transform: rotate(360deg);
    }
}

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
    footer.mm-footer {
        padding-top: 36px;
    }

    /* The link groups are rows nested inside a row; their negative margins pushed the
       footer 9-12px past the screen edge on phones (sideways scrolling on every page) */
    footer.mm-footer .footer-menu-custom > .row {
        margin-left: 0;
        margin-right: 0;
    }

    footer.mm-footer .mm-footer-logo {
        position: static;
        flex: 0 0 100%;
        display: flex;
        justify-content: center;
        margin-bottom: 24px;
        transform: none;
    }

        footer.mm-footer .mm-footer-logo img {
            max-width: 200px;
        }

    .mm-newsletter {
        margin-bottom: 36px;
    }

    .mm-newsletter-card {
        grid-template-columns: minmax(0, 1fr);
        padding: 26px 24px;
    }

    .mm-newsletter-title {
        font-size: 22px;
    }
}

@media (max-width: 575.98px) {
    .mm-newsletter-card {
        padding: 22px 18px;
    }

    .mm-newsletter-icon {
        width: 44px;
        height: 44px;
        font-size: 19px;
    }

    .mm-newsletter-title {
        font-size: 19px;
    }

    .mm-newsletter-form {
        grid-template-columns: minmax(0, 1fr);
    }

    .mm-newsletter-button {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mm-newsletter-input,
    .mm-newsletter-button {
        transition: none;
    }

    .mm-newsletter-spinner {
        animation-duration: 1.5s;
    }
}
