/**
 * Section Scroll Navigation Bar Styles (Common across all pages)
 * Used by Block Party, Independence Day, Sounds of Summer, About Us, and Contact Us.
 *
 * @package Wilmette_events
 */

/* =========================================================================
   Top Wave Divider
   ========================================================================= */
.bp-scroll-nav-wave {
    position: relative;
    width: 100%;
    height: auto !important;
    margin-top: -115px;
    line-height: 0;
    pointer-events: none;
    z-index: 20;
    overflow: hidden;
    margin-bottom: -2px;
}

.bp-nav-wave-svg {
    display: block;
    width: 100%;
    height: auto !important;
    transform: none !important;
    -webkit-transform: none !important;
}

/* =========================================================================
   Sticky Horizontal Navigation Bar
   ========================================================================= */
.bp-scroll-nav-bar {
    position: -webkit-sticky !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 999 !important;
    width: 100%;
    background: var(--bp-nav-bg, #FBF6FC);
    box-shadow: 0 6px 5px 0 rgba(0, 0, 0, 0.10);
    box-sizing: border-box;
    /* Clean hardware rendering without transform desync/jitter on mobile */
    transform: none !important;
    -webkit-transform: none !important;
    will-change: auto !important;
    animation: none !important;
    transition: none !important;
}

/* Ensure all parent containers maintain visible overflow for rock-solid sticky positioning */
.site-main,
.sos-main,
.ind-main,
.about-main,
.contact-main,
.child-block-party {
    overflow: visible !important;
}

.bp-scroll-nav-bar .wilmette-container {
    overflow: visible;
}

/* When mobile menu drawer is open, ensure header is on top and scroll nav never overlaps drawer */
body.mobile-menu-open .wm-site-header {
    z-index: 999999 !important;
}

body.mobile-menu-open .bp-scroll-nav-bar {
    z-index: 0 !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Independence Day Page Specific Colors */
.page-template-independence-day .bp-scroll-nav-bar,
.page-template-independence-day-php .bp-scroll-nav-bar,
.ind-main .bp-scroll-nav-bar,
.ind-main~.bp-scroll-nav-bar,
body.page-id-independence-day .bp-scroll-nav-bar {
    --bp-nav-bg: #EAF6FF;
    --bp-nav-text: #0D1B3E;
    --bp-nav-hover: #EF2E42;
    --bp-nav-active-text: #EF2E42;
    --bp-nav-accent: #EF2E42;
}

/* Sounds of Summer Page Specific Colors */
.page-template-sounds-of-summer .bp-scroll-nav-bar,
.page-template-sounds-of-summer-php .bp-scroll-nav-bar,
.sos-main .bp-scroll-nav-bar,
.sos-main~.bp-scroll-nav-bar,
body.page-sounds-of-summer .bp-scroll-nav-bar {
    --bp-nav-bg: #FFF6E7;
    --bp-nav-text: #475569;
    --bp-nav-hover: #0F172A;
    --bp-nav-active-text: #241B67;
    --bp-nav-accent: #C0392B;
}

/* Contact & About Page Specific Colors */
.page-template-contact .bp-scroll-nav-bar,
.page-template-contact-php .bp-scroll-nav-bar,
.contact-main .bp-scroll-nav-bar,
.contact-main~.bp-scroll-nav-bar,
body.page-id-384 .bp-scroll-nav-bar,
body.page-template-contact .bp-scroll-nav-bar,
.page-template-about .bp-scroll-nav-bar,
.page-template-about-php .bp-scroll-nav-bar,
.about-main .bp-scroll-nav-bar,
.about-main~.bp-scroll-nav-bar,
body.page-id-387 .bp-scroll-nav-bar,
body.page-template-about .bp-scroll-nav-bar {
    --bp-nav-bg: #FAF7F2;
    --bp-nav-text: #1F2937;
    --bp-nav-hover: #D4462C;
    --bp-nav-active-text: #241B67;
    --bp-nav-accent: #D4462C;
    border-bottom: 1px solid #EBE4D8;
    position: -webkit-sticky !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 999 !important;
}

body.admin-bar .bp-scroll-nav-bar {
    top: 32px !important;
}

@media (min-width: 601px) and (max-width: 782px) {
    body.admin-bar .bp-scroll-nav-bar {
        top: 46px !important;
    }
}

@media (max-width: 600px) {

    /* On mobile, WordPress admin bar is position:absolute and scrolls out of view.
       Prevent empty gap above navbar. */
    body.admin-bar .bp-scroll-nav-bar {
        top: 0 !important;
    }
}

/* Ensure smooth native and JS anchor offset so sticky header does not overlap section headings */
.bp-anniversary-section,
.bp-new-event-section,
.bp-main-stage-section,
.bp-kids-section,
.local-food-vendors-section,
.map-getting-there-section,
.sponsorship-opportunities-section,
.bp-sponsors-section,
.volunteer-with-us-section,
.memories-made-together-section,
.who-to-contact-section,
.ind-event-overview-section,
.ind-event-block,
.ind-sponsors-section,
.ind-memories-section,
.ind-faq-section,
.ind-contact-section,
.sos-schedule-section,
.sos-kids-section,
.sos-locations-section,
.sos-weather-section,
.sos-sponsors-section,
.sos-guidelines-section,
.sos-gallery-section,
.sos-contact-section,
.section-find-contact,
.section-visit-us,
.section-quick-answers,
.section-sponsorship-opportunity,
.section-join-community,
.about-partners-principles-section,
.about-timeline-section,
.new-testimonial,
#lineup,
#the-2026-lineup,
#kids-concert,
#locations,
#locations-parking,
#weather-conditions,
#current-weather-conditions,
#sponsors,
#explore-sponsorship,
#event-guidelines,
#faqs,
#gallery,
#moments-gallery,
#photo-gallery,
#contact,
#contact-info,
#info-faq,
#find-a-contact,
#find-contact,
#visit-us,
#quick-answers,
#sponsorship-opportunity,
#join-community,
#who-we-are,
#partners,
#history,
#timeline,
#testimonial,
#testimonials,
#2026-yankee-doodle-dash-5k,
#star-spangled-splash,
#fun-fireworks,
#ind-sponsors,
#ind-memories,
#ind-faq,
#who-to-contact,
#bp-anniversary,
#bp-new-event,
#bp-main-stage,
#bp-kids,
#local-food-vendors,
#map-getting-there,
#sponsorship-opportunities,
#bp-sponsors,
#volunteer-with-us,
#memories-made-together {
    scroll-margin-top: 100px;
}

@media (max-width: 991px) {

    #lineup,
    #the-2026-lineup,
    #kids-concert,
    #locations,
    #locations-parking,
    #weather-conditions,
    #current-weather-conditions,
    #sponsors,
    #explore-sponsorship,
    #event-guidelines,
    #faqs,
    #gallery,
    #moments-gallery,
    #photo-gallery,
    #contact,
    #contact-info,
    #info-faq,
    #find-a-contact,
    #find-contact,
    #visit-us,
    #quick-answers,
    #sponsorship-opportunity,
    #join-community,
    #who-we-are,
    #partners,
    #history,
    #timeline,
    #testimonial,
    #testimonials,
    #2026-yankee-doodle-dash-5k,
    #star-spangled-splash,
    #fun-fireworks,
    #ind-sponsors,
    #ind-memories,
    #ind-faq,
    #who-to-contact,
    #bp-anniversary,
    #bp-new-event,
    #bp-main-stage,
    #bp-kids,
    #local-food-vendors,
    #map-getting-there,
    #sponsorship-opportunities,
    #bp-sponsors,
    #volunteer-with-us,
    #memories-made-together {
        scroll-margin-top: 60px;
    }
}

