/**
 * Flamingo Marine — Site Footer (V4 strip-6 bottom band).
 *
 * Layout: full-bleed surface-base band distinguishing it from the page's
 * surface-deep. Top row = brand/contact column + three link-group columns.
 * Bottom bar = social icon row (left) and copyright + legal links (right),
 * split by a hairline rule.
 *
 * Content is inlined directly in parts/footer.html (no pattern reference),
 * per LEARNINGS #1.
 */

.flm-footer {
    position: relative;
    isolation: isolate; /* own stacking context so the bg video/veil sit behind content */
    overflow: hidden;
    background-color: var(--wp--preset--color--surface-base);
    color: var(--wp--preset--color--text-secondary);
}

/* --- Background water video --------------------------------------------- */

/* Full-cover looping video behind the footer; surface-base shows through as the
   fallback if it can't play. */
.flm-footer__bgvideo {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0; /* cancel the flow-layout block-gap margin so it covers from the top */
    object-fit: cover;
    z-index: -2;
}

/* Dark veil so the light footer text stays legible over the moving water
   (matches the prior ocean-cover dim, #181C25 @ ~82%). */
.flm-footer__bgveil {
    position: absolute;
    inset: 0;
    margin: 0; /* cancel the flow-layout block-gap margin (was pushing the veil 32px down, exposing a bright strip) */
    z-index: -1;
    background-color: rgba(24, 28, 37, 0.82);
}

@media (prefers-reduced-motion: reduce) {
    .flm-footer__bgvideo {
        display: none; /* respect reduced-motion; surface-base + veil remain */
    }
}

/* --- Brand column ------------------------------------------------------- */

.flm-footer__logo {
    display: inline-flex;
    align-items: center;
    line-height: 0;
    color: var(--wp--preset--color--text-primary);
}

.flm-footer__wordmark {
    display: block;
    height: clamp(30px, 2.5vw, 36px); /* enlarged for footer presence */
    width: auto;
}

.flm-footer__tagline {
    max-width: 34ch;
}

.flm-footer__contact a {
    color: inherit;
    text-decoration: none;
    transition: color 0.15s ease;
    /* Break BEFORE a long link (email/phone), never inside it — the email was
       splitting mid-address ("contact@flamingo-" / "marine.com"). */
    white-space: nowrap;
}

.flm-footer__contact a:hover,
.flm-footer__contact a:focus-visible {
    color: var(--wp--preset--color--text-primary);
}

/* --- Link groups -------------------------------------------------------- */

.flm-footer__heading {
    /* Zero the default heading top margin so the Products / Company headings
       top-align with the brand logo and the "Stories from the water" title — every
       column starts on the same line (BugHerd #38). */
    margin-top: 0;
    margin-bottom: var(--wp--preset--spacing--lg);
}

.flm-footer__links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--wp--preset--spacing--sm);
    font-size: var(--wp--preset--font-size--body);
}

.flm-footer__links li {
    margin: 0;
    /* Keep multi-word labels (e.g. "Features & Innovation") on a single line
       rather than wrapping mid-label (BugHerd #42). */
    white-space: nowrap;
}

/* Between the stack breakpoint and full desktop the fixed 30% brand/newsletter
   columns squeeze the link columns below the nowrap labels' width, and the
   labels bled into the neighboring column (client punch list 2026-08-05:
   "overlapping text when resizing window"). Let labels wrap in that band only —
   at full width they stay one line per BugHerd #42. */
@media (min-width: 782px) and (max-width: 1150px) {
    .flm-footer__links li {
        white-space: normal;
        overflow-wrap: break-word;
    }
}

.flm-footer__links a {
    color: var(--wp--preset--color--text-secondary);
    text-decoration: none;
    font-weight: 300;
    transition: color 0.15s ease;
}

.flm-footer__links a:hover,
.flm-footer__links a:focus-visible {
    color: var(--wp--preset--color--text-primary);
}

/* --- Newsletter (footer-right; where the Support column used to be) ------ */

/* Top-align the columns so brand · links · newsletter read as one tidy band;
   brand + newsletter anchor the two ends, the link groups sit between. */
.flm-footer__cols {
    align-items: flex-start;
}
.flm-footer__news {
    flex-grow: 0;
}

.flm-footer__news-title {
    margin: 0 0 0.45rem;
    color: var(--wp--preset--color--text-primary);
    font-family: var(--wp--preset--font-family--plex);
    font-weight: 600;
    font-size: 1.2rem;
    line-height: 1.2;
}

