/*
 * Header / footer layout ported from the wfmca-ci "project" frontend theme
 * (frontend_assets/css/styles.css there). Only the chrome (top bar, main
 * nav, mobile nav, footer) is included here — page content keeps its own
 * existing styles from aofixo.css.
 */

/* Every Bootstrap modal on the site (#QRModal, #TermsModal-popup on
   request-meal; #exampleModal on programs/get-involved; etc.) picks up a
   translateY(~viewport-height) transform at runtime from one of the page's
   scroll-reveal/parallax libraries (jarallax/jquery.appear). Those libraries
   never "see" a modal to clear its reveal transform because Bootstrap keeps
   it display:none until triggered - so the moment it's opened, it renders
   a viewport-height below where it should (verified: off-screen on mobile,
   where the page scrolls; happened to compute to 0 on wide/short desktop
   viewports, which is why it looked fine there). Not scoped to any one
   breakpoint - the underlying cause isn't viewport-width-dependent. */
.modal.show {
    transform: none !important;
}

:root {
    --wfm-primary-dark: rgb(3, 21, 46);
    --wfm-primary-blue: rgb(42, 81, 136);
    --wfm-dark-1: rgb(3, 21, 46);
    --wfm-blue-5: rgb(152, 181, 226);
    --wfm-blue-6: rgb(202, 216, 241);
    --wfm-text-dark: #2C2C2C;
    --wfm-warm-beige: #F5E6D3;
    --wfm-light-cream: #FFF8F0;
    --wfm-gray-50: #F9FAFB;
    --wfm-gray-100: #F3F4F6;
    --wfm-gray-200: #E5E7EB;
    --wfm-font-heading: 'Lora', 'Merriweather', serif;
    --wfm-font-body: 'Poppins', sans-serif;
}

/* CI's header/footer type is set in Poppins; the page body elsewhere on
   this site uses the aofixo theme's "Plus Jakarta Sans", so it's pinned
   explicitly here rather than left to inherit. */
.wfm-header,
.wfm-mobile-nav,
.wfm-btn-donate-fixed,
.wfm-footer {
    font-family: var(--wfm-font-body);
}

/* Top bar */
.wfm-header {
    background: #fff;
    box-shadow: 0 2px 15px rgba(0, 0, 0, .08);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.wfm-header-top {
    background: var(--wfm-primary-dark);
    color: #fff;
    padding: 12px 0;
    font-size: 14px;
}

.wfm-header-top .container {
    display: flex;
    justify-content: flex-end;
    /* justify-content: space-between; */
    align-items: center;
    flex-wrap: nowrap;
    gap: 20px;
}

.wfm-notice {
    background: var(--wfm-primary-blue);
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: 600;
    overflow: hidden;
    white-space: nowrap;
    position: relative;
}

.wfm-notice-track {
    display: inline-block;
    padding-left: 100%;
    animation: wfm-scroll-text 22s linear infinite;
}

@keyframes wfm-scroll-text {
    from { transform: translateX(0); }
    to { transform: translateX(-100%); }
}

.wfm-header-contact {
    display: flex;
    align-items: center;
    gap: 8px;
}

.wfm-header-contact a {
    color: #fff;
}

.wfm-dual-button {
    display: flex;
    list-style: none;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, .1);
}

.wfm-dual-button a {
    border: none;
    padding: 12px 10px;
    cursor: pointer;
    font-size: 13px;
    background-color: var(--wfm-primary-blue);
    color: #fff;
    text-decoration: none;
    transition: .3s ease;
}

.wfm-dual-button a:first-child {
    border-right: 1px solid rgba(255, 255, 255, .3);
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}

.wfm-dual-button a:last-child {
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
}

.wfm-dual-button a:hover {
    background: #fff;
    color: var(--wfm-primary-blue);
    z-index: 1;
}

/* Compact mobile account bar (replaces the plain Register/Login strip on
   small screens). Hidden on desktop, where .wfm-dual-button still applies. */