/* =========================================================================
   Scroll List — Centered Aligned & Spaced as per Block Party across All Pages
   ========================================================================= */
.bp-scroll-nav-list {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    list-style: none;
    margin: 0;
    padding: 0;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    width: 100%;
}

.about-main .bp-scroll-nav-list {
    justify-content: center;
}

@supports not (justify-content: safe center) {
    .bp-scroll-nav-list {
        justify-content: center;
    }
}

.bp-scroll-nav-item {
    flex-shrink: 0;
}

.bp-scroll-nav-link {
    font-family: var(--font-family-secondary, "Poppins", sans-serif);
    font-size: 14px;
    font-weight: 600;
    color: #131232;
    text-decoration: none !important;
    white-space: nowrap;
    padding: 8px 4px 12px 4px;
    position: relative;
    display: inline-block;
    transition: color 0.2s ease;
    padding: 30px 12px;
}

.bp-scroll-nav-link:hover {
    color: var(--bp-nav-hover, #f58220);
}

/* Active State with thick bottom accent indicator */
.bp-scroll-nav-link.active {
    color: #241B67;

}

.bp-scroll-nav-link.active::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background-color: var(--bp-nav-accent, #f58220);
    border-radius: 2px 2px 0 0;
}

.bp-scroll-nav-list {
    display: flex;
    align-items: center;
    /* justify-content: flex-start; */
    gap: 32px;

    list-style: none;
    margin: 0;
    padding: 0;

    width: 100%;
    max-width: 100%;
    min-width: 0;

    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;

    /* Hide scrollbar */
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;

    overscroll-behavior-x: contain;
    touch-action: pan-x pan-y;
    cursor: grab;
    user-select: none;
}

.bp-scroll-nav-list::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.bp-scroll-nav-list li {
    flex: 0 0 auto;
}

.bp-scroll-nav-list.is-dragging {
    cursor: grabbing;
    scroll-behavior: auto;
}

.bp-scroll-nav-list.is-dragging a {
    pointer-events: none;
}

/* On desktop when centered, no trailing spacer needed */
@media (min-width: 992px) {
    .bp-scroll-nav-list::after {
        display: none !important;
    }
}

/* =========================================================================
   Responsive Breakpoints
   ========================================================================= */
@media (max-width: 1280px) {
    .bp-scroll-nav-list {
        gap: 28px;
    }
}

@media (max-width: 1024px) {
    .bp-scroll-nav-wave {
        margin-top: -60px;
    }

    .bp-scroll-nav-list {
        gap: 24px;
    }
}

@media (max-width: 991px) {
    .bp-scroll-nav-bar {
        position: -webkit-sticky !important;
        position: sticky !important;
        top: 0 !important;
        z-index: 999 !important;
        transform: none !important;
        -webkit-transform: none !important;
        will-change: auto !important;
        animation: none !important;
        transition: none !important;
    }

    .bp-scroll-nav-list {
        display: flex;
        justify-content: center !important;
        flex-wrap: wrap;
    }

    /* More than 3 menu items */
    .bp-scroll-nav-list:has(> .bp-scroll-nav-item:nth-child(4)) {
        justify-content: flex-start !important;
        flex-wrap: nowrap;
    }

    .bp-scroll-nav-list::after {
        content: "";
        display: block;
        flex-shrink: 0;
        width: 32px;
        height: 1px;
    }

    .bp-scroll-nav-list::after {
        display: none !important;
    }
}

@media (max-width: 782px) {
    .bp-scroll-nav-wave {
        margin-top: -45px;
    }

    .bp-scroll-nav-list {
        gap: 20px;
        padding-top: 14px;
    }

    .bp-scroll-nav-list::after {
        width: 40px;
    }

    .bp-scroll-nav-link {
        font-size: 14px !important;
        padding: 10px !important;
    }
}

@media (max-width: 480px) {
    .bp-scroll-nav-wave {
        height: auto !important;
        margin-top: -20px !important;
    }

    .bp-scroll-nav-list {
        gap: 16px;
        padding-top: 10px;
    }
}