.flm-footer__news-lead {
    margin: 0 0 1.1rem;
    max-width: 32ch;
    color: var(--wp--preset--color--text-muted);
    font-weight: 300;
    font-size: var(--wp--preset--font-size--caption);
    line-height: 1.6;
}

.flm-footer__news-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.flm-footer__news-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

.flm-footer__news-input {
    flex: 1 1 165px;
    min-width: 0;
    box-sizing: border-box; /* keep width:100% (mobile) inside the column, no overflow */
    height: 46px;
    padding: 0 0.95rem;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.06);
    color: var(--wp--preset--color--text-primary);
    font-size: 0.95rem;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.flm-footer__news-input::placeholder {
    color: var(--wp--preset--color--text-muted);
}

.flm-footer__news-input:focus-visible {
    outline: none;
    border-color: var(--wp--preset--color--text-primary);
    background: rgba(255, 255, 255, 0.1);
}

.flm-footer__news-btn {
    flex: 0 0 auto;
    height: 46px;
    padding: 0 1.4rem;
    border: 1px solid var(--wp--preset--color--text-primary);
    border-radius: 6px;
    background-color: var(--wp--preset--color--text-primary);
    color: var(--wp--preset--color--surface-deep);
    font-weight: 600;
    font-size: 0.875rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

/* Matches the header "Build Your ROVE" CTA hover: fill stays white, text
   goes pink (BugHerd #163 — consistent hover states across the site). */
.flm-footer__news-btn:hover,
.flm-footer__news-btn:focus-visible {
    color: var(--wp--preset--color--accent-pink);
}

/* --- Hairline rule ------------------------------------------------------ */

.flm-footer__rule {
    border: 0;
    margin-block: 0;
}

/* --- Bottom bar: social + legal ----------------------------------------- */

.flm-footer__bar {
    gap: var(--wp--preset--spacing--lg);
}

.flm-social {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: var(--wp--preset--spacing--md);
}

.flm-social li {
    margin: 0;
}

.flm-social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--wp--preset--color--text-primary);
    transition: color 0.15s ease;
}

.flm-social a:hover,
.flm-social a:focus-visible {
    color: var(--wp--preset--color--accent-pink);
    outline: none;
}

.flm-social a:focus-visible {
    box-shadow: 0 0 0 2px var(--wp--preset--color--focus);
    border-radius: 3px;
}

.flm-social__icon {
    display: block;
    width: 26px;
    height: 26px;
}

/* Our footer/drawer social icons are inline <svg> with their own fill. Opt
   them out of the legacy mask-based .flm-social__icon treatment in style.css
   (background-color + mask) — without it, that background paints a grey box
   behind each glyph. Scoped to svg so the old <span> mask icons
   (patterns/footer-band.php) keep working. */
svg.flm-social__icon {
    background: none;
    -webkit-mask: none;
    mask: none;
}

.flm-footer__legal {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--wp--preset--spacing--xs) var(--wp--preset--spacing--lg);
    font-size: var(--wp--preset--font-size--caption);
    font-weight: 300;
    color: var(--wp--preset--color--text-muted);
}

.flm-footer__legal-links {
    display: flex;
    flex-wrap: wrap;
    gap: var(--wp--preset--spacing--lg);
}

.flm-footer__legal-links a {
    color: var(--wp--preset--color--text-muted);
    text-decoration: none;
    transition: color 0.15s ease;
}

.flm-footer__legal-links a:hover,
.flm-footer__legal-links a:focus-visible {
    color: var(--wp--preset--color--text-primary);
}

/* --- Responsive --------------------------------------------------------- */

@media (max-width: 767px) {
    .flm-footer {
        padding-left: var(--wp--preset--spacing--lg) !important;
        padding-right: var(--wp--preset--spacing--lg) !important;
    }

    /* Social row (left) and copyright/legal (right) stack vertically. */
    .flm-footer__bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .flm-social {
        flex-wrap: wrap;
    }

    .flm-footer__legal {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--wp--preset--spacing--sm);
    }

    /* Stacked columns: newsletter copy + form go full width, controls stack. */
    .flm-footer__news-lead { max-width: none; }
    .flm-footer__news-form { flex-direction: column; max-width: 460px; }
    /* Column layout makes flex-basis the MAIN (vertical) size — without resetting
       flex, the input's `flex: 1 1 165px` stretched it to 165px tall (BugHerd #41).
       flex:0 0 auto lets each control use its own 46px height. */
    .flm-footer__news-input,
    .flm-footer__news-btn { width: 100%; flex: 0 0 auto; }
}