.wfm-account-bar { display: none; }

.wfm-social-icons {
    display: flex;
    gap: 5px;
}

.wfm-social-icons a {
    width: 30px;
    height: 30px;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: border-radius .2s ease;
}

.wfm-social-icons a:hover {
    border-radius: 50%;
}

.wfm-social-icons img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Main nav */
.wfm-header-main {
    padding: 20px 0;
}

.wfm-header-main .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.wfm-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    max-width: 200px;
}

.wfm-logo img {
    max-width: 100%;
    height: auto;
}

.wfm-logo__caption {
    margin-top: 2px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--wfm-primary-dark);
}

.wfm-nav {
    display: flex;
    gap: 20px;
    align-items: center;
    list-style: none;
}

.wfm-nav > li {
    position: relative;
}

.wfm-nav a {
    color: var(--wfm-text-dark);
    text-decoration: none;
    font-weight: 500;
    font-size: 12px;
    transition: color .3s ease;
    position: relative;
}

.wfm-nav > li > a {
    display: inline-block;
    padding: 6px 0;
}

.wfm-nav a:hover {
    color: var(--wfm-primary-blue);
}

/* Animated underline on hover, ported from wfmca-ci/project's `nav a::after`
   (frontend_assets/css/styles.css there). Scoped to non-dropdown items only
   (:not(.wfm-nav-dropdown)) since .wfm-nav-dropdown > a already uses ::after
   for its ▼ arrow indicator - the reference site's dropdown trigger is a
   plain <div>, not an <a>, so it never competed with this rule there. */
.wfm-nav > li:not(.wfm-nav-dropdown) > a::after {
    content: '';
    position: absolute;
    bottom: 0px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--wfm-primary-blue);
    transition: width .3s ease;
}

.wfm-nav > li:not(.wfm-nav-dropdown) > a:hover::after {
    width: 100%;
}

.wfm-nav-dropdown > a {
    cursor: pointer;
    padding-right: 18px !important;
}

.wfm-nav-dropdown > a::after {
    content: '\25BC';
    position: absolute;
    right: 0;
    top: 8px;
    font-size: 10px;
    transition: transform .3s ease;
}

.wfm-nav-dropdown:hover > a::after {
    transform: rotate(180deg);
}

.wfm-dropdown-menu {
    list-style: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    min-width: 200px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, .15);
    border-radius: 8px;
    margin-top: 15px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all .3s ease;
    z-index: 100;
    padding-left: 0 !important;
}

.wfm-nav-dropdown:hover .wfm-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.wfm-dropdown-menu li + li {
    border-top: 1px solid var(--wfm-warm-beige);
}

.wfm-dropdown-menu a {
    display: block;
    padding: 12px 20px;
    color: var(--wfm-text-dark);
    transition: all .3s ease;
    font-size: 13px;
}

.wfm-dropdown-menu a:hover {
    background: var(--wfm-light-cream);
    color: var(--wfm-primary-blue);
    padding-left: 25px;
}

.wfm-dropdown-menu form {
    margin: 0;
}

.wfm-dropdown-menu button.wfm-link-btn {
    display: block;
    width: 100%;
    text-align: left;
    padding: 12px 20px;
    background: none;
    border: none;
    color: var(--wfm-text-dark);
    font-size: 13px;
    cursor: pointer;
}

.wfm-dropdown-menu button.wfm-link-btn:hover {
    background: var(--wfm-light-cream);
    color: var(--wfm-primary-blue);
}

.wfm-btn-donate {
    background: var(--wfm-primary-blue);
    color: #fff;
    padding: 10px 30px;
    border-radius: 25px;
    font-weight: 700;
    transition: all .3s ease;
    border: none;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.wfm-btn-donate:hover {
    background: var(--wfm-primary-dark);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(255, 107, 53, .4);
}

.wfm-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
}

/* Mobile-only Sign In/Sign Up (desktop keeps the existing top-bar buttons via
   .wfm-account-desktop) - hidden by default, shown only inside the mobile
   header media query below. */
.wfm-mobile-auth-actions {
    display: none;
}

.wfm-menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--wfm-primary-dark);
    border-radius: 2px;
    transition: all .3s ease;
    transform-origin: center;
}

.wfm-menu-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.wfm-menu-toggle.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.wfm-menu-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.wfm-mobile-nav {
    flex-direction: column;
    background: #fff;
    border-top: 1px solid var(--wfm-gray-200);
    overflow: hidden;
    max-height: 0;
    transition: max-height .4s ease;
}

.wfm-mobile-nav.open { max-height: 700px; overflow-y: auto; }

.wfm-mobile-nav-link,
.wfm-mobile-nav-submenu a,
.wfm-mobile-nav-submenu-btn {
    display: block;
    padding: 13px 24px;
    color: var(--wfm-dark-1);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-bottom: 1px solid var(--wfm-gray-100);
    transition: background .2s, color .2s;
    background: none;
    border-left: none;
    border-right: none;
    border-top: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
}

.wfm-mobile-nav-link:hover,
.wfm-mobile-nav-submenu a:hover,
.wfm-mobile-nav-submenu-btn:hover {
    background: var(--wfm-gray-50);
    color: var(--wfm-primary-blue);
}

.wfm-mobile-nav-group-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 13px 24px;
    color: var(--wfm-dark-1);
    font-size: 14px;
    font-weight: 500;
    border-bottom: 1px solid var(--wfm-gray-100);
    cursor: pointer;
    user-select: none;
    transition: background .2s, color .2s;
}

.wfm-mobile-nav-group-label:hover {
    background: var(--wfm-gray-50);
    color: var(--wfm-primary-blue);
}

.wfm-mobile-nav-group-arrow {
    font-size: 10px;
    transition: transform .3s ease;
    display: inline-block;
}

.wfm-mobile-nav-group.open .wfm-mobile-nav-group-arrow { transform: rotate(180deg); }

.wfm-mobile-nav-submenu {
    display: none;
    flex-direction: column;
    background: var(--wfm-gray-50);
}

.wfm-mobile-nav-group.open .wfm-mobile-nav-submenu { display: flex; }

.wfm-mobile-nav-submenu a,
.wfm-mobile-nav-submenu-btn { font-size: 13px; padding-left: 36px; }

.wfm-btn-donate-fixed {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--wfm-primary-blue);
    color: #fff;
    text-align: center;
    padding: 16px 24px;
    font-weight: 700;
    font-size: 15px;
    text-decoration: none;
    z-index: 9999;
    box-shadow: 0 -3px 16px rgba(0, 0, 0, .15);
    transition: background .3s;
}

.wfm-btn-donate-fixed:hover { background: var(--wfm-primary-dark); color: #fff; }

@media (max-width: 968px) {
    .wfm-nav { display: none; }
    .wfm-menu-toggle { display: flex; }
    .wfm-mobile-nav { display: flex; }
    .wfm-btn-donate-fixed { display: block; }
    .wfm-btn-donate { display: none; }
    body { padding-bottom: 60px; }

    /* The old top bar (social icons/contact email, and - logged out - the
       account-bar card below) is superseded on mobile by the single
       burger/logo/Sign In+Up row built into .wfm-header-main below. */
    .wfm-header-top { display: none; }

    /* Single-row mobile header: burger (left) / logo (center) / Sign In+Up
       (right). The outer two columns are both 1fr, so the grid forces them
       to equal width - sized to whichever side actually needs more room
       (the auth buttons) - which keeps the auto-width logo in the middle
       truly centered with guaranteed clearance on both sides. (An
       auto/1fr/auto grid, or absolutely centering the logo on the
       container, both center against the *leftover* space instead, which
       lets a wide side's content creep into/overlap the logo on narrow
       screens - tried both, this is the one that doesn't overlap.) */
    .wfm-header-main .container {
        display: grid;
        /* minmax(0,1fr), not plain 1fr - a bare `1fr` track still floors at its own
           content's min-content size before splitting leftover space, so the wider
           auth-buttons column would win more than half and the two sides wouldn't
           end up equal; minmax(0,1fr) ignores that floor and forces a true 50/50
           split, which is what actually keeps the logo centered with no overlap. */
        /* grid-template-columns: minmax(0, 1fr) minmax(0, auto) minmax(0, 1fr); */
        /* Without this: the logo comes first in the HTML but targets column
           2, so after placing it the auto-placement cursor sits at column 3
           - then the burger (column 1) can't go backward in that row and
           gets pushed to a second row instead (confirmed via computed
           gridTemplateRows showing two rows instead of one). `dense` lets
           the algorithm backfill column 1 in the same row instead. */
        grid-auto-flow: dense;
        align-items: center;
        gap: 10px;
    }

    /* Explicit grid-column placement, not DOM-order auto-placement - the
       markup order is logo/burger/auth (logo comes first in menu.blade.php),
       which doesn't match the visual left-to-right order wanted here. */
    .wfm-menu-toggle { grid-column: 1; justify-self: start; }
    .wfm-logo {
        grid-column: 2;
        justify-self: center;
        margin: 0;
        max-width: 140px;
        /* Grid items default to min-width:auto (floored at content size),
           which is exactly what let the logo overlap the auth buttons on
           narrow screens instead of shrinking - this lets it actually
           shrink to whatever the middle column ends up with. */
        min-width: 0;
    }

    .wfm-mobile-auth-actions {
        grid-column: 3;
        justify-self: end;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .wfm-mobile-auth-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 32px;
        padding: 6px 14px;
        border-radius: 20px;
        font-size: 12px;
        font-weight: 600;
        text-decoration: none;
        white-space: nowrap;
        transition: background .25s ease, color .25s ease, border-color .25s ease;
    }

    .wfm-mobile-auth-btn-ghost {
        background: transparent;
        color: var(--wfm-primary-blue);
        border: 1px solid var(--wfm-primary-blue);
    }

    .wfm-mobile-auth-btn-ghost:hover,
    .wfm-mobile-auth-btn-ghost:active {
        background: var(--wfm-blue-6);
    }

    .wfm-mobile-auth-btn-solid {
        background: var(--wfm-primary-blue);
        color: #fff;
        border: 1px solid var(--wfm-primary-blue);
    }

    .wfm-mobile-auth-btn-solid:hover,
    .wfm-mobile-auth-btn-solid:active {
        background: var(--wfm-primary-dark);
        border-color: var(--wfm-primary-dark);
    }
}

@media (max-width: 400px) {
    .wfm-mobile-auth-btn { padding: 5px 9px; font-size: 10.5px; }
    .wfm-mobile-auth-actions { gap: 5px; }
    /* Grid's auto-sized middle column takes its full preferred (max-width)
       size before the flexible outer columns get a share, so the logo
       doesn't actually shrink on its own at this width even with
       min-width:0 on it - cap it explicitly small enough, alongside the
       tighter buttons above, to leave real clearance on both sides. */
    .wfm-logo { max-width: 90px; }
}

@media (min-width: 1200px) {
    .wfm-header-main .container { max-width: 1400px; }
    .wfm-header-top .container { max-width: 1140px; }
}

@media (min-width: 1400px) {
    .wfm-header-top .container { max-width: 1320px; }
}

/* Footer - ported 1:1 from wfmca-ci/project's footer.php + styles.css
   (the `footer`, `.footer-container`, `.footer-top`, `.footer-about`,
   `.footer-links`, `.footer-contact`, `.footer-bottom` block). */
.wfm-footer {
    background: var(--wfm-dark-1);
    color: #fff;
    padding: 80px 40px 30px;
}

.wfm-footer .footer-container {
    max-width: 1200px;
    margin: 0 auto;
}

.wfm-footer .footer-top {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 60px;
    margin-bottom: 60px;
    padding-bottom: 60px;
    border-bottom: 1px solid rgba(255, 255, 255, .1);
}

.wfm-footer .footer-about h3 {
    font-family: var(--wfm-font-heading);
    color: #fff;
    font-size: 26px;
    margin-bottom: 20px;
}

.wfm-footer .footer-about p {
    color: var(--wfm-blue-5);
    line-height: 1.8;
    margin-bottom: 20px;
}

/* More visible duplicate of the EIN line in .footer-bottom, placed right
   above the Candid badge since the one at the very bottom of the footer
   is easy to miss (small, low-contrast, far from the badge it relates to). */
.wfm-footer .footer-ein {
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    margin: -8px 0 12px;
}

/* Candid "Platinum Transparency" badge. Fixed width + height:auto (not the
   previous width:30%/height:35%) so the image keeps its real ~1:1 aspect
   ratio - a percentage height resolves against .footer-top's grid-row
   height here, which stretched/squished it out of shape, especially once
   the grid collapses to a single column on mobile. */
.wfm-footer .footer-badge {
    display: inline-block;
    margin-top: 4px;
}

.wfm-footer .footer-badge img {
    width: 110px;
    height: auto;
    display: block;
}

.wfm-footer .footer-contact {
    color: var(--wfm-blue-5);
    font-size: 14px;
}

.wfm-footer .footer-contact p { margin-bottom: 4px; }

.wfm-footer .footer-links h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #fff;
}

.wfm-footer .footer-links ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.wfm-footer .footer-links ul li { margin-bottom: 12px; }

.wfm-footer .footer-links a {
    color: var(--wfm-blue-5);
    text-decoration: none;
    font-size: 14px;
    transition: color .3s ease;
}

.wfm-footer .footer-links a:hover { color: #fff; }

.wfm-footer .social-icons {
    display: flex;
    gap: 5px;
}

.wfm-footer .social-icons a {
    width: 30px;
    height: 30px;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: border-radius .2s ease;
}

.wfm-footer .social-icons a:hover { border-radius: 50%; }

.wfm-footer .social-icons img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.wfm-footer .footer-bottom {
    text-align: center;
    color: var(--wfm-blue-5);
    font-size: 14px;
}

.wfm-footer .footer-bottom p { margin-bottom: 8px; }

@media (max-width: 968px) {
    .wfm-footer { padding: 60px 20px 20px; }
    .wfm-footer .footer-top { grid-template-columns: 1fr; gap: 40px; }
    .wfm-footer .footer-about h3 { font-size: 22px; }
}

@media (max-width: 767px) {
    .wfm-footer { padding: 40px 20px 24px; }

    .wfm-footer .footer-top {
        gap: 30px;
        margin-bottom: 28px;
        padding-bottom: 28px;
    }

    .wfm-footer .footer-about h3 { font-size: 20px; margin-bottom: 10px; }
    .wfm-footer .footer-about p { font-size: 14px; line-height: 1.6; margin-bottom: 0; }
    .wfm-footer .footer-badge { margin-top: 14px; }
    .wfm-footer .footer-badge img { width: 90px; }

    .wfm-footer .footer-links h4 { font-size: 15px; margin-bottom: 12px; }
    .wfm-footer .footer-links ul li { margin-bottom: 4px; }
    .wfm-footer .footer-links a {
        display: inline-block;
        padding: 6px 0;
        font-size: 13.5px;
    }

    .wfm-footer .footer-contact { font-size: 13.5px; }
    .wfm-footer .footer-contact p { line-height: 1.5; }

    .wfm-footer .social-icons { margin-top: 10px; }

    .wfm-footer .footer-bottom {
        margin-top: 8px;
        padding-top: 20px;
        border-top: 1px solid rgba(255, 255, 255, .12);
        font-size: 12.5px;
        line-height: 1.6;
    }
}

