














{"id":44,"date":"2024-04-01T19:25:59","date_gmt":"2024-04-01T19:25:59","guid":{"rendered":"https:\/\/www.buddyupgo.com\/pinnacle-slate-homepage\/"},"modified":"2026-04-07T18:46:48","modified_gmt":"2026-04-07T18:46:48","slug":"pinnacle-slate-homepage","status":"publish","type":"page","link":"https:\/\/staging.buddyupgo.com\/","title":{"rendered":"Home"},"content":{"rendered":"<p><div class=\"buddyUpPjaxContainer\" data-buddyup-pjax-container=\"1\"><style>#buddyUpHomeLanding {\n    max-width: none;\n    margin: 0 auto;\n    padding: calc(env(safe-area-inset-top, 0px) + .6rem) .65rem calc(var(--buddyup-mobile-nav-height, 70px) + env(safe-area-inset-bottom, 0px) + 1rem);\n    --for-you-card-radius: 14px;\n    box-sizing: border-box;\n    overflow-x: clip;\n}\n\n.buddyUpHomeLandingAnonView.hidden,\n.buddyUpForYouView.hidden {\n    display: none;\n}\n\n.buddyUpOnboardingFlow {\n    --onboarding-radius: 14px;\n    min-height: 0;\n    display: grid;\n    grid-template-rows: minmax(0, 1fr) auto;\n    gap: .5rem;\n    padding: .55rem;\n    border: 1px solid rgba(0, 0, 0, .08);\n    border-radius: var(--onboarding-radius);\n    background: linear-gradient(160deg, #f3f8ff 0%, #ffffff 42%, #edf9f3 100%);\n    box-shadow: 0 10px 28px rgba(0, 0, 0, .08);\n    overflow: hidden;\n}\n\n.buddyUpOnboardingTopBar {\n    display: flex;\n    align-items: center;\n    justify-content: space-between;\n    gap: .5rem;\n    min-height: 36px;\n}\n\n.buddyUpOnboardingBrandWrap {\n    max-width: min(65vw, 190px);\n}\n\n.buddyUpOnboardingBrandWrap .buddyUpHomeLandingLogo {\n    width: 100%;\n    max-width: none;\n}\n\n.buddyUpOnboardingProgress {\n    display: none !important;\n}\n\n.buddyUpOnboardingDot {\n    width: 28px;\n    height: 28px;\n    border-radius: 999px;\n    border: 1px solid rgba(30, 72, 138, .22);\n    background: #fff;\n    color: #21457b;\n    margin: 0;\n    padding: 0;\n    font-size: .74rem;\n    font-weight: 700;\n    display: inline-flex;\n    align-items: center;\n    justify-content: center;\n    cursor: pointer;\n}\n\n.buddyUpOnboardingDot.isPast {\n    background: #e9f2ff;\n    border-color: rgba(30, 72, 138, .34);\n}\n\n.buddyUpOnboardingDot.isActive {\n    background: #1f67da;\n    border-color: #1f67da;\n    color: #fff;\n}\n\n.buddyUpOnboardingViewport {\n    position: relative;\n    overflow: hidden;\n    border: 1px solid rgba(0, 0, 0, .08);\n    border-radius: var(--onboarding-radius);\n    background: #fff;\n    min-height: 0;\n}\n\n.buddyUpOnboardingScreen {\n    position: absolute;\n    inset: 0;\n    opacity: 0;\n    z-index: 1;\n    pointer-events: none;\n    transition: opacity .26s ease;\n}\n\n.buddyUpOnboardingScreen.isActive {\n    opacity: 1;\n    z-index: 2;\n    pointer-events: auto;\n    animation: buddyUpTrailReveal .36s ease-out;\n}\n\n@keyframes buddyUpTrailReveal {\n    0% {\n        opacity: 0;\n        transform: translateY(10px) scale(.985);\n        filter: saturate(.92);\n    }\n    100% {\n        opacity: 1;\n        transform: translateY(0) scale(1);\n        filter: saturate(1);\n    }\n}\n\n.buddyUpOnboardingScreen.isHidden {\n    display: none;\n}\n\n.buddyUpOnboardingScreenBody {\n    height: 100%;\n    overflow-y: auto;\n    overflow-x: hidden;\n    padding: .3rem;\n    box-sizing: border-box;\n}\n\n.buddyUpOnboardingScreenCanvas {\n    width: min(1240px, 100%);\n    margin: 0 auto;\n}\n\n.buddyUpOnboardingScreen[data-screen=\"introduction\"] .buddyUpOnboardingScreenBody {\n    display: flex;\n    align-items: stretch;\n    overflow-y: auto;\n    overflow-x: hidden;\n}\n\n.buddyUpOnboardingScreen[data-screen=\"introduction\"] .buddyUpOnboardingScreenCanvas {\n    height: 100%;\n    display: flex;\n    align-items: stretch;\n}\n\n.buddyUpOnboardingScreen[data-screen=\"introduction\"] .hero-area {\n    width: 100%;\n    height: 100%;\n    display: flex;\n    align-items: flex-start;\n}\n\n.buddyUpOnboardingScreen[data-screen=\"introduction\"] .buddyUpOnboardingIntroLogoWrap {\n    margin-bottom: .5rem;\n}\n\n.buddyUpOnboardingScreen[data-screen=\"introduction\"] .buddyUpOnboardingIntroLogo {\n    width: min(220px, 62vw);\n    max-width: 100%;\n    height: auto;\n    display: block;\n}\n\n.buddyUpOnboardingScreen[data-screen=\"introduction\"] .buddyUpHomeLandingActions {\n    display: flex;\n    justify-content: flex-start;\n    align-items: center;\n    gap: .65rem;\n}\n\n.buddyUpOnboardingScreen[data-screen=\"introduction\"] .buddyUpHomeLandingActions .buddyUpButton1,\n.buddyUpOnboardingScreen[data-screen=\"introduction\"] .buddyUpHomeLandingActions .buddyUpButton3 {\n    margin-top: 0;\n    min-height: 44px;\n    line-height: 1.1;\n    display: inline-flex;\n    align-items: center;\n    justify-content: center;\n}\n\n.buddyUpOnboardingScreen[data-screen=\"explore\"] .buddyUpOnboardingScreenBody {\n    overflow: hidden;\n}\n\n.buddyUpOnboardingScreen[data-screen=\"explore\"] .buddyUpOnboardingScreenCanvas {\n    height: 100%;\n    display: grid;\n    grid-template-rows: auto minmax(0, 1fr);\n}\n\n.buddyUpOnboardingScreen[data-screen=\"explore\"] #buddyUpOnboardingExploreHost {\n    min-height: 0;\n    height: 100%;\n    display: flex;\n    overflow: hidden;\n}\n\n.buddyUpOnboardingScreen[data-screen=\"explore\"] #buddyUpOnboardingExploreHost > .buddyUpHomeLandingWidget {\n    width: 100%;\n    height: 100%;\n    min-height: 0;\n    display: flex;\n}\n\n.buddyUpOnboardingFooter {\n    display: flex;\n    justify-content: space-between;\n    align-items: center;\n    gap: .55rem;\n}\n\n.buddyUpOnboardingFlow[data-active-screen=\"introduction\"] .buddyUpOnboardingFooter {\n    display: none;\n}\n\n.buddyUpOnboardingFooter .buddyUpButton1,\n.buddyUpOnboardingFooter .buddyUpButton3 {\n    margin-top: 0;\n    min-width: 100px;\n}\n\n.buddyUpOnboardingExploreIntro {\n    text-align: center;\n    padding: .1rem 0 .45rem;\n}\n\n.buddyUpOnboardingExploreIntro h2 {\n    margin: 0 0 .2rem;\n    font-size: clamp(1.1rem, 2.6vw, 1.5rem);\n}\n\n.buddyUpOnboardingExploreIntro p {\n    margin: 0;\n    font-size: .9rem;\n    line-height: 1.35;\n}\n\n.buddyUpOnboardingExploreIntro .buddyUpButton3 {\n    margin-top: .45rem;\n}\n\n.buddyUpOnboardingExploreHost {\n    min-height: 1px;\n}\n\n.buddyUpOnboardingFlow .buddyUpHomeLandingWidget {\n    border-radius: 12px;\n    box-shadow: none;\n    border: 1px solid rgba(0, 0, 0, .08);\n}\n\n.buddyUpOnboardingFlow #buddyUpExploreWidget {\n    padding: .4rem;\n}\n\n.buddyUpOnboardingFlow .buddyUpExploreWidgetShell {\n    grid-template-columns: minmax(0, 1fr);\n    gap: .55rem;\n}\n\n.buddyUpOnboardingFlow .buddyUpExploreWidgetSidebar {\n    display: none;\n}\n\n.buddyUpOnboardingFlow .buddyUpExploreWidgetMap {\n    min-height: clamp(320px, 62dvh, 720px);\n}\n\n.buddyUpOnboardingFlow .buddyUpButton1,\n.buddyUpOnboardingFlow .buddyUpButton3 {\n    transition: transform .2s ease, box-shadow .2s ease;\n}\n\n.buddyUpOnboardingFlow .buddyUpButton1:hover,\n.buddyUpOnboardingFlow .buddyUpButton3:hover {\n    transform: translateY(-1px);\n    box-shadow: 0 6px 14px rgba(0, 0, 0, .12);\n}\n\n.buddyUpOnboardingFlow .buddyUpExploreWidgetTopbar {\n    margin-bottom: .35rem;\n}\n\n.buddyUpOnboardingFlow .buddyUpExploreWidgetTopbar h3 {\n    font-size: 1rem;\n}\n\n.buddyUpOnboardingFlow .hero-area,\n.buddyUpOnboardingFlow .three-steps-section,\n.buddyUpOnboardingFlow .event-section,\n.buddyUpOnboardingFlow .go-section,\n.buddyUpOnboardingFlow .pricing-wrap {\n    border-radius: 12px;\n}\n\n.buddyUpOnboardingFlow .hero-area {\n    background: linear-gradient(140deg, #f4f8ff 0%, #ffffff 45%, #edf9f2 100%);\n    padding: .9rem;\n}\n\n.buddyUpOnboardingFlow .hero-container {\n    display: grid;\n    grid-template-columns: minmax(0, 1fr) minmax(180px, 42%);\n    align-items: center;\n    gap: .9rem;\n}\n\n.buddyUpOnboardingFlow .hero-container .item h1 {\n    margin: 0 0 .5rem;\n    font-size: clamp(1.25rem, 3.2vw, 2.05rem);\n    line-height: 1.08;\n}\n\n.buddyUpOnboardingFlow .hero-container .item h1 span,\n.buddyUpOnboardingFlow .half-container .item2 h2 span,\n.buddyUpOnboardingFlow .pricing-heading span,\n.buddyUpOnboardingFlow .event-item h2 span,\n.buddyUpOnboardingFlow .go-item h2 span {\n    color: #e84310;\n}\n\n.buddyUpOnboardingFlow .hero-container .item p {\n    margin: 0 0 .45rem;\n    line-height: 1.34;\n    font-size: .95rem;\n}\n\n.buddyUpOnboardingFlow .category-flip-line {\n    margin: 0 0 .45rem;\n    font-size: .98rem;\n    line-height: 1.32;\n    color: #173b67;\n    font-weight: 700;\n}\n\n.buddyUpOnboardingFlow .category-flip {\n    display: inline-block;\n    min-width: 9ch;\n    color: #d4470f;\n    font-weight: 900;\n    text-transform: lowercase;\n    letter-spacing: .01em;\n    transition: opacity .2s ease, transform .2s ease, filter .2s ease;\n}\n\n.buddyUpOnboardingFlow .category-flip.is-swapping {\n    opacity: .16;\n    transform: translateY(4px);\n    filter: blur(.3px);\n}\n\n.buddyUpOnboardingFlow .hero-container .item img,\n.buddyUpOnboardingFlow .half-container .item-img img,\n.buddyUpOnboardingFlow .event-media-wrap img {\n    width: 100%;\n    max-height: min(36vh, 290px);\n    object-fit: contain;\n}\n\n.buddyUpOnboardingFlow .half-container {\n    display: grid;\n    grid-template-columns: minmax(170px, 42%) minmax(0, 1fr);\n    gap: .9rem;\n    align-items: center;\n    padding: .65rem;\n    background: #f6fbff;\n    border-radius: 12px;\n}\n\n.buddyUpOnboardingFlow .half-container .item2 h2 {\n    margin: 0 0 .35rem;\n    font-size: clamp(1.2rem, 2.8vw, 2rem);\n    line-height: 1.15;\n}\n\n.buddyUpOnboardingFlow .half-container .item2 p {\n    margin: 0 0 .45rem;\n    font-size: .95rem;\n    line-height: 1.35;\n}\n\n.buddyUpOnboardingFlow .subscriptions-heading {\n    font-size: .78rem;\n    color: #5b8e9f;\n    text-transform: uppercase;\n    letter-spacing: .15em;\n    font-weight: 900;\n    margin: 0 0 .3rem;\n}\n\n.buddyUpOnboardingFlow .three-steps-section {\n    background: #eee;\n    padding: .65rem;\n    text-align: center;\n}\n\n.buddyUpOnboardingFlow .three-steps-section h2 strong {\n    font-size: clamp(1.15rem, 2.9vw, 1.85rem);\n    line-height: 1.15;\n    font-weight: 900;\n}\n\n.buddyUpOnboardingFlow .feature-grid {\n    padding: .6rem .2rem 0;\n    background: transparent;\n}\n\n.buddyUpOnboardingFlow .feature-grid__cards {\n    display: grid;\n    grid-template-columns: repeat(3, minmax(0, 1fr));\n    gap: .55rem;\n    align-items: stretch;\n}\n\n.buddyUpOnboardingFlow .feature-card {\n    position: relative;\n    background: #fff;\n    border: 1px solid rgba(15, 23, 42, .1);\n    border-radius: 12px;\n    padding: .58rem;\n    box-shadow: 0 10px 24px rgba(0, 0, 0, .09);\n    overflow: hidden;\n}\n\n.buddyUpOnboardingFlow .feature-card::before {\n    content: \"\";\n    position: absolute;\n    top: 0;\n    left: 0;\n    right: 0;\n    height: 4px;\n    background: #d93f0c;\n    opacity: .85;\n}\n\n.buddyUpOnboardingFlow .feature-card__icon {\n    width: 44px;\n    height: 44px;\n    border-radius: 44px;\n    display: grid;\n    place-items: center;\n    margin: 0 auto .35rem;\n    background: #daedf2;\n    padding: 8px;\n}\n\n.buddyUpOnboardingFlow .feature-card__icon img {\n    width: 100%;\n    height: 100%;\n    object-fit: contain;\n}\n\n.buddyUpOnboardingFlow .feature-card__title {\n    margin: 0 0 .25rem;\n    font-size: 1rem;\n    letter-spacing: 0;\n    font-weight: 900;\n}\n\n.buddyUpOnboardingFlow .feature-card__text {\n    margin: 0;\n    color: #666;\n    line-height: 1.25;\n    font-size: .8rem;\n}\n\n.buddyUpOnboardingFlow .event-section,\n.buddyUpOnboardingFlow .go-section {\n    background: #5b8e9f;\n    padding: .7rem;\n}\n\n.buddyUpOnboardingFlow .event-container {\n    display: grid;\n    grid-template-columns: minmax(0, 1fr) minmax(180px, 40%);\n    gap: .85rem;\n    align-items: center;\n}\n\n.buddyUpOnboardingFlow .event-item {\n    text-align: left;\n    color: #fff;\n    font-size: .9rem;\n    line-height: 1.4;\n}\n\n.buddyUpOnboardingFlow .event-item h2 {\n    margin: .1rem 0 .35rem;\n    font-size: clamp(1.1rem, 2.7vw, 1.8rem);\n    line-height: 1.12;\n    font-weight: 900 !important;\n    color: #fff;\n}\n\n.buddyUpOnboardingScreen[data-screen=\"find-events\"] .event-item h2 {\n    font-size: clamp(1.35rem, 4.6vw, 2.1rem);\n    line-height: 1.08;\n}\n\n.buddyUpOnboardingFlow .event-title {\n    font-size: .75rem;\n    color: #c3d6dd;\n    text-transform: uppercase;\n    letter-spacing: .16em;\n    font-weight: 900;\n    margin: 0;\n}\n\n.buddyUpOnboardingFlow .event-item ul {\n    margin: .35rem 0 .55rem;\n}\n\n.buddyUpOnboardingFlow .event-item li {\n    line-height: 1.28;\n    font-size: .84rem;\n    margin-bottom: .2rem;\n}\n\n.buddyUpOnboardingFlow .event-item li:before {\n    color: #fcd183;\n}\n\n.buddyUpOnboardingFlow .pricing-wrap {\n    background: #f4f4f4;\n    padding: .7rem;\n}\n\n.buddyUpOnboardingFlow .pricing-header {\n    margin: 0 auto .45rem;\n    text-align: center;\n}\n\n.buddyUpOnboardingFlow .pricing-heading {\n    font-size: clamp(1.2rem, 3vw, 2rem);\n    font-weight: 900;\n    line-height: 1.1;\n    margin: 0;\n}\n\n.buddyUpOnboardingFlow .pricing-upgrade {\n    font-size: .88rem;\n    font-weight: 700;\n    color: #555;\n    margin: .35rem 0 0;\n}\n\n.buddyUpOnboardingFlow .plan-swipe {\n    display: none;\n    justify-content: center;\n    font-size: .78rem;\n    font-weight: 700;\n    opacity: .75;\n    margin: 0 0 .35rem;\n}\n\n.buddyUpOnboardingFlow .pricing-grid {\n    display: flex;\n    gap: .55rem;\n    justify-content: center;\n    padding-top: .4rem;\n}\n\n.buddyUpOnboardingFlow .plan {\n    background: #fff;\n    border-radius: 16px;\n    padding: .65rem;\n    width: 100%;\n    max-width: 300px;\n    box-shadow: 0 8px 20px rgba(0, 0, 0, .09);\n    position: relative;\n    display: flex;\n    flex-direction: column;\n}\n\n.buddyUpOnboardingFlow .plan img {\n    width: 38px;\n    height: 38px;\n}\n\n.buddyUpOnboardingFlow .plan h2 {\n    font-size: 1.2rem;\n    margin: .2rem 0 0;\n    font-weight: 900;\n}\n\n.buddyUpOnboardingFlow .plan-desc {\n    color: #666;\n    line-height: 1.3;\n    margin-bottom: .45rem;\n    font-size: .82rem;\n}\n\n.buddyUpOnboardingFlow .price {\n    font-size: 2rem;\n    font-weight: 900;\n    margin-bottom: .2rem;\n    line-height: 1;\n}\n\n.buddyUpOnboardingFlow .price sup {\n    font-size: 1rem;\n}\n\n.buddyUpOnboardingFlow .price span {\n    font-size: .9rem;\n    color: #555;\n    font-weight: 900;\n}\n\n.buddyUpOnboardingFlow .plan ul {\n    list-style: none;\n    margin: .3rem 0 .5rem;\n    flex-grow: 1;\n    margin-left: .5rem;\n}\n\n.buddyUpOnboardingFlow .plan li {\n    margin-bottom: .16rem;\n    font-size: .78rem;\n    font-weight: bold;\n    line-height: 1.26;\n    text-indent: -.35rem;\n}\n\n.buddyUpOnboardingFlow .lite {\n    text-indent: -.7rem;\n    font-weight: 400;\n    color: #666;\n    display: inline-block;\n}\n\n.buddyUpOnboardingFlow .plan li:before {\n    content: \"\u2713\";\n    margin-right: 8px;\n    color: #6ba7ba;\n    font-size: .72rem;\n}\n\n.buddyUpOnboardingFlow .popular-list li:before {\n    color: #e84310;\n}\n\n.buddyUpOnboardingFlow .plan-btn {\n    width: 100%;\n    border: 2px solid #6ba7ba;\n    background: white;\n    color: #6ba7ba;\n    border-radius: 9px;\n    padding: .56rem .45rem;\n    font-size: .82rem;\n    font-weight: 900;\n    cursor: pointer;\n    transition: .3s;\n    text-align: center;\n    text-decoration: none;\n    line-height: 1.1;\n}\n\n.buddyUpOnboardingFlow .plan-btn:hover {\n    background: #e84310;\n    color: #fff;\n    border-color: #e84310;\n}\n\n.buddyUpOnboardingFlow .plan.popular {\n    border: 3px solid #e84310;\n}\n\n.buddyUpOnboardingFlow .plan.popular .plan-btn {\n    background: #e84310;\n    color: #fff;\n    border-color: #e84310;\n}\n\n.buddyUpOnboardingFlow .plan.popular .badge {\n    position: absolute;\n    top: -13px;\n    left: 50%;\n    transform: translateX(-50%);\n    background: #e84310;\n    color: #fff;\n    padding: .2rem .55rem;\n    border-radius: 999px;\n    font-size: .63rem;\n    font-weight: bold;\n    white-space: nowrap;\n}\n\n.buddyUpOnboardingFlow .price-lock {\n    display: flex;\n    align-items: center;\n    gap: 4px;\n    margin-bottom: .35rem;\n    font-size: .72rem;\n    font-weight: 600;\n}\n\n.buddyUpOnboardingFlow .price-lock:before {\n    content: \"\ud83d\udd12\";\n    font-size: .74rem;\n    margin-right: 2px;\n}\n\n.buddyUpOnboardingFlow .free,\n.buddyUpOnboardingFlow .blu {\n    color: #6ba7ba;\n    gap: 0;\n    margin-top: .2rem;\n}\n\n.buddyUpOnboardingFlow .free:before {\n    content: \"\";\n}\n\n.buddyUpOnboardingFlow .go-item {\n    display: flex;\n    justify-content: center;\n    text-align: center;\n    flex-direction: column;\n    padding: 0;\n}\n\n.buddyUpOnboardingFlow .go-item p {\n    color: #cbd9dc;\n    font-size: .95rem;\n    margin: .3rem 0 0;\n}\n\n.buddyUpOnboardingFlow .go-item h2 {\n    margin: 0;\n    font-size: clamp(1.2rem, 3vw, 2rem);\n    line-height: 1.12;\n    font-weight: 900 !important;\n    color: #fff;\n}\n\n.buddyUpOnboardingFlow .buddyUpOnboardingCtaRow {\n    display: flex;\n    justify-content: center;\n    flex-wrap: wrap;\n    gap: .55rem;\n    margin-top: .65rem;\n}\n\n.buddyUpOnboardingFlow .buddyUpOnboardingCtaRow .buddyUpButton1,\n.buddyUpOnboardingFlow .buddyUpOnboardingCtaRow .buddyUpButton3 {\n    margin-top: 0;\n}\n\n@media (max-width: 1100px) {\n    .buddyUpOnboardingFlow .feature-grid__cards {\n        grid-template-columns: repeat(2, minmax(0, 1fr));\n    }\n}\n\n@media (max-width: 900px) {\n    .buddyUpOnboardingFlow .pricing-grid {\n        overflow-x: auto;\n        overflow-y: hidden;\n        justify-content: flex-start;\n        scroll-snap-type: x mandatory;\n        padding-bottom: .35rem;\n    }\n\n    .buddyUpOnboardingFlow .plan {\n        min-width: min(72vw, 260px);\n        max-width: min(72vw, 260px);\n        flex-shrink: 0;\n        scroll-snap-align: start;\n    }\n\n    .buddyUpOnboardingFlow .plan-swipe {\n        display: flex;\n    }\n\n    .buddyUpOnboardingFlow .event-container,\n    .buddyUpOnboardingFlow .hero-container,\n    .buddyUpOnboardingFlow .half-container {\n        grid-template-columns: 1fr;\n    }\n\n    .buddyUpOnboardingFlow .event-media-wrap,\n    .buddyUpOnboardingFlow .hero-container .item:last-child,\n    .buddyUpOnboardingFlow .half-container .item-img {\n        text-align: center;\n    }\n\n    .buddyUpOnboardingFlow .hero-container .item img,\n    .buddyUpOnboardingFlow .half-container .item-img img,\n    .buddyUpOnboardingFlow .event-media-wrap img {\n        max-height: min(24vh, 170px);\n    }\n}\n\n@media (max-width: 640px) {\n    .buddyUpOnboardingFlow {\n        padding: .45rem;\n    }\n\n    .buddyUpOnboardingScreenBody {\n        padding: .2rem;\n    }\n\n    .buddyUpOnboardingFlow .feature-grid__cards {\n        grid-template-columns: 1fr;\n    }\n\n    .buddyUpOnboardingFlow .pricing-heading {\n        font-size: 1.4rem;\n    }\n\n    .buddyUpOnboardingFlow .pricing-upgrade {\n        font-size: .78rem;\n    }\n\n    .buddyUpOnboardingFlow .event-item {\n        text-align: center;\n    }\n\n    .buddyUpOnboardingScreen[data-screen=\"introduction\"] .buddyUpHomeLandingActions {\n        flex-direction: column;\n        align-items: stretch;\n    }\n\n    .buddyUpOnboardingScreen[data-screen=\"introduction\"] .buddyUpHomeLandingActions .buddyUpButton1,\n    .buddyUpOnboardingScreen[data-screen=\"introduction\"] .buddyUpHomeLandingActions .buddyUpButton3 {\n        width: 100%;\n    }\n\n    .buddyUpOnboardingExploreIntro {\n        padding: 0 0 .2rem;\n    }\n\n    .buddyUpOnboardingExploreIntro h2 {\n        font-size: 1.15rem;\n        line-height: 1.22;\n        margin-bottom: .1rem;\n    }\n\n    .buddyUpOnboardingExploreIntro .buddyUpOnboardingExploreLead {\n        font-size: .88rem;\n        line-height: 1.26;\n    }\n\n    .buddyUpOnboardingExploreExternalLink {\n        display: none;\n    }\n\n    .buddyUpOnboardingFlow .buddyUpExploreWidgetMap {\n        min-height: clamp(350px, 66dvh, 760px);\n    }\n}\n\n@media (max-height: 760px) {\n    .buddyUpOnboardingFlow .hero-container .item h1 {\n        font-size: clamp(1.05rem, 2.8vw, 1.6rem);\n    }\n\n    .buddyUpOnboardingFlow .hero-container .item p,\n    .buddyUpOnboardingFlow .half-container .item2 p,\n    .buddyUpOnboardingFlow .event-item,\n    .buddyUpOnboardingFlow .go-item p {\n        font-size: .82rem;\n        line-height: 1.25;\n    }\n\n    .buddyUpOnboardingFlow .plan {\n        padding: .5rem;\n    }\n\n    .buddyUpOnboardingFlow .plan li {\n        font-size: .72rem;\n    }\n\n    .buddyUpOnboardingFlow .price {\n        font-size: 1.65rem;\n    }\n\n    .buddyUpOnboardingFlow .go-item h2,\n    .buddyUpOnboardingFlow .half-container .item2 h2 {\n        font-size: 1.05rem;\n    }\n\n    .buddyUpOnboardingScreen[data-screen=\"find-events\"] .event-item h2 {\n        font-size: 1.3rem;\n    }\n}\n\n@media (max-width: 1024px) {\n    .buddyUpOnboardingTopBar {\n        display: none;\n    }\n\n    .buddyUpOnboardingFlow {\n        grid-template-rows: 1fr auto;\n    }\n\n    body.buddyup-home-onboarding-active #buddyUpMobileBottomNav,\n    body.buddyup-home-onboarding-active #buddyUpMobileTopHeader {\n        display: none !important;\n    }\n}\n\nbody.buddyup-home-onboarding-active {\n    overflow: hidden;\n    padding-top: 0 !important;\n    padding-bottom: 0 !important;\n}\n\nbody.buddyup-home-onboarding-active > footer,\nbody.buddyup-home-onboarding-active .footerTheme3 {\n    display: none !important;\n}\n\nbody.buddyup-home-onboarding-active #buddyUpHomeLanding {\n    height: 100dvh;\n    min-height: 100dvh;\n    padding: calc(env(safe-area-inset-top, 0px) + .35rem) .45rem calc(env(safe-area-inset-bottom, 0px) + .45rem);\n    overflow: hidden;\n}\n\nbody.buddyup-home-onboarding-active .buddyUpOnboardingFlow {\n    height: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - .9rem);\n    min-height: 0;\n}\n\n@media (min-width: 1025px) {\n    body.buddyup-home-onboarding-active {\n        overflow-x: hidden;\n        overflow-y: auto;\n    }\n\n    body.buddyup-home-onboarding-active #buddyUpHomeLanding {\n        min-height: 100dvh;\n        height: auto;\n        overflow: visible;\n        padding: 0;\n    }\n\n    body.buddyup-home-onboarding-active .buddyUpHomeLandingAnonView {\n        min-height: 100dvh;\n        display: flex;\n    }\n\n    body.buddyup-home-onboarding-active .buddyUpOnboardingFlow {\n        width: 100%;\n        min-height: 100dvh;\n        height: auto;\n        gap: 0;\n        padding: 0;\n        border: 0;\n        border-radius: 0;\n        box-shadow: none;\n    }\n\n    body.buddyup-home-onboarding-active .buddyUpOnboardingViewport {\n        border: 0;\n        border-radius: 0;\n        min-height: 0;\n    }\n\n    body.buddyup-home-onboarding-active .buddyUpOnboardingScreen[data-screen=\"introduction\"] .buddyUpOnboardingScreenBody {\n        overflow-y: auto;\n        overflow-x: hidden;\n    }\n\n    body.buddyup-home-onboarding-active .buddyUpOnboardingScreen[data-screen=\"introduction\"] .buddyUpOnboardingScreenCanvas {\n        min-height: 100%;\n        height: auto;\n    }\n\n    body.buddyup-home-onboarding-active .buddyUpOnboardingScreen[data-screen=\"introduction\"] .hero-area {\n        height: auto;\n        min-height: 100%;\n        align-items: flex-start;\n    }\n}\n\n@media (min-width: 1025px) and (max-height: 900px) {\n    body.buddyup-home-onboarding-active .buddyUpOnboardingScreen[data-screen=\"introduction\"] .buddyUpOnboardingScreenBody,\n    body.buddyup-home-onboarding-active .buddyUpOnboardingScreen[data-screen=\"explore\"] .buddyUpOnboardingScreenBody {\n        overflow-y: auto;\n        overflow-x: hidden;\n    }\n\n    body.buddyup-home-onboarding-active .buddyUpOnboardingScreen[data-screen=\"explore\"] #buddyUpOnboardingExploreHost {\n        overflow: auto;\n    }\n}\n\n.buddyUpHomeLandingHero {\n    background: linear-gradient(145deg, #f2f8ff 0%, #ffffff 46%, #eefbf7 100%);\n    border: 1px solid rgba(0, 0, 0, .08);\n    border-radius: 14px;\n    box-shadow: 0 14px 30px rgba(0, 0, 0, .08);\n    padding: 1rem;\n    margin-bottom: 1rem;\n    display: flex;\n    justify-content: center;\n}\n\n.buddyUpHomeLandingHeroInner {\n    width: min(760px, 100%);\n    text-align: left;\n}\n\n.buddyUpHomeLandingLogoWrap {\n    text-align: center;\n    margin: 0 0 .65rem;\n}\n\n.buddyUpHomeLandingLogo {\n    max-width: 240px;\n    width: min(78vw, 240px);\n    height: auto;\n}\n\n.buddyUpHomeLandingHero h1 {\n    margin: 0 0 .45rem;\n    line-height: 1.18;\n}\n\n.buddyUpHomeLandingLead {\n    margin: 0;\n    max-width: 65ch;\n    line-height: 1.45;\n}\n\n.buddyUpHomeLandingActions {\n    display: flex;\n    flex-wrap: wrap;\n    gap: .6rem;\n    margin-top: 1rem;\n}\n\n.buddyUpHomeLandingWidget {\n    background: #fff;\n    border: 1px solid rgba(0, 0, 0, .08);\n    border-radius: 14px;\n    box-shadow: 0 8px 22px rgba(0, 0, 0, .06);\n    overflow: hidden;\n}\n\n.buddyUpForYouView {\n    display: grid;\n    gap: .8rem;\n    min-width: 0;\n}\n\n.buddyUpHomeModeTabs {\n    display: inline-flex;\n    align-items: center;\n    gap: .35rem;\n    width: fit-content;\n    max-width: 100%;\n    padding: .22rem;\n    border-radius: 999px;\n    border: 1px solid rgba(0, 0, 0, .1);\n    background: rgba(255, 255, 255, .92);\n    box-shadow: 0 8px 18px rgba(0, 0, 0, .08);\n}\n\n.buddyUpHomeModeTab {\n    border: 0;\n    border-radius: 999px;\n    background: transparent;\n    color: #234770;\n    padding: .4rem .92rem;\n    font-weight: 800;\n    font-size: .86rem;\n    line-height: 1;\n    min-height: 44px;\n    cursor: pointer;\n    transition: background .2s ease, color .2s ease, transform .2s ease, box-shadow .2s ease;\n}\n\n.buddyUpHomeModeTab:hover {\n    transform: translateY(-1px);\n}\n\n.buddyUpHomeModeTab.isActive {\n    background: linear-gradient(135deg, #255fbd 0%, #1e74d1 100%);\n    color: #fff;\n    box-shadow: 0 8px 16px rgba(31, 96, 185, .32);\n}\n\n.buddyUpHomeModePanel {\n    display: none;\n}\n\n.buddyUpHomeModePanel.isActive {\n    display: block;\n    animation: buddyUpHomePanelFade .24s ease;\n}\n\n.buddyUpHomeModePanel[data-home-mode-panel=\"for-you\"].isActive {\n    display: grid;\n    gap: .8rem;\n}\n\n@keyframes buddyUpHomePanelFade {\n    from {\n        opacity: 0;\n        transform: translateY(5px);\n    }\n    to {\n        opacity: 1;\n        transform: translateY(0);\n    }\n}\n\n.buddyUpForYouStatus {\n    font-size: .92rem;\n    opacity: .84;\n    margin: 0;\n    padding: 0 .15rem;\n}\n\n.buddyUpComprehensiveFeed {\n    background: #fff;\n    border: 1px solid rgba(0, 0, 0, .08);\n    border-radius: var(--for-you-card-radius);\n    box-shadow: 0 8px 20px rgba(0, 0, 0, .06);\n    padding: .7rem;\n}\n\n.buddyUpComprehensiveFeedHead {\n    margin-bottom: .25rem;\n}\n\n.buddyUpComprehensiveFeedLead {\n    margin: 0 0 .65rem;\n    font-size: .9rem;\n    opacity: .88;\n    line-height: 1.4;\n}\n\n.buddyUpComprehensiveExploreHost {\n    min-height: 2.5rem;\n}\n\n.buddyUpComprehensiveExploreHost > .buddyUpPjaxContainer {\n    margin: 0;\n    padding-bottom: 0 !important;\n}\n\n.buddyUpForYouRail {\n    background: #fff;\n    border: 1px solid rgba(0, 0, 0, .08);\n    border-radius: var(--for-you-card-radius);\n    box-shadow: 0 8px 20px rgba(0, 0, 0, .06);\n    padding: .7rem;\n    min-width: 0;\n    box-sizing: border-box;\n}\n\n.buddyUpForYouRailHead {\n    display: flex;\n    flex-direction: column;\n    justify-content: flex-start;\n    align-items: flex-start;\n    gap: .35rem;\n    margin-bottom: .55rem;\n}\n\n.buddyUpForYouRailHead h2 {\n    margin: 0;\n    font-size: 1.08rem;\n}\n\n.buddyUpForYouRailTrack {\n    display: grid;\n    grid-auto-flow: column;\n    grid-auto-columns: minmax(82vw, 82vw);\n    gap: .66rem;\n    overflow-x: auto;\n    padding: 0 .05rem .35rem;\n    scroll-snap-type: x mandatory;\n    scroll-padding-left: .05rem;\n    overscroll-behavior-x: contain;\n    -webkit-overflow-scrolling: touch;\n    touch-action: pan-x;\n    min-width: 0;\n    max-width: 100%;\n    box-sizing: border-box;\n}\n\n.buddyUpForYouRailTrack > .buddyUpForYouRailCard:nth-child(n + 4) {\n    display: none;\n}\n\n.buddyUpForYouRailCard {\n    border: 1px solid rgba(0, 0, 0, .1);\n    border-radius: 12px;\n    overflow: hidden;\n    background: #fff;\n    color: inherit;\n    text-decoration: none;\n    display: flex;\n    flex-direction: column;\n    min-height: 228px;\n    min-width: 0;\n    scroll-snap-align: start;\n    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;\n    box-sizing: border-box;\n}\n\n.buddyUpForYouRailCard:hover {\n    transform: translateY(-2px);\n    box-shadow: 0 10px 18px rgba(0, 0, 0, .14);\n    border-color: rgba(32, 90, 180, .35);\n}\n\n.buddyUpForYouRailCardMedia {\n    height: 144px;\n    width: 100%;\n    object-fit: cover;\n    background: #e2ebf8;\n}\n\n.buddyUpForYouRailCardBody {\n    padding: .66rem .68rem .78rem;\n    display: grid;\n    gap: .34rem;\n}\n\n.buddyUpForYouRailCardTitle {\n    font-size: .96rem;\n    line-height: 1.28;\n    font-weight: 700;\n    overflow-wrap: anywhere;\n}\n\n.buddyUpForYouRailCardMeta {\n    font-size: .82rem;\n    opacity: .82;\n    line-height: 1.28;\n    overflow-wrap: anywhere;\n}\n\n.buddyUpForYouRailCardScore {\n    margin-top: .2rem;\n    font-size: .76rem;\n    font-weight: 700;\n    color: #226f45;\n}\n\n.buddyUpForYouEmpty {\n    border: 1px dashed rgba(0, 0, 0, .18);\n    border-radius: 10px;\n    padding: .9rem;\n    font-size: .88rem;\n    opacity: .86;\n}\n\n.buddyup-home-landing-anon #buddyUpTopNav {\n    display: none !important;\n}\n\n@media (max-width: 480px) {\n    #buddyUpHomeLanding {\n        padding-left: .45rem;\n        padding-right: .45rem;\n    }\n\n    .buddyUpHomeLandingHero,\n    .buddyUpForYouRail,\n    .buddyUpHomeLandingWidget {\n        border-radius: 12px;\n    }\n\n    .buddyUpHomeModeTabs {\n        width: 100%;\n        justify-content: space-between;\n    }\n\n    .buddyUpHomeModeTab {\n        flex: 1;\n        text-align: center;\n        padding: .44rem .55rem;\n    }\n\n    .buddyUpForYouRailTrack {\n        grid-auto-flow: row;\n        grid-template-columns: 1fr;\n        grid-auto-columns: unset;\n        overflow: visible;\n        padding: 0;\n        scroll-snap-type: none;\n        scroll-padding-left: 0;\n        overscroll-behavior-x: auto;\n        -webkit-overflow-scrolling: auto;\n        touch-action: auto;\n    }\n\n    .buddyUpForYouRailCard {\n        min-height: 0;\n    }\n}\n\n@media (min-width: 481px) and (max-width: 680px) {\n    .buddyUpForYouRailTrack {\n        grid-auto-flow: row;\n        grid-template-columns: repeat(2, minmax(0, 1fr));\n        grid-auto-columns: unset;\n        overflow: visible;\n        padding: 0;\n        scroll-snap-type: none;\n        scroll-padding-left: 0;\n        overscroll-behavior-x: auto;\n        -webkit-overflow-scrolling: auto;\n        touch-action: auto;\n        align-items: stretch;\n    }\n\n    .buddyUpForYouRailCard {\n        min-height: 100%;\n    }\n\n    .buddyUpForYouRailCardMedia {\n        height: 108px;\n    }\n\n    .buddyUpForYouRailCardTitle {\n        font-size: .88rem;\n    }\n\n    .buddyUpForYouRailCardMeta {\n        font-size: .76rem;\n    }\n}\n\n@media (min-width: 681px) and (max-width: 1024px) {\n    #buddyUpHomeLanding {\n        padding: .9rem .9rem 1.7rem;\n    }\n\n    .buddyUpForYouRailHead {\n        flex-direction: row;\n        justify-content: space-between;\n        align-items: center;\n        gap: .6rem;\n    }\n\n    .buddyUpForYouRailTrack {\n        grid-auto-flow: row;\n        grid-template-columns: repeat(3, minmax(0, 1fr));\n        grid-auto-columns: unset;\n        overflow: visible;\n        padding: 0;\n        scroll-snap-type: none;\n        scroll-padding-left: 0;\n        overscroll-behavior-x: auto;\n        -webkit-overflow-scrolling: auto;\n        touch-action: auto;\n        align-items: stretch;\n    }\n\n    .buddyUpForYouRailTrack > .buddyUpForYouRailCard:nth-child(n + 4) {\n        display: none;\n    }\n\n    .buddyUpForYouRailCard {\n        min-height: 100%;\n    }\n\n    .buddyUpForYouRailCardMedia {\n        height: 118px;\n    }\n}\n\n@media (min-width: 1025px) {\n    #buddyUpHomeLanding {\n        padding: 1rem 1rem 2rem;\n    }\n\n    .buddyUpHomeLandingHero {\n        padding: 1.5rem;\n    }\n\n    .buddyUpHomeLandingLogo {\n        max-width: 320px;\n        width: min(70vw, 320px);\n    }\n\n    .buddyUpForYouRail {\n        padding: .75rem;\n    }\n\n    .buddyUpForYouRailHead {\n        flex-direction: row;\n        justify-content: space-between;\n        align-items: center;\n        gap: .6rem;\n    }\n\n    .buddyUpForYouRailTrack {\n        grid-auto-columns: minmax(220px, 1fr);\n        padding-bottom: .3rem;\n    }\n\n    .buddyUpForYouRailTrack > .buddyUpForYouRailCard:nth-child(n + 4) {\n        display: flex;\n    }\n\n    .buddyUpForYouRailCard {\n        min-height: 248px;\n    }\n\n    .buddyUpForYouRailCardMedia {\n        height: 128px;\n    }\n}\n\n<\/style>\n<section id=\"buddyUpHomeLanding\" class=\"buddyUpContainer\">\n    <div class=\"buddyUpHomeLandingAnonView\">\n        <div id=\"buddyUpOnboardingFlow\" class=\"buddyUpOnboardingFlow\" data-show-explore=\"0\" data-active-screen=\"introduction\">\n            <div class=\"buddyUpOnboardingViewport\" aria-live=\"polite\">\n                <article class=\"buddyUpOnboardingScreen isActive\" data-screen=\"introduction\" data-title=\"Introduction\">\n    <div class=\"buddyUpOnboardingScreenBody\">\n        <div class=\"buddyUpOnboardingScreenCanvas\">\n            <div class=\"hero-area\">\n                <div class=\"hero-container\">\n                    <div class=\"item\">\n                        <div class=\"buddyUpOnboardingIntroLogoWrap\">\n                            <img decoding=\"async\" src=\"https:\/\/staging.buddyupgo.com\/wp-content\/uploads\/buddyupgo-logo.png\" alt=\"My WordPress\" class=\"buddyUpOnboardingIntroLogo\" \/>\n                        <\/div>\n\n                        <h1>\n                            <strong>\n                                Every Great<br \/>Adventure<br \/>Starts With A<br \/><span>Buddy<\/span>\n                            <\/strong>\n                        <\/h1>\n                        <p>\n                            Connect with like-minded recreation enthusiasts nationwide!\n                        <\/p>\n\n                        <p class=\"category-flip-line\">Find your next <span class=\"category-flip\">adventure<\/span> buddy.<\/p>\n\n                        <div class=\"buddyUpHomeLandingActions\">\n                            <a href=\"https:\/\/staging.buddyupgo.com\/register\/?dest=for-you&#038;src=introduction\" class=\"buddyUpButton1\" data-register-destination=\"for-you\" data-register-source=\"introduction\">Create Profile<\/a>\n                            <a href=\"https:\/\/staging.buddyupgo.com\/login\/\" class=\"buddyUpButton3\">Login<\/a>\n                            <button type=\"button\" class=\"buddyUpButton3\" data-onboarding-action=\"see-how\">See How It Works<\/button>\n                        <\/div>\n                    <\/div>\n                    <div class=\"item\">\n                        <img decoding=\"async\" src=\"https:\/\/staging.buddyupgo.com\/wp-content\/uploads\/hero-layer.webp\" alt=\"Adventure hero\" \/>\n                    <\/div>\n                <\/div>\n            <\/div>\n        <\/div>\n    <\/div>\n<\/article>\n<article class=\"buddyUpOnboardingScreen\" data-screen=\"explore\" data-title=\"Explore\" data-optional=\"1\">\n    <div class=\"buddyUpOnboardingScreenBody\">\n        <div class=\"buddyUpOnboardingScreenCanvas\">\n            <div class=\"buddyUpOnboardingExploreIntro\">\n                <p class=\"subscriptions-heading\">See It In Action<\/p>\n                <h2>Explore Nearby Momentum<\/h2>\n                <p class=\"buddyUpOnboardingExploreLead\">Preview real adventures, events, groups, and people before you join.<\/p>\n                <a href=\"https:\/\/staging.buddyupgo.com\/register\/?dest=explore&#038;src=explore\" class=\"buddyUpButton3 buddyUpOnboardingExploreExternalLink\" data-register-destination=\"explore\" data-register-source=\"explore\">Open Full Explore Map<\/a>\n            <\/div>\n            <div id=\"buddyUpOnboardingExploreHost\" class=\"buddyUpOnboardingExploreHost\">\n                <div class=\"buddyUpHomeLandingWidget\">\n                    <div class=\"buddyUpPjaxContainer\" data-buddyup-pjax-container=\"1\"><style>#buddyUpExploreWidget {\n    padding: .6rem;\n}\n\n.buddyUpExploreWidgetTopbar {\n    display: flex;\n    justify-content: space-between;\n    align-items: center;\n    gap: .8rem;\n    flex-wrap: wrap;\n    margin-bottom: .5rem;\n}\n\n.buddyUpExploreWidgetTopbar h3 {\n    margin: .2rem 0;\n}\n\n.buddyUpExploreWidgetActions {\n    display: flex;\n    gap: .55rem;\n    align-items: center;\n    flex-wrap: wrap;\n}\n\n.buddyUpExploreWidget,\n.buddyUpExploreWidgetShell,\n.buddyUpExploreWidgetMain,\n.buddyUpExploreWidgetPanel,\n.buddyUpExploreWidgetMapWrap,\n.buddyUpExploreWidgetMapShell {\n    min-width: 0;\n}\n\n.buddyUpExploreWidgetFiltersToggle {\n    margin: 0;\n    display: none;\n    max-width: 100%;\n    align-items: center;\n    gap: .4rem;\n}\n\n.buddyUpExploreWidgetModes {\n    display: flex;\n    background: #edf2fb;\n    border-radius: 999px;\n    padding: .22rem;\n    max-width: 100%;\n    overflow-x: auto;\n    -webkit-overflow-scrolling: touch;\n    scrollbar-width: none;\n}\n\n.buddyUpExploreWidgetModes::-webkit-scrollbar {\n    display: none;\n}\n\n.buddyUpExploreWidgetMode {\n    border: none;\n    background: transparent;\n    border-radius: 999px;\n    padding: .38rem .76rem;\n    font-weight: 700;\n    font-size: .84rem;\n    cursor: pointer;\n    margin: 0;\n    color: #2a3b5f;\n    white-space: nowrap;\n    flex: 0 0 auto;\n}\n\n.buddyUpExploreWidgetMode.isActive {\n    background: #1d5fd0;\n    color: #fff;\n}\n\n.buddyUpExploreWidgetStatus {\n    opacity: .85;\n    margin: .15rem 0 .5rem;\n    font-size: .92rem;\n}\n\n.buddyUpExploreWidgetShell {\n    display: grid;\n    grid-template-columns: 280px minmax(0, 1fr);\n    gap: .75rem;\n    align-items: stretch;\n}\n\n.buddyUpExploreWidgetSidebar {\n    border: 1px solid rgba(11, 37, 91, .14);\n    border-radius: 12px;\n    background: linear-gradient(180deg, #f6f9ff 0%, #eef4ff 100%);\n    padding: .7rem;\n    display: flex;\n    flex-direction: column;\n    gap: .6rem;\n}\n\n.buddyUpExploreWidgetFilterCard {\n    background: #fff;\n    border: 1px solid rgba(12, 50, 120, .1);\n    border-radius: 10px;\n    padding: .6rem;\n}\n\n.buddyUpExploreWidgetFilterCard label,\n.buddyUpExploreWidgetFilterHeading {\n    font-size: .86rem;\n    font-weight: 700;\n    display: block;\n    margin-bottom: .35rem;\n}\n\n.buddyUpExploreWidgetFilterCard input[type=\"text\"] {\n    width: 100%;\n    margin: 0;\n}\n\n.buddyUpExploreWidgetPills {\n    display: flex;\n    flex-wrap: wrap;\n    gap: .35rem;\n}\n\n.buddyUpExploreWidgetPill {\n    border: 1px solid rgba(14, 56, 129, .2);\n    background: #f3f8ff;\n    color: #214278;\n    font-size: .74rem;\n    line-height: 1.2;\n    padding: .3rem .55rem;\n    border-radius: 999px;\n    cursor: pointer;\n    font-weight: 700;\n}\n\n.buddyUpExploreWidgetPill.isActive {\n    background: #1d5fd0;\n    border-color: #1d5fd0;\n    color: #fff;\n}\n\n.buddyUpExploreWidgetRangeRow {\n    display: flex;\n    align-items: center;\n    gap: .4rem;\n    margin-bottom: .35rem;\n}\n\n.buddyUpExploreWidgetRangeRow input[type=\"range\"] {\n    margin: 0;\n    flex: 1;\n}\n\n.buddyUpExploreWidgetJoinCta {\n    width: 100%;\n    text-align: center;\n}\n\n.buddyUpExploreWidgetMapShell {\n    position: relative;\n}\n\n.buddyUpExploreWidgetMap {\n    width: 100%;\n    max-width: 100%;\n    min-height: min(68vh, 760px);\n    border-radius: 12px;\n    border: 1px solid rgba(12, 50, 120, .16);\n    overflow: hidden;\n}\n\n#buddyUpExploreWidget.buddyUpExploreWidgetShelfMode .buddyUpExploreWidgetShell {\n    grid-template-columns: minmax(0, 1fr);\n}\n\n#buddyUpExploreWidget.buddyUpExploreWidgetShelfMode .buddyUpExploreWidgetFiltersToggle {\n    display: inline-flex;\n}\n\n#buddyUpExploreWidget.buddyUpExploreWidgetShelfMode .buddyUpExploreWidgetSidebar {\n    display: none;\n}\n\n#buddyUpExploreWidget.buddyUpExploreWidgetShelfMode .buddyUpExploreWidgetSidebar.isOpen,\n#buddyUpExploreWidget.buddyUpExploreWidgetShelfMode .buddyUpExploreWidgetSidebar.activeMobileMenu {\n    position: fixed;\n    top: calc(var(--buddyup-mobile-header-height, 56px) + var(--buddyup-mobile-safe-top, 0px) + 8px);\n    left: 0;\n    width: min(380px, calc(100vw - 16%));\n    max-width: calc(100vw - 16%);\n    height: calc(100dvh - var(--buddyup-mobile-header-height, 56px) - var(--buddyup-mobile-nav-offset, 70px) - var(--buddyup-mobile-safe-top, 0px) - 16px);\n    max-height: calc(100dvh - var(--buddyup-mobile-header-height, 56px) - var(--buddyup-mobile-nav-offset, 70px) - var(--buddyup-mobile-safe-top, 0px) - 16px);\n    border-radius: 0 14px 14px 0;\n    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25);\n    background: #fff;\n    z-index: 9999;\n    padding: .95rem .8rem;\n    overflow-y: auto;\n    transform: translateX(0);\n    transition: transform .24s ease;\n    flex-direction: column;\n    gap: .85rem;\n    touch-action: pan-y;\n    display: flex !important;\n}\n\n.buddyUpOnboardingFlow #buddyUpExploreWidget.buddyUpExploreWidgetShelfMode {\n    display: grid;\n    grid-template-rows: auto auto minmax(0, 1fr);\n    height: 100%;\n    min-height: 0;\n}\n\n.buddyUpOnboardingFlow #buddyUpExploreWidget.buddyUpExploreWidgetShelfMode .buddyUpExploreWidgetTopbar,\n.buddyUpOnboardingFlow #buddyUpExploreWidget.buddyUpExploreWidgetShelfMode .buddyUpExploreWidgetStatus {\n    flex: 0 0 auto;\n}\n\n.buddyUpOnboardingFlow #buddyUpExploreWidget.buddyUpExploreWidgetShelfMode .buddyUpExploreWidgetShell,\n.buddyUpOnboardingFlow #buddyUpExploreWidget.buddyUpExploreWidgetShelfMode .buddyUpExploreWidgetMapShell {\n    height: 100%;\n    min-height: 0;\n}\n\n.buddyUpOnboardingFlow #buddyUpExploreWidget.buddyUpExploreWidgetShelfMode .buddyUpExploreWidgetMap {\n    height: 100%;\n    min-height: clamp(340px, 64dvh, 780px);\n}\n\n#buddyUpFiltersShelfOverlay.buddyUpExploreWidgetOverlayPassive,\nbody.buddyup-explore-widget-shelf-open #buddyUpFiltersShelfOverlay {\n    pointer-events: none !important;\n}\n\n.buddyUpExploreWidgetMapLoading {\n    position: absolute;\n    inset: 0;\n    z-index: 450;\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    background: rgba(255, 255, 255, .74);\n    border-radius: 12px;\n}\n\n.buddyUpExploreWidgetMapLoadingInner {\n    display: inline-flex;\n    align-items: center;\n    gap: .55rem;\n    background: rgba(255, 255, 255, .97);\n    border: 1px solid rgba(12, 50, 120, .22);\n    border-radius: 999px;\n    padding: .45rem .75rem;\n    color: #1f3656;\n    font-weight: 700;\n}\n\n.buddyUpExploreWidgetSpinner {\n    width: 16px;\n    height: 16px;\n    border-radius: 50%;\n    border: 2px solid rgba(31, 54, 86, .25);\n    border-top-color: #1d5fd0;\n    animation: buddyUpExploreWidgetSpin .7s linear infinite;\n}\n\n@keyframes buddyUpExploreWidgetSpin {\n    to { transform: rotate(360deg); }\n}\n\n.buddyUpExploreWidgetPin {\n    width: 20px;\n    height: 20px;\n    position: relative;\n    transform: rotate(-45deg);\n    border-radius: 50% 50% 50% 0;\n    border: 2px solid rgba(255, 255, 255, .96);\n    box-shadow: 0 4px 10px rgba(0, 0, 0, .25);\n    background: #1d5fd0;\n}\n\n.buddyUpExploreWidgetPin::before {\n    content: '';\n    position: absolute;\n    inset: 4px;\n    border-radius: 50%;\n    background: rgba(255, 255, 255, .98);\n}\n\n.buddyUpExploreWidgetPin.pin-events {\n    background: #d47a00;\n}\n\n.buddyUpExploreWidgetPin.pin-groups {\n    background: #2d7a4f;\n}\n\n.buddyUpExploreWidgetPin.pin-users {\n    background: #7a4bb9;\n}\n\n\n.buddyUpExploreWidgetImagePinWrap {\n    background: transparent;\n    border: 0;\n}\n\n.buddyUpExploreWidgetImagePin {\n    width: 64px;\n    height: 64px;\n    border-radius: 18px;\n    overflow: hidden;\n    border: 3px solid #fff;\n    box-shadow: 0 8px 22px rgba(0, 0, 0, .22);\n    background: #f4f4f4;\n    position: relative;\n    transform: translateY(-2px);\n}\n\n.buddyUpExploreWidgetImagePin img {\n    width: 100%;\n    height: 100%;\n    object-fit: cover;\n}\n\n.buddyUpExploreWidgetImagePinDot {\n    position: absolute;\n    left: 50%;\n    bottom: -10px;\n    transform: translateX(-50%);\n    width: 14px;\n    height: 14px;\n    border-radius: 50%;\n    background: var(--primary-color, #D93F0c);\n    border: 2px solid #fff;\n    box-shadow: 0 3px 8px rgba(0, 0, 0, .22);\n}\n\n.buddyUpExploreWidgetPopup .leaflet-popup-content-wrapper {\n    border-radius: 16px;\n    box-shadow: 0 14px 32px rgba(0, 0, 0, .22);\n    padding: 0;\n}\n\n.buddyUpExploreWidgetPopup .leaflet-popup-content {\n    margin: 0;\n}\n\n.buddyUpExploreWidgetPopupCard {\n    max-width: 380px;\n    padding: .75rem;\n}\n\n.buddyUpExploreWidgetPopupBadge {\n    display: inline-block;\n    font-size: .72rem;\n    font-weight: 700;\n    letter-spacing: .02em;\n    padding: .2rem .5rem;\n    border-radius: 999px;\n    background: rgba(0, 0, 0, .06);\n    margin-bottom: .45rem;\n}\n\n.buddyUpExploreWidgetPopupTitle {\n    font-size: 1rem;\n    font-weight: 700;\n    line-height: 1.25;\n}\n\n.buddyUpExploreWidgetPopupSubtitle {\n    font-size: .82rem;\n    opacity: .78;\n    margin-top: .15rem;\n}\n\n.buddyUpExploreWidgetPopupDescription {\n    margin-top: .55rem;\n    font-size: .86rem;\n    line-height: 1.4;\n}\n\n.buddyUpExploreWidgetPopupHero {\n    margin-top: .55rem;\n    width: 100%;\n    max-height: 190px;\n    object-fit: cover;\n    border-radius: 12px;\n}\n\n.buddyUpExploreWidgetPopupGallery {\n    margin-top: .6rem;\n    display: flex;\n    flex-direction: column;\n    gap: .5rem;\n    max-height: 320px;\n    overflow: auto;\n    padding-right: .15rem;\n}\n\n.buddyUpExploreWidgetPopupMediaItem {\n    border-radius: 12px;\n    overflow: hidden;\n    background: rgba(0, 0, 0, .03);\n}\n\n.buddyUpExploreWidgetPopupMedia {\n    width: 100%;\n    max-height: 210px;\n    display: block;\n    object-fit: cover;\n    background: #000;\n}\n\n.buddyUpExploreWidgetPopupMediaCaption {\n    padding: .45rem .55rem;\n    font-size: .78rem;\n    line-height: 1.35;\n    opacity: .86;\n}\n\n.buddyUpExploreWidgetSignupLink {\n    margin: .6rem 0 0 0;\n    width: 100%;\n    text-align: center;\n}\n.buddyUpExploreWidgetPopupTitle {\n    font-weight: 700;\n    margin-bottom: .2rem;\n}\n\n@media (max-width: 980px) {\n    .buddyUpExploreWidgetShell {\n        grid-template-columns: 1fr;\n    }\n\n    .buddyUpExploreWidgetSidebar {\n        order: 2;\n    }\n\n    .buddyUpExploreWidgetMap {\n        order: 1;\n        min-height: 58vh;\n    }\n\n    .buddyUpExploreWidgetTopbar {\n        align-items: flex-start;\n        gap: .45rem;\n    }\n\n    .buddyUpExploreWidgetTopbar h3 {\n        font-size: 1rem;\n        margin: 0;\n    }\n\n    .buddyUpExploreWidgetActions {\n        width: 100%;\n        justify-content: space-between;\n        gap: .45rem;\n        flex-wrap: nowrap;\n        min-width: 0;\n    }\n\n    .buddyUpExploreWidgetModes {\n        flex: 1 1 auto;\n        min-width: 0;\n    }\n\n    #buddyUpExploreWidget.buddyUpExploreWidgetShelfMode .buddyUpExploreWidgetSidebar.isOpen,\n    #buddyUpExploreWidget.buddyUpExploreWidgetShelfMode .buddyUpExploreWidgetSidebar.activeMobileMenu {\n        width: min(360px, calc(100vw - 12%));\n        max-width: calc(100vw - 12%);\n    }\n}\n\n@media (max-width: 640px) {\n    #buddyUpExploreWidget {\n        padding: .45rem;\n    }\n\n    .buddyUpExploreWidgetActions {\n        display: grid;\n        grid-template-columns: auto minmax(0, 1fr);\n        align-items: center;\n        justify-content: normal;\n        gap: .42rem;\n        width: 100%;\n        min-width: 0;\n    }\n\n    .buddyUpExploreWidgetTopbar h3 {\n        display: none;\n    }\n\n    .buddyUpExploreWidgetFiltersToggle {\n        padding: .34rem .6rem;\n        font-size: .9rem;\n    }\n\n    .buddyUpExploreWidgetMode {\n        padding: .34rem .62rem;\n        font-size: .8rem;\n    }\n\n    .buddyUpExploreWidgetModes {\n        flex: 1 1 auto;\n        width: 100%;\n        min-width: 0;\n    }\n\n    .buddyUpExploreWidgetStatus {\n        margin: .1rem 0 .35rem;\n        font-size: .86rem;\n        line-height: 1.25;\n    }\n\n    .buddyUpExploreWidgetMap {\n        min-height: 62dvh;\n    }\n\n    #buddyUpExploreWidget.buddyUpExploreWidgetShelfMode .buddyUpExploreWidgetSidebar.isOpen,\n    #buddyUpExploreWidget.buddyUpExploreWidgetShelfMode .buddyUpExploreWidgetSidebar.activeMobileMenu {\n        top: max(8px, env(safe-area-inset-top, 0px));\n        left: 0;\n        width: min(360px, calc(100vw - 8%));\n        max-width: calc(100vw - 8%);\n        height: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 16px);\n        max-height: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 16px);\n    }\n}\n<\/style><section id=\"buddyUpExploreWidget\" class=\"buddyUpElWrapper\">\n    <div class=\"buddyUpExploreWidgetTopbar\">\n        <h3>Explore Preview<\/h3>\n        <div class=\"buddyUpExploreWidgetActions\">\n            <button type=\"button\" id=\"buddyUpExploreWidgetFiltersToggle\" class=\"buddyUpButton3 buddyUpExploreWidgetFiltersToggle\" aria-controls=\"buddyUpExploreWidgetSidebar\" aria-expanded=\"false\">\n                <i class=\"fa fa-sliders\" aria-hidden=\"true\"><\/i>\n                <span>Filters<\/span>\n            <\/button>\n            <div class=\"buddyUpExploreWidgetModes\" role=\"tablist\" aria-label=\"Explore mode\">\n                <button type=\"button\" class=\"buddyUpExploreWidgetMode isActive\" data-mode=\"adventures\" role=\"tab\" aria-selected=\"true\">Adventures<\/button>\n                <button type=\"button\" class=\"buddyUpExploreWidgetMode\" data-mode=\"events\" role=\"tab\" aria-selected=\"false\">Events<\/button>\n                <button type=\"button\" class=\"buddyUpExploreWidgetMode\" data-mode=\"groups\" role=\"tab\" aria-selected=\"false\">Groups<\/button>\n                <button type=\"button\" class=\"buddyUpExploreWidgetMode\" data-mode=\"users\" role=\"tab\" aria-selected=\"false\">Users<\/button>\n            <\/div>\n        <\/div>\n    <\/div>\n\n    <div id=\"buddyUpExploreWidgetStatus\" class=\"buddyUpExploreWidgetStatus\">Loading map preview...<\/div>\n\n    <div class=\"buddyUpExploreWidgetShell\">\n        <aside id=\"buddyUpExploreWidgetSidebar\" class=\"buddyUpExploreWidgetSidebar buddyUpSearchSidebar buddyUpFiltersShelf\" aria-label=\"Explore filters preview\" aria-hidden=\"true\">\n            <div class=\"buddyUpExploreWidgetFilterCard\">\n                <label for=\"buddyUpExploreWidgetSearch\">Search<\/label>\n                <input id=\"buddyUpExploreWidgetSearch\" type=\"text\" placeholder=\"Search by title or place\" \/>\n            <\/div>\n\n            <div class=\"buddyUpExploreWidgetFilterCard\">\n                <div class=\"buddyUpExploreWidgetFilterHeading\">Popular Interests<\/div>\n                <div id=\"buddyUpExploreWidgetCategories\" class=\"buddyUpExploreWidgetPills\"><\/div>\n            <\/div>\n\n            <div class=\"buddyUpExploreWidgetFilterCard\">\n                <div class=\"buddyUpExploreWidgetFilterHeading\">Nearby<\/div>\n                <div class=\"buddyUpExploreWidgetRangeRow\">\n                    <input id=\"buddyUpExploreWidgetRadius\" type=\"range\" min=\"5\" max=\"100\" step=\"5\" value=\"25\" \/>\n                    <span id=\"buddyUpExploreWidgetRadiusLabel\">25 mi<\/span>\n                <\/div>\n                <div class=\"textSmall\">Preview filter controls. Join free to unlock full interaction.<\/div>\n            <\/div>\n\n            <a href=\"https:\/\/staging.buddyupgo.com\/register\/?signup_source=explore_widget&#038;content_type=explore\" class=\"buddyUpButton1 buddyUpExploreWidgetJoinCta buddyup-auth-logged-out-only\" data-buddyup-register-cta=\"explore_widget\" data-content-type=\"explore\" data-entity-id=\"\" data-entity-title=\"Explore widget sidebar\">Sign up to see more<\/a>\n            <a href=\"https:\/\/staging.buddyupgo.com\/explore\/\" class=\"buddyUpButton1 buddyUpExploreWidgetJoinCta buddyup-auth-logged-in-only\">Open Full Explore Map<\/a>\n        <\/aside>\n\n        <div class=\"buddyUpExploreWidgetMapShell\">\n            <div id=\"buddyUpExploreWidgetMap\" class=\"buddyUpExploreWidgetMap\" aria-label=\"Explore map preview\"><\/div>\n            <div id=\"buddyUpExploreWidgetMapLoading\" class=\"buddyUpExploreWidgetMapLoading hidden\" aria-live=\"polite\" aria-busy=\"true\">\n                <div class=\"buddyUpExploreWidgetMapLoadingInner\">\n                    <span class=\"buddyUpExploreWidgetSpinner\" aria-hidden=\"true\"><\/span>\n                    <span id=\"buddyUpExploreWidgetMapLoadingText\">Loading map data...<\/span>\n                <\/div>\n            <\/div>\n        <\/div>\n    <\/div>\n<\/section>\n<script>(async function(){\n    const wrapper = document.getElementById('buddyUpExploreWidget');\n    if (!wrapper) return;\n\n    const statusEl = document.getElementById('buddyUpExploreWidgetStatus');\n    const mapEl = document.getElementById('buddyUpExploreWidgetMap');\n    const mapLoadingEl = document.getElementById('buddyUpExploreWidgetMapLoading');\n    const mapLoadingTextEl = document.getElementById('buddyUpExploreWidgetMapLoadingText');\n    const modeButtons = wrapper.querySelectorAll('.buddyUpExploreWidgetMode');\n    const searchInput = document.getElementById('buddyUpExploreWidgetSearch');\n    const radiusInput = document.getElementById('buddyUpExploreWidgetRadius');\n    const radiusLabel = document.getElementById('buddyUpExploreWidgetRadiusLabel');\n    const categoryContainer = document.getElementById('buddyUpExploreWidgetCategories');\n    const sidebarEl = document.getElementById('buddyUpExploreWidgetSidebar');\n    const filtersToggleButton = document.getElementById('buddyUpExploreWidgetFiltersToggle');\n    const inOnboardingFlow = !!wrapper.closest('#buddyUpOnboardingFlow');\n\n    const imageFallback = (window.buddyUpVariables && buddyUpVariables.plugin_path ? `${buddyUpVariables.plugin_path}img\/trailer-image.webp` : '');\n    const registerLink = (window.buddyUpVariables && buddyUpVariables.register_link)\n        ? String(buddyUpVariables.register_link)\n        : '\/';\n\n    const state = {\n        mode: 'adventures',\n        search: '',\n        category: '',\n        radiusMiles: 25,\n        usersLoaded: false,\n        allByMode: {\n            adventures: [],\n            events: [],\n            groups: [],\n            users: [],\n        },\n        shelfMode: false,\n    };\n\n    let map = null;\n    let markersLayer = null;\n    let usersLoadPromise = null;\n    let mapResizeObserver = null;\n    const userGeoCache = {};\n    const userGeoInFlight = {};\n\n    const refreshMapLayout = () => {\n        if (!map || typeof map.invalidateSize !== 'function') return;\n        setTimeout(() => {\n            try {\n                map.invalidateSize();\n            } catch (e) {}\n        }, 120);\n    };\n\n    const refreshMapLayoutBurst = () => {\n        if (!map || typeof map.invalidateSize !== 'function') return;\n        [0, 80, 180, 320, 520].forEach((ms) => {\n            setTimeout(() => {\n                try {\n                    map.invalidateSize({ pan: false, animate: false });\n                } catch (e) {}\n            }, ms);\n        });\n\n        setTimeout(() => {\n            try {\n                renderMap();\n            } catch (e) {}\n        }, 560);\n    };\n\n    const shouldUseShelfMode = () => {\n        if (inOnboardingFlow) return true;\n        return window.matchMedia('(max-width: 1100px)').matches;\n    };\n\n    const syncFiltersShelfUi = () => {\n        if (!sidebarEl || !filtersToggleButton) return;\n        state.shelfMode = shouldUseShelfMode();\n\n        wrapper.classList.toggle('buddyUpExploreWidgetShelfMode', state.shelfMode);\n\n        if (!state.shelfMode) {\n            if (typeof BUDDYUP !== 'undefined' && typeof BUDDYUP.closeFiltersShelf === 'function') {\n                BUDDYUP.closeFiltersShelf();\n            }\n            document.body.classList.remove('buddyup-explore-widget-shelf-open');\n            const overlay = document.getElementById('buddyUpFiltersShelfOverlay');\n            if (overlay) {\n                overlay.classList.remove('buddyUpExploreWidgetOverlayPassive');\n            }\n            sidebarEl.setAttribute('aria-hidden', 'false');\n            sidebarEl.classList.remove('isOpen');\n            sidebarEl.classList.remove('activeMobileMenu');\n            filtersToggleButton.setAttribute('aria-expanded', 'false');\n            filtersToggleButton.classList.add('hidden');\n            return;\n        }\n\n        sidebarEl.setAttribute('aria-hidden', 'true');\n        filtersToggleButton.classList.remove('hidden');\n        filtersToggleButton.setAttribute('aria-expanded', sidebarEl.classList.contains('isOpen') ? 'true' : 'false');\n    };\n\n    const openFiltersShelf = () => {\n        if (!sidebarEl || !filtersToggleButton) return;\n        if (!state.shelfMode) return;\n\n        if (typeof BUDDYUP !== 'undefined' && typeof BUDDYUP.openFiltersShelf === 'function') {\n            BUDDYUP.openFiltersShelf(sidebarEl);\n        } else {\n            sidebarEl.classList.add('isOpen');\n            sidebarEl.classList.add('activeMobileMenu');\n            sidebarEl.setAttribute('aria-hidden', 'false');\n        }\n\n        filtersToggleButton.setAttribute('aria-expanded', 'true');\n        document.body.classList.add('buddyup-explore-widget-shelf-open');\n\n        const overlay = document.getElementById('buddyUpFiltersShelfOverlay');\n        if (overlay) {\n            overlay.classList.add('buddyUpExploreWidgetOverlayPassive');\n        }\n\n        refreshMapLayoutBurst();\n    };\n\n    const closeFiltersShelf = () => {\n        if (!sidebarEl || !filtersToggleButton) return;\n\n        if (typeof BUDDYUP !== 'undefined' && typeof BUDDYUP.closeFiltersShelf === 'function') {\n            BUDDYUP.closeFiltersShelf();\n        } else {\n            sidebarEl.classList.remove('isOpen');\n            sidebarEl.classList.remove('activeMobileMenu');\n            sidebarEl.setAttribute('aria-hidden', 'true');\n        }\n\n        filtersToggleButton.setAttribute('aria-expanded', 'false');\n        document.body.classList.remove('buddyup-explore-widget-shelf-open');\n\n        const overlay = document.getElementById('buddyUpFiltersShelfOverlay');\n        if (overlay) {\n            overlay.classList.remove('buddyUpExploreWidgetOverlayPassive');\n        }\n\n        refreshMapLayoutBurst();\n    };\n\n    const safe = (v) => String(v || '').replace(\/[&<>\\\"]\/g, (m) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '\"': '&quot;' }[m]));\n\n    const loadLeaflet = async () => {\n        if (window.L && typeof window.L.map === 'function') return true;\n\n        if (!document.getElementById('buddyupLeafletCss')) {\n            const css = document.createElement('link');\n            css.id = 'buddyupLeafletCss';\n            css.rel = 'stylesheet';\n            css.href = 'https:\/\/unpkg.com\/leaflet@1.9.4\/dist\/leaflet.css';\n            document.head.appendChild(css);\n        }\n\n        await new Promise((resolve, reject) => {\n            if (document.getElementById('buddyupLeafletJs')) return resolve();\n            const js = document.createElement('script');\n            js.id = 'buddyupLeafletJs';\n            js.src = 'https:\/\/unpkg.com\/leaflet@1.9.4\/dist\/leaflet.js';\n            js.onload = resolve;\n            js.onerror = reject;\n            document.body.appendChild(js);\n        });\n\n        return !!(window.L && typeof window.L.map === 'function');\n    };\n\n    const toCategories = (raw) => {\n        if (Array.isArray(raw)) return raw.map((x) => String(x || '').trim()).filter(Boolean);\n        if (typeof raw === 'string') {\n            return raw.split(',').map((x) => x.trim()).filter(Boolean);\n        }\n        return [];\n    };\n\n    const pickUserDisplayName = (user) => {\n        const fullName = [user && user.first_name ? user.first_name : '', user && user.last_name ? user.last_name : '']\n            .join(' ')\n            .trim();\n        return String(\n            (user && user.username) ||\n            (user && user.full_name) ||\n            fullName ||\n            'User'\n        );\n    };\n\n    const pickUserLocationText = (user) => {\n        const city = String((user && user.city) || '').trim();\n        const state = String((user && user.state) || '').trim();\n        const zip = String((user && (user.zip_code || user.zip || user.postal_code)) || '').trim();\n\n        if (city || state) return [city, state].filter(Boolean).join(', ');\n        if (zip) return zip;\n        return '';\n    };\n\n    const isUsableLatLng = (lat, lng) => {\n        if (!isFinite(lat) || !isFinite(lng)) return false;\n        if (Math.abs(lat) > 90 || Math.abs(lng) > 180) return false;\n        \/\/ Reject common \"unset\" coordinate sentinel that maps to the Gulf of Guinea.\n        if (Math.abs(lat) < 0.0001 && Math.abs(lng) < 0.0001) return false;\n        return true;\n    };\n\n    const isExploreStepVisible = () => {\n        if (!inOnboardingFlow) return true;\n        const activeScreen = wrapper.closest('.buddyUpOnboardingScreen.isActive');\n        if (!activeScreen) return false;\n        return String(activeScreen.getAttribute('data-screen') || '') === 'explore';\n    };\n\n    const waitForExploreVisibility = async () => {\n        if (!inOnboardingFlow) return;\n        if (isExploreStepVisible()) return;\n\n        await Promise.race([\n            new Promise((resolve) => {\n                const handler = (e) => {\n                    const detail = e && e.detail && typeof e.detail === 'object' ? e.detail : {};\n                    if (String(detail.screen || '') !== 'explore') return;\n                    document.removeEventListener('buddyup:onboarding-screen-change', handler);\n                    resolve();\n                };\n                document.addEventListener('buddyup:onboarding-screen-change', handler);\n            }),\n            new Promise((resolve) => {\n                setTimeout(resolve, 3500);\n            })\n        ]);\n    };\n\n    const geocodeUserLocation = async (locationText) => {\n        const q = String(locationText || '').trim();\n        if (!q) return null;\n        if (!BUDDYUP || typeof BUDDYUP.locationAutocompleteSearch !== 'function') return null;\n\n        const key = q.toLowerCase();\n        if (userGeoCache[key]) return userGeoCache[key];\n        if (userGeoInFlight[key]) return userGeoInFlight[key];\n\n        userGeoInFlight[key] = (async () => {\n            try {\n                const rows = await BUDDYUP.locationAutocompleteSearch(q);\n                if (!Array.isArray(rows) || rows.length === 0) return null;\n                const first = rows[0] || {};\n                const lat = Number(first.latitude);\n                const lng = Number(first.longitude);\n                if (!isUsableLatLng(lat, lng)) return null;\n\n                const point = { latitude: lat, longitude: lng };\n                userGeoCache[key] = point;\n                return point;\n            } catch (e) {\n                return null;\n            } finally {\n                delete userGeoInFlight[key];\n            }\n        })();\n\n        return userGeoInFlight[key];\n    };\n\n    const isActiveUser = (user) => {\n        const candidates = [\n            user && user.status,\n            user && user.user_status,\n            user && user.active,\n            user && user.is_active,\n            user && user.online,\n            user && user.is_online,\n        ].filter((x) => typeof x !== 'undefined' && x !== null && String(x).trim() !== '');\n\n        if (candidates.length === 0) return true;\n\n        const positive = new Set(['1', 'true', 'active', 'online', 'enabled']);\n        const negative = new Set(['0', 'false', 'inactive', 'offline', 'banned', 'disabled', 'deleted']);\n\n        return candidates.some((value) => {\n            const normalized = String(value).trim().toLowerCase();\n            if (positive.has(normalized)) return true;\n            if (negative.has(normalized)) return false;\n            return false;\n        });\n    };\n\n    const resolveUsersArray = (payload) => {\n        if (!payload || typeof payload !== 'object') return [];\n        if (Array.isArray(payload.users)) return payload.users;\n        if (payload.data && typeof payload.data === 'object' && Array.isArray(payload.data.users)) {\n            return payload.data.users;\n        }\n        return [];\n    };\n\n    const normalizeUsersPayload = async (payload) => {\n        const users = resolveUsersArray(payload);\n        if (!users.length) {\n            state.allByMode.users = [];\n            return;\n        }\n\n        const geocodeCandidates = users\n            .map((user) => {\n                const locationText = pickUserLocationText(user);\n                const lat = Number(user && user.latitude);\n                const lng = Number(user && user.longitude);\n                return {\n                    locationText,\n                    needsGeocode: !isUsableLatLng(lat, lng) && locationText,\n                };\n            })\n            .filter((x) => x.needsGeocode)\n            .map((x) => String(x.locationText).trim())\n            .filter(Boolean);\n\n        const uniqueGeocodeTexts = Array.from(new Set(geocodeCandidates)).slice(0, 40);\n        const geocodeLookup = {};\n        await Promise.all(uniqueGeocodeTexts.map(async (text) => {\n            const point = await geocodeUserLocation(text);\n            if (point) geocodeLookup[text] = point;\n        }));\n\n        state.allByMode.users = users\n            .filter((user) => user && Number(user.id || 0) > 0)\n            .filter((user) => isActiveUser(user))\n            .map((user) => {\n                const directLat = Number(user.latitude);\n                const directLng = Number(user.longitude);\n                const locationText = pickUserLocationText(user);\n                const fallbackPoint = locationText ? geocodeLookup[locationText] : null;\n                const latitude = isUsableLatLng(directLat, directLng)\n                    ? directLat\n                    : (fallbackPoint ? Number(fallbackPoint.latitude) : NaN);\n                const longitude = isUsableLatLng(directLat, directLng)\n                    ? directLng\n                    : (fallbackPoint ? Number(fallbackPoint.longitude) : NaN);\n\n                return {\n                    id: Number(user.id || 0),\n                    type: 'user',\n                    title: pickUserDisplayName(user),\n                    subtitle: String(locationText || 'Active user'),\n                    latitude,\n                    longitude,\n                    categories: toCategories(user.interests),\n                };\n            })\n            .filter((item) => isUsableLatLng(Number(item.latitude), Number(item.longitude)));\n    };\n\n    const normalizePayload = (aggregate) => {\n        const adventures = Array.isArray(aggregate && aggregate.adventures) ? aggregate.adventures : [];\n        const events = Array.isArray(aggregate && aggregate.events) ? aggregate.events : [];\n        const groups = Array.isArray(aggregate && aggregate.groups) ? aggregate.groups : [];\n\n        state.allByMode.adventures = adventures\n            .map((item) => ({\n                id: Number(item.id || 0),\n                type: 'adventure',\n                title: String(item.title || 'Adventure'),\n                subtitle: String(item.location_label || [item.city, item.state].filter(Boolean).join(', ')),\n                description: String(item.body || item.description || ''),\n                latitude: Number(item.latitude),\n                longitude: Number(item.longitude),\n                image: String(item.preview_url || (Array.isArray(item.media) && item.media[0] && item.media[0].url ? item.media[0].url : '') || imageFallback),\n                media: Array.isArray(item.media) ? item.media : [],\n                categories: toCategories(item.categories),\n            }))\n            .filter((item) => isUsableLatLng(Number(item.latitude), Number(item.longitude)));\n\n        state.allByMode.events = events\n            .map((item) => ({\n                id: Number(item.event_id || 0),\n                type: 'event',\n                title: String(item.event_name || 'Event'),\n                subtitle: String(item.location_label || [item.city, item.state].filter(Boolean).join(', ')),\n                description: String(item.body || item.description || ''),\n                latitude: Number(item.latitude),\n                longitude: Number(item.longitude),\n                image: String(item.event_image || imageFallback),\n                categories: toCategories(item.event_categories),\n            }))\n            .filter((item) => isUsableLatLng(Number(item.latitude), Number(item.longitude)));\n\n        state.allByMode.groups = groups\n            .map((item) => ({\n                id: Number(item.id || 0),\n                type: 'group',\n                title: String(item.name || 'Group'),\n                subtitle: String(item.location_label || [item.city, item.state].filter(Boolean).join(', ')),\n                description: String(item.body || item.description || ''),\n                latitude: Number(item.latitude),\n                longitude: Number(item.longitude),\n                image: String(item.image || imageFallback),\n                categories: toCategories(item.categories),\n            }))\n            .filter((item) => isUsableLatLng(Number(item.latitude), Number(item.longitude)));\n    };\n\n    const getFilteredItems = () => {\n        const current = Array.isArray(state.allByMode[state.mode]) ? state.allByMode[state.mode] : [];\n        const searchTerm = state.search.toLowerCase().trim();\n\n        return current.filter((item) => {\n            if (state.category) {\n                const hasCategory = item.categories.some((c) => c.toLowerCase() === state.category.toLowerCase());\n                if (!hasCategory) return false;\n            }\n\n            if (!searchTerm) return true;\n\n            return (\n                item.title.toLowerCase().includes(searchTerm) ||\n                item.subtitle.toLowerCase().includes(searchTerm) ||\n                item.categories.some((c) => c.toLowerCase().includes(searchTerm))\n            );\n        });\n    };\n\n    const setMapLoading = (isLoading, message) => {\n        if (mapLoadingTextEl && message) {\n            mapLoadingTextEl.innerText = String(message);\n        }\n        if (!mapLoadingEl) return;\n        if (isLoading) mapLoadingEl.classList.remove('hidden');\n        else mapLoadingEl.classList.add('hidden');\n    };\n\n    const typeLabel = (type) => {\n        const value = String(type || '').toLowerCase();\n        if (value === 'adventure') return 'Adventure';\n        if (value === 'event') return 'Event';\n        if (value === 'group') return 'Group';\n        if (value === 'user') return 'User';\n        return 'Content';\n    };\n\n    const buildSignupHref = (item) => {\n        try {\n            const url = new URL(registerLink || '\/', window.location.origin);\n            url.searchParams.set('signup_source', 'explore_widget');\n            url.searchParams.set('content_type', String(item && item.type ? item.type : state.mode));\n            if (item && item.id) url.searchParams.set('content_id', String(item.id));\n            return url.toString();\n        } catch (e) {\n            return registerLink || '\/';\n        }\n    };\n\n    const buildSignupLink = (item) => {\n        const type = String(item && item.type ? item.type : state.mode);\n        return `<a href=\"${safe(buildSignupHref(item))}\" class=\"buddyUpButton1 buddyUpExploreWidgetSignupLink\" data-buddyup-register-cta=\"explore_widget\" data-content-type=\"${safe(type)}\" data-entity-id=\"${safe(item && item.id ? item.id : '')}\" data-entity-title=\"${safe(item && item.title ? item.title : '')}\">Sign up to see more<\/a>`;\n    };\n\n    const buildPinIcon = (item) => {\n        if (item && item.type === 'adventure' && item.image) {\n            return L.divIcon({\n                className: 'buddyUpExploreWidgetImagePinWrap',\n                html: `<div class=\"buddyUpExploreWidgetImagePin\"><img decoding=\"async\" src=\"${safe(item.image)}\" alt=\"Adventure\" \/><span class=\"buddyUpExploreWidgetImagePinDot\"><\/span><\/div>`,\n                iconSize: [64, 72],\n                iconAnchor: [32, 60],\n                popupAnchor: [0, -56],\n            });\n        }\n\n        const className = state.mode === 'events'\n            ? 'pin-events'\n            : (state.mode === 'groups' ? 'pin-groups' : (state.mode === 'users' ? 'pin-users' : 'pin-adventures'));\n        const html = `<div class=\"buddyUpExploreWidgetPin ${className}\" aria-hidden=\"true\"><\/div>`;\n        return L.divIcon({\n            className: 'buddyUpExploreWidgetPinWrap',\n            html: html,\n            iconSize: [20, 28],\n            iconAnchor: [10, 24],\n            popupAnchor: [0, -22],\n        });\n    };\n\n    const buildPopupHtml = (item) => {\n        const type = String(item && item.type ? item.type : state.mode);\n        if (type !== 'adventure') {\n            return `\n                <div class=\"buddyUpExploreWidgetPopupCard\">\n                    <div class=\"buddyUpExploreWidgetPopupBadge\">${safe(typeLabel(type))}<\/div>\n                    <div class=\"buddyUpExploreWidgetPopupTitle\">${safe(item.title)}<\/div>\n                    ${item.subtitle ? `<div class=\"buddyUpExploreWidgetPopupSubtitle\">${safe(item.subtitle)}<\/div>` : ''}\n                    ${item.image ? `<img decoding=\"async\" class=\"buddyUpExploreWidgetPopupHero\" src=\"${safe(item.image)}\" alt=\"${safe(item.title)}\" \/>` : ''}\n                    ${buildSignupLink(item)}\n                <\/div>\n            `;\n        }\n\n        const descriptionRaw = String(item.description || '').replace(\/<[^>]*>\/g, ' ').trim();\n        const media = Array.isArray(item.media) ? item.media : [];\n        const mediaHtml = media.length > 0\n            ? `<div class=\"buddyUpExploreWidgetPopupGallery\">${media.map((m, i) => {\n                const mUrl = m && m.url ? safe(m.url) : '';\n                const mType = m && String(m.type || '').toLowerCase() === 'video' ? 'video' : 'image';\n                const mDesc = m && m.description ? safe(m.description) : '';\n                if (!mUrl) return '';\n\n                return `\n                    <div class=\"buddyUpExploreWidgetPopupMediaItem\">\n                        ${mType === 'video'\n                            ? BUDDYUP.renderVideoMediaHtml(m.url, { className: 'buddyUpExploreWidgetPopupMedia', title: `${item && item.title ? item.title : 'Adventure'} video ${i + 1}` })\n                            : `<img decoding=\"async\" src=\"${mUrl}\" alt=\"${safe((m && m.description) ? m.description : `Adventure media ${i + 1}`)}\" class=\"buddyUpExploreWidgetPopupMedia\" \/>`\n                        }\n                        ${mDesc ? `<div class=\"buddyUpExploreWidgetPopupMediaCaption\">${mDesc}<\/div>` : ''}\n                    <\/div>\n                `;\n            }).join('')}<\/div>`\n            : (item.image ? `<img decoding=\"async\" class=\"buddyUpExploreWidgetPopupHero\" src=\"${safe(item.image)}\" alt=\"${safe(item.title)}\" \/>` : '');\n\n        return `\n            <div class=\"buddyUpExploreWidgetPopupCard\">\n                <div class=\"buddyUpExploreWidgetPopupHeader\">\n                    <div class=\"buddyUpExploreWidgetPopupBadge\">Adventure<\/div>\n                    <div class=\"buddyUpExploreWidgetPopupTitle\">${safe(item.title)}<\/div>\n                    ${item.subtitle ? `<div class=\"buddyUpExploreWidgetPopupSubtitle\">${safe(item.subtitle)}<\/div>` : ''}\n                <\/div>\n                ${descriptionRaw ? `<div class=\"buddyUpExploreWidgetPopupDescription\">${safe(descriptionRaw)}<\/div>` : ''}\n                ${mediaHtml}\n                ${buildSignupLink(item)}\n            <\/div>\n        `;\n    };\n\n    const renderCategories = () => {\n        if (!categoryContainer) return;\n\n        const items = Array.isArray(state.allByMode[state.mode]) ? state.allByMode[state.mode] : [];\n        const tally = {};\n        items.forEach((item) => {\n            item.categories.forEach((cat) => {\n                const key = String(cat || '').trim();\n                if (!key) return;\n                tally[key] = (tally[key] || 0) + 1;\n            });\n        });\n\n        const sorted = Object.keys(tally).sort((a, b) => tally[b] - tally[a]).slice(0, 8);\n        const buttons = [];\n        buttons.push(`<button type=\"button\" class=\"buddyUpExploreWidgetPill ${state.category === '' ? 'isActive' : ''}\" data-cat=\"\">All<\/button>`);\n        sorted.forEach((cat) => {\n            const active = state.category.toLowerCase() === cat.toLowerCase();\n            buttons.push(`<button type=\"button\" class=\"buddyUpExploreWidgetPill ${active ? 'isActive' : ''}\" data-cat=\"${safe(cat)}\">${safe(cat)}<\/button>`);\n        });\n\n        categoryContainer.innerHTML = buttons.join('');\n\n        categoryContainer.querySelectorAll('.buddyUpExploreWidgetPill').forEach((btn) => {\n            btn.addEventListener('click', () => {\n                state.category = String(btn.getAttribute('data-cat') || '');\n                renderCategories();\n                renderMap();\n            });\n        });\n    };\n\n    const renderMap = () => {\n        if (!map || !markersLayer) return;\n        markersLayer.clearLayers();\n\n        const items = getFilteredItems();\n        if (items.length === 0) {\n            statusEl.innerText = `No ${state.mode} matched your preview filters.`;\n            return;\n        }\n\n        const markers = [];\n        const coordBuckets = {};\n        items.forEach((item) => {\n            const coordKey = `${item.latitude.toFixed(4)}_${item.longitude.toFixed(4)}`;\n            coordBuckets[coordKey] = (coordBuckets[coordKey] || 0) + 1;\n\n            const duplicateIndex = coordBuckets[coordKey] - 1;\n            const spreadRadius = duplicateIndex === 0 ? 0 : (duplicateIndex * 0.00035);\n            const spreadAngle = duplicateIndex * (Math.PI \/ 4.2);\n            const latOffset = spreadRadius * Math.sin(spreadAngle);\n            const lngOffset = spreadRadius * Math.cos(spreadAngle);\n\n            const marker = L.marker([item.latitude + latOffset, item.longitude + lngOffset], {\n                icon: buildPinIcon(item),\n                keyboard: true,\n            });\n\n            marker.bindPopup(() => buildPopupHtml(item), {\n                maxWidth: 420,\n                minWidth: 280,\n                className: 'buddyUpExploreWidgetPopup'\n            });\n            marker.addTo(markersLayer);\n            markers.push(marker);\n        });\n\n        statusEl.innerText = `${items.length} ${state.mode} visible. Use tabs and preview filters to explore.`;\n\n        const group = L.featureGroup(markers);\n        if (markers.length === 1) {\n            map.setView(markers[0].getLatLng(), 12);\n        } else {\n            map.fitBounds(group.getBounds().pad(0.18));\n        }\n    };\n\n    const loadUsersIfNeeded = async (opts) => {\n        const options = opts && typeof opts === 'object' ? opts : {};\n        const silent = options.silent === true;\n\n        if (state.usersLoaded) return;\n        if (usersLoadPromise) {\n            await usersLoadPromise;\n            return;\n        }\n\n        usersLoadPromise = (async () => {\n            if (!silent) {\n                statusEl.innerText = 'Loading active users...';\n            }\n\n            try {\n                const usersResp = await BUDDYUP.apiRequest('users-search', {\n                    location: '',\n                    categories: [],\n                    per_page: 300,\n                    limit: 300,\n                });\n\n                if (usersResp && usersResp.status === 'success') {\n                    await normalizeUsersPayload(usersResp);\n                } else {\n                    state.allByMode.users = [];\n                }\n            } catch (e) {\n                state.allByMode.users = [];\n            } finally {\n                state.usersLoaded = true;\n            }\n        })();\n\n        try {\n            await usersLoadPromise;\n        } finally {\n            usersLoadPromise = null;\n        }\n    };\n\n    const setMode = async (mode) => {\n        const waitingForUsers = mode === 'users' && !state.usersLoaded;\n        if (waitingForUsers) {\n            setMapLoading(true, 'Loading active users...');\n        }\n\n        state.mode = mode;\n        state.category = '';\n\n        try {\n            if (mode === 'users') {\n                await loadUsersIfNeeded();\n            }\n\n            modeButtons.forEach((btn) => {\n                const active = btn.getAttribute('data-mode') === mode;\n                btn.classList.toggle('isActive', active);\n                btn.setAttribute('aria-selected', active ? 'true' : 'false');\n            });\n\n            renderCategories();\n            renderMap();\n            refreshMapLayoutBurst();\n        } finally {\n            if (waitingForUsers) {\n                setMapLoading(false);\n            }\n        }\n    };\n\n    statusEl.innerText = 'Loading adventures, events, and groups...';\n    setMapLoading(true, 'Loading map data...');\n\n    \/\/ Prefetch users in the background so Users tab is ready faster.\n    void loadUsersIfNeeded({ silent: true });\n\n    const [okLeaflet, aggregateResp] = await Promise.all([\n        loadLeaflet(),\n        BUDDYUP.apiRequest('explore-aggregate', {\n            limit_adventures: 500,\n            limit_events: 200,\n            limit_groups: 200,\n            include_events: 1,\n            include_groups: 1,\n        }),\n    ]);\n\n    if (!okLeaflet) {\n        statusEl.innerText = 'Map unavailable right now.';\n        setMapLoading(false);\n        return;\n    }\n\n    if (!aggregateResp || aggregateResp.status !== 'success') {\n        statusEl.innerText = 'Could not load explore preview.';\n        setMapLoading(false);\n        return;\n    }\n\n    normalizePayload(aggregateResp);\n\n    await waitForExploreVisibility();\n\n    const totalItems =\n        state.allByMode.adventures.length +\n        state.allByMode.events.length +\n        state.allByMode.groups.length;\n    if (totalItems === 0) {\n        statusEl.innerText = 'No public map content available yet. Try another tab.';\n    }\n\n    map = L.map(mapEl, {\n        zoomControl: true,\n        scrollWheelZoom: true,\n        dragging: true,\n        doubleClickZoom: true,\n    });\n\n    L.tileLayer('https:\/\/{s}.tile.openstreetmap.org\/{z}\/{x}\/{y}.png', {\n        maxZoom: 19,\n        attribution: '&copy; OpenStreetMap contributors'\n    }).addTo(map);\n\n    markersLayer = L.layerGroup().addTo(map);\n    map.whenReady(() => {\n        refreshMapLayoutBurst();\n    });\n\n    if (typeof ResizeObserver === 'function') {\n        mapResizeObserver = new ResizeObserver(() => {\n            refreshMapLayoutBurst();\n        });\n\n        if (mapEl) mapResizeObserver.observe(mapEl);\n        if (wrapper) mapResizeObserver.observe(wrapper);\n        if (mapEl && mapEl.parentElement) mapResizeObserver.observe(mapEl.parentElement);\n    }\n\n    modeButtons.forEach((btn) => {\n        btn.addEventListener('click', () => {\n            const nextMode = btn.getAttribute('data-mode');\n            if (!nextMode || nextMode === state.mode) return;\n            void setMode(nextMode);\n            refreshMapLayoutBurst();\n        });\n    });\n\n    if (searchInput) {\n        searchInput.addEventListener('input', () => {\n            state.search = String(searchInput.value || '');\n            renderMap();\n        });\n    }\n\n    if (radiusInput && radiusLabel) {\n        const syncRadius = () => {\n            state.radiusMiles = Number(radiusInput.value || 25);\n            radiusLabel.innerText = `${state.radiusMiles} mi`;\n        };\n        radiusInput.addEventListener('input', syncRadius);\n        syncRadius();\n    }\n\n    await setMode('adventures');\n    setMapLoading(false);\n    refreshMapLayoutBurst();\n\n    syncFiltersShelfUi();\n\n    if (filtersToggleButton && sidebarEl) {\n        filtersToggleButton.addEventListener('click', (e) => {\n            e.preventDefault();\n            syncFiltersShelfUi();\n\n            if (!state.shelfMode) return;\n            if (sidebarEl.classList.contains('isOpen') || sidebarEl.classList.contains('activeMobileMenu')) {\n                closeFiltersShelf();\n                return;\n            }\n\n            openFiltersShelf();\n        });\n\n        document.addEventListener('click', (e) => {\n            const target = e.target;\n            if (!(target instanceof HTMLElement)) return;\n            if (!state.shelfMode) return;\n            if (!target.closest('#buddyUpFiltersShelfOverlay, .buddyUpFiltersShelfCloseButton')) return;\n\n            setTimeout(() => {\n                filtersToggleButton.setAttribute('aria-expanded', 'false');\n                document.body.classList.remove('buddyup-explore-widget-shelf-open');\n            }, 20);\n        });\n    }\n\n\n    document.addEventListener('click', (e) => {\n        const link = e.target && e.target.closest ? e.target.closest('[data-buddyup-register-cta=\"explore_widget\"]') : null;\n        if (!link) return;\n\n        try {\n            if (typeof BUDDYUP !== 'undefined' && typeof BUDDYUP.trackEvent === 'function') {\n                BUDDYUP.trackEvent('signup_intent', {\n                    event_name: 'explore_widget_signup_click',\n                    feature: 'explore',\n                    journey_step: 'logged_out_onboarding',\n                    content_type: String(link.getAttribute('data-content-type') || ''),\n                    entity_id: String(link.getAttribute('data-entity-id') || ''),\n                    entity_title: String(link.getAttribute('data-entity-title') || ''),\n                    value_text: String(link.getAttribute('data-content-type') || ''),\n                });\n            }\n        } catch (err) {}\n    });\n    window.addEventListener('resize', () => {\n        syncFiltersShelfUi();\n        refreshMapLayoutBurst();\n    });\n    document.addEventListener('buddyUpPageChange', () => {\n        syncFiltersShelfUi();\n        refreshMapLayoutBurst();\n    });\n    document.addEventListener('buddyup:page-change', () => {\n        document.body.classList.remove('buddyup-explore-widget-shelf-open');\n        const overlay = document.getElementById('buddyUpFiltersShelfOverlay');\n        if (overlay) {\n            overlay.classList.remove('buddyUpExploreWidgetOverlayPassive');\n        }\n    });\n    document.addEventListener('buddyup:explore-widget-relocated', refreshMapLayoutBurst);\n    document.addEventListener('buddyup:onboarding-screen-change', (e) => {\n        const detail = e && e.detail && typeof e.detail === 'object' ? e.detail : {};\n        if (String(detail.screen || '') === 'explore') {\n            syncFiltersShelfUi();\n            refreshMapLayoutBurst();\n        }\n    });\n\n    refreshMapLayoutBurst();\n})();\n<\/script><\/div>                <\/div>\n            <\/div>\n        <\/div>\n    <\/div>\n<\/article>\n<article class=\"buddyUpOnboardingScreen\" data-screen=\"what-is\" data-title=\"What Is BuddyUpGo\">\n    <div class=\"buddyUpOnboardingScreenBody\">\n        <div class=\"buddyUpOnboardingScreenCanvas\">\n            <div class=\"half-container\">\n                <div class=\"item-img\">\n                    <img decoding=\"async\" src=\"https:\/\/staging.buddyupgo.com\/wp-content\/uploads\/2025\/07\/members-pic.png\" alt=\"BuddyUp members\" \/>\n                <\/div>\n                <div class=\"item2\">\n                    <p class=\"subscriptions-heading\">What Is BuddyUpGo?<\/p>\n                    <h2>\n                        <strong>\n                            Your Adventure Crew<br \/><span>Is Out There<\/span>\n                        <\/strong>\n                    <\/h2>\n                    <p>\n                        BuddyUpGo is the outdoor social network built for people who would rather be outside. Whether you fish,\n                        hike, bike, camp, or cruise in your RV, there are people like you ready to go.\n                    <\/p>\n                    <a href=\"https:\/\/staging.buddyupgo.com\/register\/?dest=groups&#038;src=what-is\" class=\"buddyUpButton1\" data-register-destination=\"groups\" data-register-source=\"what-is\">Start Browsing Groups<\/a>\n                <\/div>\n            <\/div>\n        <\/div>\n    <\/div>\n<\/article>\n<article class=\"buddyUpOnboardingScreen\" data-screen=\"find-events\" data-title=\"Find Events\">\n    <div class=\"buddyUpOnboardingScreenBody\">\n        <div class=\"buddyUpOnboardingScreenCanvas\">\n            <div class=\"event-section\">\n                <div class=\"event-container\">\n                    <div class=\"event-item\">\n                        <p class=\"event-title\">Find an event<\/p>\n                        <h2>Adventures Are<br \/>Happening <span>Right Now<\/span><\/h2>\n                        <p>Discover local events near you, or post your own outing and open it to the community.<\/p>\n\n                        <ul>\n                            <li>Search by activity, location, and skill level<\/li>\n                            <li>View event details, attendee lists, and comments<\/li>\n                            <li>Create your own outings and invite the community<\/li>\n                            <li>Share photos and videos from your adventures<\/li>\n                        <\/ul>\n\n                        <a href=\"https:\/\/staging.buddyupgo.com\/register\/?dest=events&#038;src=find-events\" class=\"buddyUpButton1\" data-register-destination=\"events\" data-register-source=\"find-events\">Start Browsing Events<\/a>\n                    <\/div>\n\n                    <div class=\"event-media-wrap\">\n                        <img decoding=\"async\" src=\"https:\/\/staging.buddyupgo.com\/wp-content\/uploads\/2025\/04\/find-buddies-2.png\" alt=\"Event preview\" \/>\n                    <\/div>\n                <\/div>\n            <\/div>\n        <\/div>\n    <\/div>\n<\/article>\n<article class=\"buddyUpOnboardingScreen\" data-screen=\"lets-go\" data-title=\"Let's Go\">\n    <div class=\"buddyUpOnboardingScreenBody\">\n        <div class=\"buddyUpOnboardingScreenCanvas\">\n            <div class=\"go-section\">\n                <div class=\"go-item\">\n                    <h2>Your Next Adventure<br \/>Is Waiting<br \/><span>Let's Go<\/span><\/h2>\n                    <p>Join outdoor enthusiasts already finding their perfect adventure buddy.<\/p>\n                <\/div>\n\n                <div class=\"buddyUpOnboardingCtaRow\">\n                    <a href=\"https:\/\/staging.buddyupgo.com\/register\/?dest=people&#038;src=lets-go\" class=\"buddyUpButton1\" data-register-destination=\"people\" data-register-source=\"lets-go\">Find My Buddy<\/a>\n                    <a href=\"https:\/\/staging.buddyupgo.com\/register\/?dest=subscriptions&#038;src=lets-go\" class=\"buddyUpButton3\" data-register-destination=\"subscriptions\" data-register-source=\"lets-go\">See Plans<\/a>\n                <\/div>\n            <\/div>\n        <\/div>\n    <\/div>\n<\/article>\n            <\/div>\n\n            <div class=\"buddyUpOnboardingFooter\">\n                <button id=\"buddyUpOnboardingBack\" type=\"button\" class=\"buddyUpButton3\" disabled=\"disabled\">Back<\/button>\n                <button id=\"buddyUpOnboardingNext\" type=\"button\" class=\"buddyUpButton1\">Next<\/button>\n            <\/div>\n        <\/div>\n    <\/div>\n\n    <div id=\"buddyUpForYouView\" class=\"buddyUpForYouView hidden\" aria-live=\"polite\">\n\n        <nav class=\"buddyUpHomeModeTabs\" aria-label=\"Home content mode\" role=\"tablist\">\n            <button type=\"button\" class=\"buddyUpHomeModeTab isActive\" data-home-mode=\"explore\" role=\"tab\" aria-selected=\"true\" aria-controls=\"buddyUpHomeExplorePanel\" id=\"buddyUpHomeExploreTab\">Explore<\/button>\n            <button type=\"button\" class=\"buddyUpHomeModeTab\" data-home-mode=\"for-you\" role=\"tab\" aria-selected=\"false\" aria-controls=\"buddyUpHomeForYouPanel\" id=\"buddyUpHomeForYouTab\">For You<\/button>\n        <\/nav>\n\n        <section id=\"buddyUpHomeExplorePanel\" class=\"buddyUpHomeModePanel isActive\" data-home-mode-panel=\"explore\" role=\"tabpanel\" aria-labelledby=\"buddyUpHomeExploreTab\">\n            <section class=\"buddyUpComprehensiveFeed buddyUpElWrapper\" aria-label=\"Comprehensive feed\">\n                <div class=\"buddyUpForYouRailHead buddyUpComprehensiveFeedHead\">\n                    <h2>Map-First Discovery<\/h2>\n                <\/div>\n                <p class=\"buddyUpComprehensiveFeedLead\">Start with nearby map activity, then switch to For You for ranked recommendations.<\/p>\n                <div id=\"buddyUpComprehensiveExploreHost\" class=\"buddyUpComprehensiveExploreHost\"><div class=\"buddyUpPjaxContainer\" data-buddyup-pjax-container=\"1\"><style>.buddyUpExploreLayout {\n    display: block;\n}\n\n.buddyUpExploreMapShell {\n    position: relative;\n    padding: .25rem;\n    background: var(--buddyup-background);\n}\n\n.buddyUpExploreStatusBar {\n    position: relative;\n    z-index: 520;\n    margin: 0 0 .45rem 0;\n    padding: .5rem .65rem;\n    border-radius: var(--buddyup-panel-radius, 12px);\n    background: rgba(255,255,255,.92);\n    border: 1px solid rgba(67, 126, 146, .2);\n}\n\n.buddyUpExploreTopTabs {\n    position: relative;\n    z-index: 520;\n    margin: 0 0 .45rem 0;\n    padding: .5rem .65rem;\n    border-radius: var(--buddyup-panel-radius, 12px);\n    background: rgba(255,255,255,.92);\n    border: 1px solid rgba(67, 126, 146, .2);\n}\n\n.buddyUpExploreTopTabsLabel {\n    font-weight: 700;\n    margin-bottom: .35rem;\n    color: #1f3656;\n}\n\n.buddyUpExploreTopTabsList {\n    display: flex;\n    flex-wrap: wrap;\n    gap: .35rem;\n}\n\n\/* Side tab: uses shared .buddyUpSideTab from global styles.css *\/\n#buddyUpExploreSidebarToggle {\n    display: none;\n}\n\naside.buddyUpExploreSidebar {\n    position: absolute;\n    top: 8.2rem;\n    left: .85rem;\n    width: min(320px, 85vw);\n    max-height: calc(100% - 14.6rem);\n    z-index: 10001;\n    margin: 0;\n    padding: .95rem .8rem;\n    border-radius: var(--buddyup-panel-radius, 12px);\n    background: var(--buddyup-background);\n    box-shadow: 0 12px 28px rgba(0,0,0,.22);\n    overflow: auto;\n    border: 1px solid rgba(67, 126, 146, .22);\n    gap: .85rem;\n}\n\naside.buddyUpExploreSidebar.buddyUpSearchSidebar > .buddyUpSearchSidebarSection {\n    margin: 0;\n}\n\n.buddyUpExploreMapFocusSection {\n    margin-bottom: .55rem;\n}\n\n.buddyUpExploreFocusToggle {\n    display: grid;\n    grid-template-columns: 1fr 1fr;\n    gap: .35rem;\n}\n\n.buddyUpExploreFocusBtn {\n    min-height: 2rem;\n    border-radius: 999px;\n    border: 1px solid var(--secondary-color);\n    background: #fff;\n    color: var(--secondary-color);\n    font-weight: 700;\n}\n\n.buddyUpExploreFocusBtn.isActive {\n    background: var(--secondary-color);\n    color: #fff;\n}\n\n.buddyUpExploreSearchNearRow {\n    display: grid;\n    grid-template-columns: 1fr auto;\n    gap: .35rem;\n    align-items: start;\n}\n\n.buddyUpExploreSearchNearRow .buddyUpButton3 {\n    margin: 0;\n    min-height: 2.2rem;\n}\n\n.buddyUpExploreSearch {\n    margin: 0;\n}\n\n.buddyUpExploreSection {\n    margin-bottom: .7rem;\n}\n\n.buddyUpExploreSection:last-child {\n    margin-bottom: 0;\n}\n\n.buddyUpExploreSectionToggle {\n    width: 100%;\n    border: 0;\n    background: transparent;\n    display: flex;\n    align-items: center;\n    justify-content: space-between;\n    font-weight: 700;\n    color: #1f3656;\n    padding: .1rem 0 .4rem 0;\n    cursor: pointer;\n}\n\n.buddyUpExploreSectionChevron {\n    font-size: .9rem;\n    opacity: .8;\n    transition: transform .18s ease;\n}\n\n.buddyUpExploreSectionBody {\n    display: block;\n}\n\n.buddyUpExploreSectionCollapsible.isCollapsed .buddyUpExploreSectionBody {\n    display: none;\n}\n\n.buddyUpExploreSectionCollapsible.isCollapsed .buddyUpExploreSectionChevron {\n    transform: rotate(-90deg);\n}\n\n.buddyUpExploreSectionTitle {\n    font-weight: 700;\n    margin-bottom: .45rem;\n    color: #1f3656;\n}\n\n.buddyUpExploreToggleList {\n    display: flex;\n    flex-direction: column;\n    gap: .35rem;\n}\n\n.buddyUpExploreToggle {\n    width: 100%;\n    margin: 0;\n    text-align: left;\n    min-height: 2.15rem;\n    border-radius: var(--buddyup-control-radius, 10px);\n    background: var(--secondary-color);\n    color: #fff;\n    border: 1px solid transparent;\n}\n\n.buddyUpExploreTopTabsList .buddyUpExploreToggle {\n    width: auto;\n    min-height: 2rem;\n    border-radius: 999px;\n    padding: .4rem .8rem;\n}\n\n.buddyUpExploreToggle.isActive {\n    border-color: var(--secondary-color);\n    background: var(--secondary-color);\n    color: #fff;\n}\n\n.buddyUpExploreCategoryToggle.buddyUpButton3 {\n    background: #fff !important;\n    border: 1px solid rgba(67, 126, 146, 0.35) !important;\n    color: #1f3656 !important;\n    font-weight: 600;\n    transition: background-color .18s ease, color .18s ease, border-color .18s ease, box-shadow .18s ease;\n}\n\n.buddyUpExploreCategoryToggle.buddyUpButton3.isActive {\n    background: var(--secondary-color) !important;\n    border-color: var(--secondary-color) !important;\n    color: #fff !important;\n    box-shadow: 0 0 0 2px rgba(67, 126, 146, 0.2);\n}\n\n.buddyUpExploreLock {\n    margin-top: .45rem;\n}\n\n.buddyUpExploreRadiusRow {\n    margin-bottom: .4rem;\n}\n\n.buddyUpExploreRadiusSlider {\n    width: 100%;\n    accent-color: var(--buddyup-color1);\n}\n\n.buddyUpExploreRadiusValue {\n    margin-top: .2rem;\n    font-size: .85rem;\n    font-weight: 600;\n    color: #1f3656;\n}\n\n.buddyUpExploreApplyRadius {\n    margin-top: .35rem;\n    width: 100%;\n}\n\n.buddyUpExploreRadiusHint {\n    margin-top: .35rem;\n    opacity: .8;\n}\n\n.buddyUpExploreNearbySignedOut {\n    padding-top: .1rem;\n}\n\n.buddyUpExploreNearbyRange {\n    width: 100%;\n    margin: .15rem 0 .45rem 0;\n    accent-color: var(--buddyup-color1);\n}\n\n.buddyUpExploreNearbyLockCard {\n    border-radius: var(--buddyup-control-radius, 10px);\n    border: 1px solid rgba(0,0,0,.08);\n    background: rgba(67, 126, 146, .08);\n    padding: .55rem .65rem;\n}\n\n.buddyUpExploreNearbyLockTitle {\n    font-weight: 700;\n    margin-bottom: .2rem;\n}\n\n.buddyUpExploreMapCard {\n    position: relative;\n    border-radius: var(--buddyup-panel-radius, 12px);\n    overflow: hidden;\n}\n\n.buddyUpExploreMapLoading {\n    position: absolute;\n    inset: 0;\n    background: rgba(255,255,255,.74);\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    z-index: 540;\n}\n\n.buddyUpExploreMapLoadingInner {\n    display: inline-flex;\n    align-items: center;\n    gap: .55rem;\n    background: rgba(255,255,255,.96);\n    border: 1px solid rgba(67, 126, 146, .25);\n    border-radius: 999px;\n    padding: .45rem .75rem;\n    color: #1f3656;\n    font-weight: 600;\n}\n\n.buddyUpExploreMapLoading.is-error .buddyUpExploreMapLoadingInner {\n    border-radius: var(--buddyup-control-radius, 10px);\n    flex-wrap: wrap;\n    justify-content: center;\n    max-width: min(420px, calc(100% - 32px));\n    text-align: center;\n}\n\n.buddyUpExploreMapLoading.is-error .buddyUpExploreSpinner {\n    display: none;\n}\n\n.buddyUpExploreMapRetry {\n    min-height: 40px;\n    margin: 0 !important;\n    padding: .35rem .75rem !important;\n}\n\n.buddyUpExploreSpinner {\n    width: 16px;\n    height: 16px;\n    border-radius: 50%;\n    border: 2px solid rgba(31, 54, 86, .25);\n    border-top-color: var(--secondary-color);\n    animation: buddyUpExploreSpin .7s linear infinite;\n}\n\n@keyframes buddyUpExploreSpin {\n    to { transform: rotate(360deg); }\n}\n\n.buddyUpExploreMap {\n    width: 100%;\n    min-height: 82vh;\n    border-radius: var(--buddyup-panel-radius, 12px);\n    border: 1px solid rgba(67, 126, 146, .22);\n}\n\n.buddyUpExploreSignedOutTease {\n    position: relative;\n    margin-top: .55rem;\n    width: min(360px, 100%);\n    background: rgba(255,255,255,.98);\n    border: 1px solid rgba(0,0,0,.08);\n    border-radius: var(--buddyup-panel-radius, 12px);\n    padding: .65rem;\n    box-shadow: 0 8px 20px rgba(0,0,0,.18);\n    z-index: 530;\n}\n\n.buddyUpExploreTeaseClose {\n    position: absolute;\n    right: .35rem;\n    top: .2rem;\n    border: 0;\n    background: transparent;\n    font-size: 1.2rem;\n    line-height: 1;\n    cursor: pointer;\n    opacity: .6;\n}\n\n.buddyUpExploreTeaseTitle {\n    font-weight: 700;\n    margin: 0 1rem .45rem 0;\n}\n\n.buddyUpExploreTeaseThumbs {\n    display: grid;\n    grid-template-columns: repeat(3, 1fr);\n    gap: .3rem;\n    margin-bottom: .45rem;\n}\n\n.buddyUpExploreTeaseThumbs span {\n    display: block;\n    height: 44px;\n    border-radius: 6px;\n    background: linear-gradient(135deg, rgba(0,0,0,.12), rgba(0,0,0,.04));\n}\n\n.buddyUpExploreTeaseThumbs img {\n    width: 100%;\n    height: 44px;\n    border-radius: 6px;\n    object-fit: cover;\n    display: block;\n}\n\n.buddyUpExploreTeaseCopy {\n    font-size: .92rem;\n    line-height: 1.3;\n    margin-bottom: .5rem;\n}\n\n.buddyUpExploreTeaseCta {\n    width: 100%;\n    text-align: center;\n    margin: 0;\n}\n\n.buddyUpExploreSignedOutBottomCta {\n    margin-top: .55rem;\n    border-radius: var(--buddyup-panel-radius, 12px);\n    background: rgba(255,255,255,.94);\n    border: 1px solid rgba(0,0,0,.08);\n    padding: .6rem .75rem;\n    display: flex;\n    align-items: center;\n    justify-content: space-between;\n    gap: .6rem;\n    border: 1px solid rgba(67, 126, 146, .22);\n}\n\n.buddyUpExploreFiltersOverlay {\n    position: absolute;\n    inset: 0;\n    border-radius: 12px;\n    background: rgba(67, 126, 146, .2);\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    padding: .65rem;\n    z-index: 7;\n}\n\n.buddyUpExploreSidebar.isLoggedOut .buddyUpExploreFiltersOverlay {\n    display: none;\n}\n\n.buddyUpExploreFiltersOverlayCard {\n    border-radius: var(--buddyup-control-radius, 10px);\n    background: #fff;\n    border: 1px solid rgba(67, 126, 146, .25);\n    padding: .65rem;\n    text-align: center;\n    max-width: 260px;\n}\n\n.buddyUpExploreSidebar.isLoggedOut:hover .buddyUpExploreFiltersOverlay {\n    display: flex;\n}\n\n.buddyUpExploreSignedOutBottomCta .buddyUpButton1 {\n    margin: 0;\n    white-space: nowrap;\n}\n\n\/* Adventure pin marker treatment *\/\n.buddyUpExplorePin {\n    width: 64px;\n    height: 64px;\n    border-radius: 18px;\n    overflow: hidden;\n    border: 3px solid #fff;\n    box-shadow: 0 8px 22px rgba(0,0,0,.22);\n    background: #f4f4f4;\n    position: relative;\n    transform: translateY(-2px);\n}\n\n.buddyUpExplorePin img {\n    width: 100%;\n    height: 100%;\n    object-fit: cover;\n}\n\n.buddyUpExplorePinDot {\n    position: absolute;\n    left: 50%;\n    bottom: -10px;\n    transform: translateX(-50%);\n    width: 14px;\n    height: 14px;\n    border-radius: 50%;\n    background: var(--buddyup-color1);\n    border: 2px solid #fff;\n    box-shadow: 0 3px 8px rgba(0,0,0,.22);\n}\n\n.buddyUpExplorePinWrap {\n    background: transparent;\n    border: 0;\n}\n\n\/* Expanded popup card treatment *\/\n.buddyUpExplorePopup .leaflet-popup-content-wrapper {\n    border-radius: 16px;\n    box-shadow: 0 14px 32px rgba(0,0,0,.22);\n    padding: 0;\n}\n\n.buddyUpExplorePopup .leaflet-popup-content {\n    margin: 0;\n}\n\n.buddyUpExplorePopupCard {\n    max-width: 380px;\n    padding: .75rem;\n}\n\n.buddyUpExplorePopupBadge {\n    display: inline-block;\n    font-size: .72rem;\n    font-weight: 700;\n    letter-spacing: .02em;\n    padding: .2rem .5rem;\n    border-radius: 999px;\n    background: rgba(0,0,0,.06);\n    margin-bottom: .45rem;\n}\n\n.buddyUpExplorePopupTitle {\n    font-size: 1rem;\n    font-weight: 700;\n    line-height: 1.25;\n}\n\n.buddyUpExplorePopupSubtitle {\n    font-size: .82rem;\n    opacity: .78;\n    margin-top: .15rem;\n}\n\n.buddyUpExplorePopupDescription {\n    margin-top: .55rem;\n    font-size: .86rem;\n    line-height: 1.4;\n}\n\n.buddyUpExplorePopupHero {\n    margin-top: .55rem;\n    width: 100%;\n    max-height: 190px;\n    object-fit: cover;\n    border-radius: 12px;\n}\n\n.buddyUpExplorePopupGallery {\n    margin-top: .6rem;\n    display: flex;\n    flex-direction: column;\n    gap: .5rem;\n    max-height: 320px;\n    overflow: auto;\n    padding-right: .15rem;\n}\n\n.buddyUpExplorePopupMediaItem {\n    border-radius: 12px;\n    overflow: hidden;\n    background: rgba(0,0,0,.03);\n}\n\n.buddyUpExplorePopupMedia {\n    width: 100%;\n    max-height: 210px;\n    display: block;\n    object-fit: cover;\n    background: #000;\n}\n\n.buddyUpExplorePopupMediaCaption {\n    padding: .45rem .55rem;\n    font-size: .78rem;\n    line-height: 1.35;\n    opacity: .86;\n}\n\n.buddyUpExplorePopupLink {\n    margin: .6rem 0 0 0;\n    width: 100%;\n    text-align: center;\n}\n\n@media (max-width: 980px) {\n    .buddyUpExploreMapShell {\n        padding: 0;\n    }\n\n    .buddyUpExploreStatusBar {\n        position: relative;\n        padding: .42rem .55rem;\n        margin-bottom: .4rem;\n    }\n\n    .buddyUpExploreTopTabs {\n        padding: .42rem .55rem;\n        margin-bottom: .4rem;\n    }\n\n    .buddyUpExploreMap {\n        min-height: 72vh;\n        border-radius: 0;\n    }\n\n    #buddyUpExploreSidebarToggle {\n        display: inline-flex;\n    }\n\n    .buddyUpExploreMapShell aside.buddyUpExploreSidebar.buddyUpSearchSidebar.buddyUpFiltersShelf {\n        position: fixed;\n        top: calc(var(--buddyup-mobile-header-height, 56px) + var(--buddyup-mobile-safe-top, 0px) + 8px);\n        left: 0;\n        width: min(360px, calc(100vw - 18%));\n        max-width: calc(100vw - 18%);\n        height: calc(100dvh - var(--buddyup-mobile-header-height, 56px) - var(--buddyup-mobile-nav-offset, 70px) - var(--buddyup-mobile-safe-top, 0px) - 16px);\n        max-height: calc(100dvh - var(--buddyup-mobile-header-height, 56px) - var(--buddyup-mobile-nav-offset, 70px) - var(--buddyup-mobile-safe-top, 0px) - 16px);\n        border-radius: 0 14px 14px 0;\n        z-index: 10001;\n        box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25);\n        background: #fff;\n        padding: .95rem .8rem;\n        overflow-y: auto;\n        transition: transform .24s ease, opacity .24s ease;\n        transform: translateX(-105%);\n        opacity: 1;\n        touch-action: pan-y;\n    }\n\n    .buddyUpExploreMapShell aside.buddyUpExploreSidebar.buddyUpSearchSidebar.buddyUpFiltersShelf.isOpen,\n    .buddyUpExploreMapShell aside.buddyUpExploreSidebar.buddyUpSearchSidebar.buddyUpFiltersShelf.activeMobileMenu {\n        transform: translateX(0);\n    }\n\n    .buddyUpExploreMapShell aside.buddyUpExploreSidebar.buddyUpSearchSidebar.buddyUpFiltersShelf.isCollapsed {\n        transform: translateX(-105%);\n        opacity: 0;\n        pointer-events: none;\n    }\n\n    .buddyUpExploreSignedOutTease {\n        width: 100%;\n        border-radius: 10px;\n        padding: .55rem;\n        margin-top: .45rem;\n    }\n\n    .buddyUpExploreTeaseThumbs img,\n    .buddyUpExploreTeaseThumbs span {\n        height: 40px;\n    }\n\n    .buddyUpExploreSignedOutBottomCta.hidden {\n        display: none;\n    }\n\n    .buddyUpExploreSignedOutBottomCta {\n        display: none;\n    }\n\n    .buddyUpExploreSidebar.isLoggedOut .buddyUpExploreFiltersOverlay {\n        display: flex;\n    }\n\n    .buddyUpExploreSignedOutBottomCta .buddyUpButton1 {\n        width: auto;\n        text-align: center;\n        font-size: .9rem;\n        padding: .42rem .62rem;\n    }\n}\n\n@media (min-width: 1024px) {\n    .buddyUpExploreMapShell {\n        padding: .35rem;\n    }\n\n    .buddyUpExploreSidebar {\n        width: min(320px, 32vw);\n        max-height: calc(100% - 14.6rem);\n    }\n\n    .buddyUpExploreMap {\n        min-height: 83vh;\n    }\n}\n<\/style><script>\nwindow.buddyUpExploreSSR = {\"status\":\"success\",\"adventures\":[{\"id\":11,\"user_id\":207,\"title\":\"Fly fishing cool sunset photo\",\"body\":\"my buddy caught this sweet moment where the sunset light hit my fly line in the coolest way.\",\"categories\":[\"Fishing\",\"Sunset Chasing\",\"fly fishing\",\"Photography\"],\"location_label\":\"\",\"city\":\"\",\"state\":\"\",\"postal_code\":\"\",\"latitude\":42.8650441,\"longitude\":-84.4628484,\"point_source\":\"media_location_fallback\",\"preview_url\":\"https:\\\/\\\/buddyupapi-staging.us35.cdn-alpha.com\\\/wp-content\\\/uploads\\\/buddyup_ffbe92c57e25fc55.jpg\",\"media\":[{\"url\":\"https:\\\/\\\/buddyupapi-staging.us35.cdn-alpha.com\\\/wp-content\\\/uploads\\\/buddyup_ffbe92c57e25fc55.jpg\",\"type\":\"image\",\"description\":\"great shot of sunset over water\"}],\"created_at\":\"2026-04-26 18:52:28\"},{\"id\":10,\"user_id\":195,\"title\":\"Great North Slopes\",\"body\":\"Mini adventure for a day on the slopes\",\"categories\":[\"Snow Skiing\",\"Snow Tubing\"],\"location_label\":\"\",\"city\":\"\",\"state\":\"\",\"postal_code\":\"\",\"latitude\":39.1616527,\"longitude\":-84.8664722,\"point_source\":\"media_location_fallback\",\"preview_url\":\"https:\\\/\\\/buddyupapi-staging.us35.cdn-alpha.com\\\/wp-content\\\/uploads\\\/buddyup_83a0680f0a80f005.jpg\",\"media\":[{\"url\":\"https:\\\/\\\/buddyupapi-staging.us35.cdn-alpha.com\\\/wp-content\\\/uploads\\\/buddyup_83a0680f0a80f005.jpg\",\"type\":\"image\",\"description\":\"Skiing Hill\"}],\"created_at\":\"2026-03-05 17:45:47\"},{\"id\":9,\"user_id\":195,\"title\":\"Fishing On The Licking River\",\"body\":\"Fishing and caught a golden horse fish\",\"categories\":[\"Fishing\"],\"location_label\":\"\",\"city\":\"\",\"state\":\"\",\"postal_code\":\"\",\"latitude\":38.1264242,\"longitude\":-83.6102318,\"point_source\":\"media_location_fallback\",\"preview_url\":\"https:\\\/\\\/buddyupapi-staging.us35.cdn-alpha.com\\\/wp-content\\\/uploads\\\/buddyup_ea32b3ad58f23bcf.jpg\",\"media\":[{\"url\":\"https:\\\/\\\/buddyupapi-staging.us35.cdn-alpha.com\\\/wp-content\\\/uploads\\\/buddyup_ea32b3ad58f23bcf.jpg\",\"type\":\"image\",\"description\":\"front view golden horse fish\"}],\"created_at\":\"2026-03-05 17:37:15\"},{\"id\":8,\"user_id\":159,\"title\":\"testing geo location\",\"body\":\"this is a test post\",\"categories\":[\"BBQ\\\/Cookout\"],\"location_label\":\"\",\"city\":\"\",\"state\":\"\",\"postal_code\":\"\",\"latitude\":38.0540248,\"longitude\":-83.9372774,\"point_source\":\"media_location_fallback\",\"preview_url\":\"https:\\\/\\\/buddyupapi-staging.us35.cdn-alpha.com\\\/wp-content\\\/uploads\\\/buddyup_c420c8b6ef87484c.png\",\"media\":[{\"url\":\"https:\\\/\\\/buddyupapi-staging.us35.cdn-alpha.com\\\/wp-content\\\/uploads\\\/buddyup_c420c8b6ef87484c.png\",\"type\":\"image\",\"description\":\"Just a white screen\"}],\"created_at\":\"2026-03-03 20:31:13\"},{\"id\":6,\"user_id\":104,\"title\":\"test 5\",\"body\":\"This is a test of notifications, new Adventure single page, new pin links, photo gallery styling\",\"categories\":[\"Biking\",\"Beach Volleyball\"],\"location_label\":\"\",\"city\":\"\",\"state\":\"\",\"postal_code\":\"\",\"latitude\":40.3553915,\"longitude\":-105.7176957,\"point_source\":\"media_location_fallback\",\"preview_url\":\"https:\\\/\\\/buddyupapi-staging.us35.cdn-alpha.com\\\/wp-content\\\/uploads\\\/buddyup_c97c3d6079f5d205.jpg\",\"media\":[{\"url\":\"https:\\\/\\\/buddyupapi-staging.us35.cdn-alpha.com\\\/wp-content\\\/uploads\\\/buddyup_c97c3d6079f5d205.jpg\",\"type\":\"image\",\"description\":\"road\"}],\"created_at\":\"2026-03-02 21:18:06\"}],\"events\":[{\"event_id\":75,\"event_name\":\"Hike-a-thon(test)\",\"location_name\":\"Harding Icefield Trail - Exit Glacier Nature Center\",\"address\":\"24620 Herman Leirer Rd\",\"city\":\"Seward\",\"state\":\"Alaska\",\"location_label\":\"24620 Herman Leirer Rd, Seward, Alaska\",\"latitude\":60.1013952,\"longitude\":-149.4404281,\"point_source\":\"geocoded\",\"event_image\":\"https:\\\/\\\/buddyupapi-staging.us35.cdn-alpha.com\\\/wp-content\\\/uploads\\\/buddyup_a132a2e4f4436f83.jpg\",\"zip\":\"\",\"event_categories\":[\"Hiking\",\"Snow Skiing\",\"cross-country skiing\",\"Rock Climbing\",\"mountain climbing\"]},{\"event_id\":76,\"event_name\":\"Fly fishing at sunset competition\",\"location_name\":\"Fish Ladder Park\",\"address\":\"606 Front Ave NW\",\"city\":\"Grand Rapids\",\"state\":\"Michigan\",\"location_label\":\"606 Front Ave NW, Grand Rapids, Michigan\",\"latitude\":42.9747942,\"longitude\":-85.6762811,\"point_source\":\"geocoded\",\"event_image\":\"https:\\\/\\\/buddyupapi-staging.us35.cdn-alpha.com\\\/wp-content\\\/uploads\\\/buddyup_a2ac647cf918b039.jpg\",\"zip\":\"\",\"event_categories\":[\"Fishing\",\"Boating\",\"BBQ\\\/Cookout\",\"competition\",\"Concerts\\\/Festivals\"]}],\"groups\":[{\"id\":8,\"name\":\"Cliff Watching Enthusiasts\",\"address_1\":\"\",\"city\":\"a cliff\",\"state\":\"KS\",\"location_label\":\"a cliff, KS\",\"latitude\":37.6829546,\"longitude\":-97.4679657,\"point_source\":\"geocoded\",\"image\":\"https:\\\/\\\/buddyupapi-staging.us35.cdn-alpha.com\\\/wp-content\\\/uploads\\\/buddyup_b21c583f58ad273c.jpg\",\"categories\":[\"cliffs\"]},{\"id\":11,\"name\":\"Sunset Fly Fishing Club\",\"address_1\":\"\",\"city\":\"Grand Rapids\",\"state\":\"MI\",\"location_label\":\"Grand Rapids, MI\",\"latitude\":42.9632425,\"longitude\":-85.6678639,\"point_source\":\"geocoded\",\"image\":\"https:\\\/\\\/buddyupapi-staging.us35.cdn-alpha.com\\\/wp-content\\\/uploads\\\/buddyup_3f348e09c0e8f60b.jpg\",\"categories\":[\"Fishing\",\"Boating\",\"Sunset Chasing\",\"BBQ\\\/Cookout\",\"Camping\"]},{\"id\":4,\"name\":\"Test Group\",\"address_1\":\"123 Main Street\",\"city\":\"Orlando\",\"state\":\"Florida\",\"location_label\":\"123 Main Street, Orlando, Florida\",\"latitude\":28.5438863,\"longitude\":-81.3773901,\"point_source\":\"geocoded\",\"image\":\"\",\"categories\":[\"hiking\",\"fishing\"]},{\"id\":6,\"name\":\"Test Group New\",\"address_1\":\"567 Main Street\",\"city\":\"Tampa\",\"state\":\"Florida\",\"location_label\":\"567 Main Street, Tampa, Florida\",\"latitude\":27.9579985,\"longitude\":-82.5189677,\"point_source\":\"geocoded\",\"image\":\"\",\"categories\":[\"hiking\",\"camping\"]},{\"id\":10,\"name\":\"video test group 1\",\"address_1\":\"\",\"city\":\"Boston\",\"state\":\"Massachusetts\",\"location_label\":\"Boston, Massachusetts\",\"latitude\":42.3588336,\"longitude\":-71.0578303,\"point_source\":\"geocoded\",\"image\":\"https:\\\/\\\/buddyupapi-staging.us35.cdn-alpha.com\\\/wp-content\\\/uploads\\\/buddyup_112f569cd8658513.jpg\",\"categories\":[\"Archery\",\"BBQ\\\/Cookout\",\"Beachcombing\",\"Bird Watching\"]}],\"generated_at\":1785376409};\n<\/script>\n\n<section id=\"buddyUpExploreWrapper\" class=\"buddyUpContainer buddyUp\">\n    <div class=\"buddyUpExploreLayout\">\n        <div class=\"buddyUpElWrapper buddyUpExploreMapShell\">\n            <button type=\"button\" id=\"buddyUpExploreSidebarToggle\" class=\"buddyUpSideTab\" aria-expanded=\"false\" aria-controls=\"buddyUpExploreSidebar\" data-target=\"buddyUpExploreSidebar\" data-local-toggle=\"true\">\n                <i class=\"fa-solid fa-sliders\" aria-hidden=\"true\"><\/i>\n                <span>Filters<\/span>\n            <\/button>\n\n            <aside class=\"buddyUpElWrapper buddyUpExploreSidebar buddyUpSearchSidebar buddyUpFiltersShelf\" id=\"buddyUpExploreSidebar\" aria-hidden=\"true\">\n\n                <div class=\"buddyUpSearchSidebarSection buddyUpExploreSection buddyUpExploreSectionCollapsible\" id=\"buddyUpExploreMapFocusSection\">\n                    <button type=\"button\" class=\"buddyUpExploreSectionToggle\" data-target=\"buddyUpExploreMapFocusBody\" aria-expanded=\"true\">\n                        Map Focus\n                        <span class=\"buddyUpExploreSectionChevron\" aria-hidden=\"true\">\u25be<\/span>\n                    <\/button>\n                    <div id=\"buddyUpExploreMapFocusBody\" class=\"buddyUpExploreSectionBody\">\n                        <div class=\"buddyUpExploreFocusToggle\" id=\"buddyUpExploreFocusToggle\">\n                            <button type=\"button\" id=\"buddyUpExploreFocusAll\" class=\"buddyUpExploreFocusBtn isActive\">All<\/button>\n                            <button type=\"button\" id=\"buddyUpExploreFocusNearMe\" class=\"buddyUpExploreFocusBtn\">Near Me<\/button>\n                        <\/div>\n                    <\/div>\n                <\/div>\n\n                <div id=\"buddyUpExploreRadiusSection\" class=\"buddyUpSearchSidebarSection buddyUpExploreSection buddyUpExploreSectionCollapsible hidden\">\n                    <button type=\"button\" class=\"buddyUpExploreSectionToggle\" data-target=\"buddyUpExploreRadiusBody\" aria-expanded=\"true\">\n                        Radius\n                        <span class=\"buddyUpExploreSectionChevron\" aria-hidden=\"true\">\u25be<\/span>\n                    <\/button>\n                    <div id=\"buddyUpExploreRadiusBody\" class=\"buddyUpExploreSectionBody\">\n                        <div class=\"buddyUpExploreRadiusRow\">\n                            <input id=\"buddyUpExploreZip\" class=\"buddyUpInput\" type=\"text\" placeholder=\"City, state, or zip\" autocomplete=\"off\" \/>\n                        <\/div>\n                        <div id=\"buddyUpExploreZipResults\" class=\"buddyUpAutocompleteResults hidden\"><\/div>\n                        <div class=\"buddyUpExploreRadiusRow\">\n                            <input id=\"buddyUpExploreRadiusMiles\" class=\"buddyUpExploreRadiusSlider\" type=\"range\" min=\"5\" max=\"100\" step=\"5\" value=\"25\" \/>\n                            <div id=\"buddyUpExploreRadiusValue\" class=\"buddyUpExploreRadiusValue\">25 miles<\/div>\n                        <\/div>\n                        <button id=\"buddyUpExploreApplyRadius\" type=\"button\" class=\"buddyUpButton3 buddyUpExploreApplyRadius\">Apply Radius<\/button>\n                        <div id=\"buddyUpExploreRadiusHint\" class=\"textSmall buddyUpExploreRadiusHint\"><\/div>\n                    <\/div>\n                <\/div>\n\n                <div class=\"buddyUpSearchSidebarSection buddyUpExploreSection buddyUpExploreSectionCollapsible\" id=\"buddyUpExploreCategorySection\">\n                    <button type=\"button\" class=\"buddyUpExploreSectionToggle\" data-target=\"buddyUpExploreCategoryBody\" aria-expanded=\"true\">\n                        Categories\n                        <span class=\"buddyUpExploreSectionChevron\" aria-hidden=\"true\">\u25be<\/span>\n                    <\/button>\n                    <div id=\"buddyUpExploreCategoryBody\" class=\"buddyUpExploreSectionBody\">\n                        <div id=\"buddyUpExploreCategoryFilters\" class=\"buddyUpExploreToggleList\"><\/div>\n                    <\/div>\n                <\/div>\n\n                <div class=\"buddyUpSearchSidebarSection buddyUpExploreSection buddyUpExploreNearbySignedOut\" id=\"buddyUpExploreNearbySignedOut\">\n                    <div class=\"buddyUpExploreSectionTitle\">Nearby<\/div>\n                    <input id=\"buddyUpExploreNearbyRange\" class=\"buddyUpExploreNearbyRange\" type=\"range\" min=\"5\" max=\"100\" value=\"25\" disabled=\"disabled\" \/>\n                    <div class=\"buddyUpExploreNearbyLockCard\">\n                        <div class=\"buddyUpExploreNearbyLockTitle\">See Who\u2019s Out There<\/div>\n                        <div class=\"textSmall\">Join to See Buddies<\/div>\n                    <\/div>\n                <\/div>\n\n                <div id=\"buddyUpExploreFiltersOverlay\" class=\"buddyUpExploreFiltersOverlay hidden\">\n                    <div class=\"buddyUpExploreFiltersOverlayCard\">\n                        <strong>Unlock Full Explore<\/strong>\n                        <div class=\"textSmall\">Sign up or log in to discover nearby people, groups, and events.<\/div>\n                    <\/div>\n                <\/div>\n            <\/aside>\n\n            <div class=\"buddyUpExploreStatusBar\">\n                <div class=\"textSmall\" id=\"buddyUpExploreStatus\">Loading map...<\/div>\n            <\/div>\n\n            <div class=\"buddyUpExploreTopTabs\" id=\"buddyUpExploreTopTabs\">\n                <div class=\"buddyUpExploreTopTabsLabel\">View<\/div>\n                <div id=\"buddyUpExploreDatasetToggles\" class=\"buddyUpExploreTopTabsList\"><\/div>\n                <div id=\"buddyUpExploreLockMessage\" class=\"textSmall buddyUpExploreLock hidden\"><\/div>\n            <\/div>\n\n            <div class=\"buddyUpExploreMapCard\">\n                <div id=\"buddyUpExploreMap\" class=\"buddyUpExploreMap\"><\/div>\n                <div id=\"buddyUpExploreMapLoading\" class=\"buddyUpExploreMapLoading hidden\" aria-live=\"polite\" aria-busy=\"true\">\n                    <div class=\"buddyUpExploreMapLoadingInner\">\n                        <span class=\"buddyUpExploreSpinner\" aria-hidden=\"true\"><\/span>\n                        <span id=\"buddyUpExploreMapLoadingText\">Loading map data...<\/span>\n                        <button type=\"button\" id=\"buddyUpExploreMapRetry\" class=\"buddyUpButton3 buddyUpExploreMapRetry hidden\">Retry<\/button>\n                    <\/div>\n                <\/div>\n            <\/div>\n\n            <div id=\"buddyUpExploreSignedOutTease\" class=\"buddyUpExploreSignedOutTease hidden\">\n                <button type=\"button\" id=\"buddyUpExploreTeaseClose\" class=\"buddyUpExploreTeaseClose\" aria-label=\"Close\">\u00d7<\/button>\n                <div class=\"buddyUpExploreTeaseTitle\">Join to see who shared this!<\/div>\n                <div class=\"buddyUpExploreTeaseThumbs\" id=\"buddyUpExploreTeaseThumbs\">\n                    <span><\/span><span><\/span><span><\/span><span><\/span><span><\/span><span><\/span>\n                <\/div>\n                <div class=\"buddyUpExploreTeaseCopy\">Join BuddyUpGo to connect with people who share your interests<\/div>\n                <a href=\"https:\/\/staging.buddyupgo.com\/register\/\" class=\"buddyUpButton1 buddyUpExploreTeaseCta\">Join FREE to Connect<\/a>\n            <\/div>\n\n            <div id=\"buddyUpExploreSignedOutBottomCta\" class=\"buddyUpExploreSignedOutBottomCta hidden\">\n                <span>Explore is better with Buddies.<\/span>\n                <a href=\"https:\/\/staging.buddyupgo.com\/register\/\" class=\"buddyUpButton1\">Join FREE to Connect<\/a>\n            <\/div>\n        <\/div>\n    <\/div>\n<\/section>\n<script>(async function(){\n    const wrapper = document.getElementById('buddyUpExploreWrapper');\n    if (!wrapper) return;\n\n    const statusEl = document.getElementById('buddyUpExploreStatus');\n    const mapEl = document.getElementById('buddyUpExploreMap');\n    const mapLoadingEl = document.getElementById('buddyUpExploreMapLoading');\n    const mapLoadingTextEl = document.getElementById('buddyUpExploreMapLoadingText');\n    const mapRetryBtn = document.getElementById('buddyUpExploreMapRetry');\n    const datasetTogglesEl = document.getElementById('buddyUpExploreDatasetToggles');\n    const categoryFiltersEl = document.getElementById('buddyUpExploreCategoryFilters');\n    const lockMessageEl = document.getElementById('buddyUpExploreLockMessage');\n    const nearbySignedOutEl = document.getElementById('buddyUpExploreNearbySignedOut');\n    const signedOutTeaseEl = document.getElementById('buddyUpExploreSignedOutTease');\n    const signedOutTeaseThumbsEl = document.getElementById('buddyUpExploreTeaseThumbs');\n    const teaseCloseBtn = document.getElementById('buddyUpExploreTeaseClose');\n    const signedOutBottomCtaEl = document.getElementById('buddyUpExploreSignedOutBottomCta');\n    const sidebarEl = document.getElementById('buddyUpExploreSidebar');\n    const sidebarToggleBtn = document.getElementById('buddyUpExploreSidebarToggle');\n    const filtersOverlayEl = document.getElementById('buddyUpExploreFiltersOverlay');\n    const focusSectionEl = document.getElementById('buddyUpExploreMapFocusSection');\n    const focusAllBtn = document.getElementById('buddyUpExploreFocusAll');\n    const focusNearMeBtn = document.getElementById('buddyUpExploreFocusNearMe');\n    const searchNearSectionEl = document.getElementById('buddyUpExploreSearchNearSection');\n    const searchNearInput = document.getElementById('buddyUpExploreSearchNear');\n    const searchNearOptions = document.getElementById('buddyUpExploreSearchNearOptions');\n    const searchNearApplyBtn = document.getElementById('buddyUpExploreSearchNearApply');\n    const searchNearHint = document.getElementById('buddyUpExploreSearchNearHint');\n    const categorySectionEl = document.getElementById('buddyUpExploreCategorySection');\n    const radiusSectionEl = document.getElementById('buddyUpExploreRadiusSection');\n    const zipInput = document.getElementById('buddyUpExploreZip');\n    const zipResultsEl = document.getElementById('buddyUpExploreZipResults');\n    const radiusInput = document.getElementById('buddyUpExploreRadiusMiles');\n    const radiusValueEl = document.getElementById('buddyUpExploreRadiusValue');\n    const applyRadiusBtn = document.getElementById('buddyUpExploreApplyRadius');\n    const radiusHint = document.getElementById('buddyUpExploreRadiusHint');\n    let radiusLocationDebounce = null;\n    let selectedRadiusLocation = null;\n\n    const currentUser = (typeof BUDDYUP !== 'undefined' && typeof BUDDYUP.getCurrentUser === 'function')\n        ? BUDDYUP.getCurrentUser()\n        : null;\n    const ssrAuth = (typeof BUDDYUP !== 'undefined' && typeof BUDDYUP.getSsrAuthState === 'function')\n        ? BUDDYUP.getSsrAuthState()\n        : { logged_in: 0, user_id: 0, subscription_tier: 0 };\n    const ssrUserId = Number(ssrAuth && ssrAuth.user_id ? ssrAuth.user_id : 0);\n    const isLoggedIn = !!(\n        (currentUser && currentUser.id) ||\n        (typeof BUDDYUP.isLoggedInFast === 'function' && BUDDYUP.isLoggedInFast()) ||\n        (Number(ssrAuth && ssrAuth.logged_in ? ssrAuth.logged_in : 0) === 1 && ssrUserId > 0)\n    );\n    const currentUserId = Number((currentUser && currentUser.id) || ssrUserId || 0);\n\n    const maybeRedirectToHomeExplore = () => {\n        if (!isLoggedIn) return false;\n\n        const params = new URLSearchParams(window.location.search || '');\n        if (params.get('stay_explore') === '1') return false;\n\n        const homeUrl = buddyUpVariables && buddyUpVariables.for_me_link ? String(buddyUpVariables.for_me_link) : '';\n        if (!homeUrl) return false;\n\n        try {\n            const current = new URL(window.location.href);\n            const target = new URL(homeUrl, window.location.origin);\n            if (current.pathname === target.pathname) return false;\n\n            target.searchParams.set('home_tab', 'explore');\n\n            if (typeof BUDDYUP !== 'undefined' && typeof BUDDYUP.pjaxNavigate === 'function') {\n                BUDDYUP.pjaxNavigate(target.toString());\n            } else {\n                window.location.href = target.toString();\n            }\n            return true;\n        } catch (e) {\n            return false;\n        }\n    };\n\n    if (maybeRedirectToHomeExplore()) return;\n\n        const clearRadiusResults = () => {\n            if (!zipResultsEl) return;\n            zipResultsEl.innerHTML = '';\n            zipResultsEl.classList.add('hidden');\n        };\n\n        const applyRadiusSelection = (item) => {\n            selectedRadiusLocation = {\n                latitude: Number(item.latitude),\n                longitude: Number(item.longitude),\n                label: String(item.label || ''),\n            };\n            if (zipInput) zipInput.value = selectedRadiusLocation.label;\n            if (radiusHint) radiusHint.innerText = `Selected ${selectedRadiusLocation.label}.`;\n            clearRadiusResults();\n        };\n\n        const renderRadiusResults = (items) => {\n            if (!zipResultsEl) return;\n            if (!Array.isArray(items) || items.length === 0) {\n                clearRadiusResults();\n                return;\n            }\n\n            zipResultsEl.innerHTML = items.map((item, idx) => `\n                <button type=\"button\" id=\"buddyUpExploreZipAuto_${idx}\" class=\"buddyUpButton3\" style=\"margin:0 0 .35rem 0; text-align:left; width:100%; white-space:normal;\">${BUDDYUP.escapeHtml(item.label || '')}<\/button>\n            `).join('');\n            zipResultsEl.classList.remove('hidden');\n\n            items.forEach((item, idx) => {\n                const row = document.getElementById(`buddyUpExploreZipAuto_${idx}`);\n                if (!row) return;\n                row.addEventListener('click', (e) => {\n                    e.preventDefault();\n                    applyRadiusSelection(item);\n                });\n            });\n        };\n    if (!isLoggedIn && typeof BUDDYUP.syncAuthStateWithServer === 'function') {\n        BUDDYUP.syncAuthStateWithServer(false);\n    }\n\n    const state = {\n        mode: 'adventures',\n        categories: new Set(),\n        allByMode: {\n            adventures: [],\n            events: [],\n            groups: [],\n            buddies: [],\n            users: [],\n        },\n        loadedModes: {\n            adventures: false,\n            events: false,\n            groups: false,\n            buddies: false,\n            users: false,\n        },\n        zipCenter: null,\n        radiusMiles: 25,\n        buddyIds: new Set(),\n        sidebarCollapsed: false,\n        mapFocus: 'all',\n        userNearCenter: null,\n        searchNearCenter: null,\n        searchNearSuggestions: [],\n        searchNearDebounceTimer: null,\n    };\n\n    \/\/ Reject sentinel\/default coordinates and malformed values before they can\n    \/\/ force Leaflet to fit the entire world into a tall map container.\n    const hasValidMapCoordinates = (latitude, longitude) => {\n        const lat = Number(latitude);\n        const lng = Number(longitude);\n        if (!isFinite(lat) || !isFinite(lng)) return false;\n        if (lat < -85 || lat > 85 || lng < -180 || lng > 180) return false;\n        return !(lat === 0 && lng === 0);\n    };\n\n    const exploreSSR = window.buddyUpExploreSSR && typeof window.buddyUpExploreSSR === 'object'\n        ? window.buddyUpExploreSSR\n        : null;\n    let usedExploreSSR = false;\n\n    const getExploreAggregatePayload = async () => {\n        const unwrapPayload = (payload) => {\n            if (!payload || typeof payload !== 'object') return null;\n            if (String(payload.status || '').toLowerCase() !== 'success') return null;\n\n            const nested = payload.data && typeof payload.data === 'object' ? payload.data : null;\n            return nested || payload;\n        };\n\n        if (exploreSSR && String(exploreSSR.status || '').toLowerCase() === 'success') {\n            return exploreSSR;\n        }\n\n        const resp = await BUDDYUP.apiRequest('explore-aggregate', {\n            limit_adventures: 350,\n            limit_events: 80,\n            limit_groups: 40,\n            include_events: 1,\n            include_groups: 1,\n        });\n\n        return unwrapPayload(resp);\n    };\n\n    const pluckResponseArray = (payload, key) => {\n        if (!payload || typeof payload !== 'object') return [];\n        if (Array.isArray(payload[key])) return payload[key];\n        if (payload.data && typeof payload.data === 'object' && Array.isArray(payload.data[key])) {\n            return payload.data[key];\n        }\n        return [];\n    };\n\n    const GEO_CACHE_KEY = 'buddyupExploreGeoCacheV1';\n    const GEO_CACHE_MAX_AGE_MS = 1000 * 60 * 60 * 24 * 30;\n    const GEO_CACHE = {};\n    const GEO_IN_FLIGHT = {};\n    let map = null;\n    let markersLayer = null;\n    let mapLoadingToken = 0;\n\n    const safe = (v) => String(v || '').replace(\/[&<>\\\"]\/g, (m) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '\"': '&quot;' }[m]));\n    const isMobile = () => window.matchMedia('(max-width: 980px)').matches;\n\n    const loadLeaflet = async () => {\n        if (window.L && typeof window.L.map === 'function') return true;\n        if (window.buddyUpLeafletLoadPromise) return window.buddyUpLeafletLoadPromise;\n\n        window.buddyUpLeafletLoadPromise = (async () => {\n            if (!document.getElementById('buddyupLeafletCss')) {\n                const css = document.createElement('link');\n                css.id = 'buddyupLeafletCss';\n                css.rel = 'stylesheet';\n                css.href = 'https:\/\/cdn.jsdelivr.net\/npm\/leaflet@1.9.4\/dist\/leaflet.css';\n                document.head.appendChild(css);\n            }\n\n            \/\/ A prior PJAX instance can leave a still-loading script tag behind.\n            \/\/ The shared promise prevents later instances from treating that tag\n            \/\/ as proof that Leaflet is already ready.\n            document.querySelectorAll('#buddyupLeafletJs, script[data-buddyup-leaflet-loader=\"1\"]').forEach((script) => {\n                if (script && script.parentNode) script.parentNode.removeChild(script);\n            });\n\n            const sources = [\n                'https:\/\/cdn.jsdelivr.net\/npm\/leaflet@1.9.4\/dist\/leaflet.js',\n                'https:\/\/unpkg.com\/leaflet@1.9.4\/dist\/leaflet.js',\n                'https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/leaflet\/1.9.4\/leaflet.js',\n            ];\n\n            for (let index = 0; index < sources.length; index++) {\n                try {\n                    await new Promise((resolve, reject) => {\n                        const js = document.createElement('script');\n                        const timeout = window.setTimeout(() => {\n                            if (js.parentNode) js.parentNode.removeChild(js);\n                            reject(new Error('Leaflet request timed out.'));\n                        }, 5000);\n                        js.id = 'buddyupLeafletJs';\n                        js.dataset.buddyupLeafletLoader = '1';\n                        js.src = sources[index];\n                        js.async = true;\n                        js.onload = () => {\n                            window.clearTimeout(timeout);\n                            resolve();\n                        };\n                        js.onerror = () => {\n                            window.clearTimeout(timeout);\n                            if (js.parentNode) js.parentNode.removeChild(js);\n                            reject(new Error('Leaflet request failed.'));\n                        };\n                        document.head.appendChild(js);\n                    });\n                    if (window.L && typeof window.L.map === 'function') return true;\n                } catch (e) {}\n            }\n\n            return false;\n        })();\n\n        try {\n            return await window.buddyUpLeafletLoadPromise;\n        } finally {\n            if (!(window.L && typeof window.L.map === 'function')) {\n                window.buddyUpLeafletLoadPromise = null;\n            }\n        }\n    };\n\n    const loadGeoCacheFromStorage = () => {\n        try {\n            const raw = window.localStorage ? window.localStorage.getItem(GEO_CACHE_KEY) : '';\n            if (!raw) return;\n            const parsed = JSON.parse(raw);\n            if (!parsed || typeof parsed !== 'object') return;\n            const now = Date.now();\n\n            Object.keys(parsed).forEach((key) => {\n                const entry = parsed[key];\n                if (!entry || typeof entry !== 'object') return;\n                const ts = Number(entry.ts || 0);\n                if (!isFinite(ts) || (now - ts) > GEO_CACHE_MAX_AGE_MS) return;\n                if (!hasValidMapCoordinates(entry.latitude, entry.longitude)) return;\n\n                GEO_CACHE[key] = {\n                    latitude: Number(entry.latitude),\n                    longitude: Number(entry.longitude),\n                    city: String(entry.city || ''),\n                    state: String(entry.state || ''),\n                    label: String(entry.label || key),\n                };\n            });\n        } catch (e) {}\n    };\n\n    const persistGeoCacheToStorage = () => {\n        try {\n            if (!window.localStorage) return;\n            const payload = {};\n            const now = Date.now();\n            Object.keys(GEO_CACHE).forEach((key) => {\n                const item = GEO_CACHE[key];\n                if (!item || !hasValidMapCoordinates(item.latitude, item.longitude)) return;\n                payload[key] = {\n                    latitude: Number(item.latitude),\n                    longitude: Number(item.longitude),\n                    city: String(item.city || ''),\n                    state: String(item.state || ''),\n                    label: String(item.label || ''),\n                    ts: now,\n                };\n            });\n            window.localStorage.setItem(GEO_CACHE_KEY, JSON.stringify(payload));\n        } catch (e) {}\n    };\n\n    const cacheGeo = (cacheKey, geo) => {\n        GEO_CACHE[cacheKey] = geo;\n        persistGeoCacheToStorage();\n        return geo;\n    };\n\n    const geocodeText = async (text) => {\n        const q = String(text || '').trim();\n        if (!q) return null;\n\n        const cacheKey = q.toLowerCase();\n        if (GEO_CACHE[cacheKey]) return GEO_CACHE[cacheKey];\n        if (GEO_IN_FLIGHT[cacheKey]) return GEO_IN_FLIGHT[cacheKey];\n\n        GEO_IN_FLIGHT[cacheKey] = (async () => {\n            const found = await BUDDYUP.locationAutocompleteSearch(q);\n            if (!Array.isArray(found) || found.length === 0) return null;\n            const first = found[0];\n            if (!first || !hasValidMapCoordinates(first.latitude, first.longitude)) return null;\n            return cacheGeo(cacheKey, {\n                latitude: Number(first.latitude),\n                longitude: Number(first.longitude),\n                city: first.city || '',\n                state: first.state || '',\n                label: first.label || q,\n            });\n        })();\n\n        try {\n            return await GEO_IN_FLIGHT[cacheKey];\n        } finally {\n            delete GEO_IN_FLIGHT[cacheKey];\n        }\n    };\n\n    const mapWithConcurrency = async (items, limit, run) => {\n        const arr = Array.isArray(items) ? items : [];\n        if (!arr.length) return [];\n\n        const cap = Math.max(1, Number(limit || 1));\n        const out = new Array(arr.length);\n        let index = 0;\n\n        const workers = Array.from({ length: Math.min(cap, arr.length) }, async () => {\n            while (true) {\n                const i = index;\n                index += 1;\n                if (i >= arr.length) return;\n                out[i] = await run(arr[i], i);\n            }\n        });\n\n        await Promise.all(workers);\n        return out;\n    };\n\n    const buildRowLocationText = (row) => [row && row.city ? row.city : '', row && row.state ? row.state : '']\n        .filter(Boolean)\n        .join(', ')\n        .trim();\n\n    const resolveGeoLookupForTexts = async (texts, statusPrefix) => {\n        const uniqueTexts = Array.from(new Set((texts || []).map((x) => String(x || '').trim()).filter(Boolean)));\n        const lookup = {};\n        if (!uniqueTexts.length) return lookup;\n\n        if (statusEl && statusPrefix) {\n            statusEl.innerText = `${statusPrefix} (${uniqueTexts.length} locations)...`;\n        }\n\n        const pairs = await mapWithConcurrency(uniqueTexts, 8, async (text) => {\n            const geo = await geocodeText(text);\n            return [text, geo];\n        });\n\n        pairs.forEach((pair) => {\n            if (!Array.isArray(pair) || pair.length < 2) return;\n            const key = String(pair[0] || '').trim();\n            const geo = pair[1];\n            if (!key || !geo) return;\n            lookup[key] = geo;\n        });\n\n        return lookup;\n    };\n\n    const haversineMiles = (lat1, lon1, lat2, lon2) => {\n        const toRad = (d) => d * (Math.PI \/ 180);\n        const R = 3958.8;\n        const dLat = toRad(lat2 - lat1);\n        const dLon = toRad(lon2 - lon1);\n        const a = Math.sin(dLat\/2) * Math.sin(dLat\/2) + Math.cos(toRad(lat1)) * Math.cos(toRad(lat2)) * Math.sin(dLon\/2) * Math.sin(dLon\/2);\n        const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a));\n        return R * c;\n    };\n\n    const modeRules = {\n        adventures: { label: 'Adventures', locked: false },\n        events: { label: 'Events', locked: false },\n        groups: { label: 'Groups', locked: false },\n        buddies: { label: 'Buddies', locked: !isLoggedIn },\n        users: { label: 'Users', locked: !isLoggedIn },\n    };\n\n    const renderSignedOutState = () => {\n        if (signedOutTeaseEl) signedOutTeaseEl.classList.toggle('hidden', isLoggedIn);\n        if (signedOutBottomCtaEl) signedOutBottomCtaEl.classList.toggle('hidden', isLoggedIn);\n        if (nearbySignedOutEl) nearbySignedOutEl.classList.toggle('hidden', isLoggedIn);\n\n        if (sidebarEl) sidebarEl.classList.toggle('isLoggedOut', !isLoggedIn);\n        if (filtersOverlayEl) {\n            filtersOverlayEl.classList.toggle('hidden', isLoggedIn);\n        }\n\n        [searchNearInput, searchNearApplyBtn, focusNearMeBtn, focusAllBtn].forEach((el) => {\n            if (!el) return;\n            if (!isLoggedIn) el.setAttribute('disabled', 'disabled');\n            else el.removeAttribute('disabled');\n        });\n\n        if (teaseCloseBtn && signedOutTeaseEl) {\n            teaseCloseBtn.addEventListener('click', () => signedOutTeaseEl.classList.add('hidden'));\n        }\n\n        if (!isLoggedIn) {\n            if (radiusSectionEl) radiusSectionEl.classList.add('hidden');\n            if (categorySectionEl) categorySectionEl.classList.add('hidden');\n        } else {\n            if (categorySectionEl) categorySectionEl.classList.remove('hidden');\n        }\n\n        if (!isLoggedIn) {\n            if (focusSectionEl) focusSectionEl.classList.add('hidden');\n            if (searchNearSectionEl) searchNearSectionEl.classList.add('hidden');\n        } else {\n            if (focusSectionEl) focusSectionEl.classList.remove('hidden');\n            if (searchNearSectionEl) searchNearSectionEl.classList.remove('hidden');\n        }\n    };\n\n    const renderFocusToggle = () => {\n        if (focusAllBtn) focusAllBtn.classList.toggle('isActive', state.mapFocus === 'all');\n        if (focusNearMeBtn) focusNearMeBtn.classList.toggle('isActive', state.mapFocus === 'nearme');\n    };\n\n    const resolveNearMeCenterFromUser = async () => {\n        if (!isLoggedIn || !isFinite(currentUserId) || currentUserId <= 0) return null;\n        if (state.userNearCenter) return state.userNearCenter;\n\n        let searchText = '';\n        const zipCandidate = currentUser ? (currentUser.zip_code || currentUser.zip || currentUser.postal_code || '') : '';\n        if (zipCandidate) {\n            searchText = String(zipCandidate).trim();\n        }\n\n        if (!searchText) {\n            const account = await BUDDYUP.apiRequest('account-get', {\n                id: currentUserId,\n                fields: 'id,postal_code,zip,zip_code,city,state'\n            });\n            if (account && account.status === 'success') {\n                const zip = account.zip_code || account.zip || account.postal_code || '';\n                if (zip) searchText = String(zip).trim();\n                if (!searchText) {\n                    const city = account.city || '';\n                    const stateName = account.state || '';\n                    searchText = [city, stateName].filter(Boolean).join(', ');\n                }\n            }\n        }\n\n        if (!searchText) return null;\n\n        const center = await geocodeText(searchText);\n        if (!center) return null;\n        state.userNearCenter = {\n            latitude: Number(center.latitude),\n            longitude: Number(center.longitude),\n        };\n        return state.userNearCenter;\n    };\n\n    const renderSearchNearSuggestions = () => {\n        if (!searchNearOptions) return;\n        const options = Array.isArray(state.searchNearSuggestions) ? state.searchNearSuggestions : [];\n        searchNearOptions.innerHTML = options.map((x) => {\n            const label = x && x.label ? String(x.label) : '';\n            return label ? `<option value=\"${safe(label)}\"><\/option>` : '';\n        }).join('');\n    };\n\n    const applySearchNearCenter = async () => {\n        if (!isLoggedIn || !searchNearInput) return;\n        const query = String(searchNearInput.value || '').trim();\n        if (!query) {\n            state.searchNearCenter = null;\n            if (searchNearHint) searchNearHint.innerText = '';\n            renderMap();\n            return;\n        }\n\n        const center = await geocodeText(query);\n        if (!center) {\n            if (searchNearHint) searchNearHint.innerText = 'Could not locate that place.';\n            return;\n        }\n\n        state.searchNearCenter = {\n            latitude: Number(center.latitude),\n            longitude: Number(center.longitude),\n            label: String(center.label || query),\n        };\n        if (searchNearHint) searchNearHint.innerText = `Centered near ${state.searchNearCenter.label}.`;\n        renderMap();\n        closeSidebarOnMobile();\n    };\n\n    const syncSidebarUi = () => {\n        if (!sidebarEl || !sidebarToggleBtn) return;\n\n        const mobileLayout = isMobile();\n        if (!mobileLayout) {\n            state.sidebarCollapsed = false;\n\n            if (typeof BUDDYUP.closeFiltersShelf === 'function') {\n                BUDDYUP.closeFiltersShelf();\n            }\n\n            sidebarEl.classList.remove('isCollapsed');\n            sidebarEl.classList.remove('isOpen');\n            sidebarEl.classList.remove('activeMobileMenu');\n            sidebarEl.setAttribute('aria-hidden', 'false');\n            sidebarToggleBtn.classList.add('hidden');\n            sidebarToggleBtn.setAttribute('aria-expanded', 'true');\n            return;\n        }\n\n        const isOpen = !state.sidebarCollapsed;\n        sidebarToggleBtn.classList.remove('hidden');\n        sidebarEl.classList.toggle('isCollapsed', !isOpen);\n        sidebarToggleBtn.setAttribute('aria-expanded', isOpen ? 'true' : 'false');\n\n        if (isOpen) {\n            if (typeof BUDDYUP.openFiltersShelf === 'function') {\n                BUDDYUP.openFiltersShelf(sidebarEl);\n            } else {\n                sidebarEl.classList.add('isOpen');\n                sidebarEl.classList.add('activeMobileMenu');\n                sidebarEl.setAttribute('aria-hidden', 'false');\n            }\n            return;\n        }\n\n        if (typeof BUDDYUP.closeFiltersShelf === 'function') {\n            BUDDYUP.closeFiltersShelf();\n        } else {\n            sidebarEl.classList.remove('isOpen');\n            sidebarEl.classList.remove('activeMobileMenu');\n            sidebarEl.setAttribute('aria-hidden', 'true');\n        }\n    };\n\n    const closeSidebarOnMobile = () => {\n        if (!isMobile()) return;\n        state.sidebarCollapsed = true;\n        syncSidebarUi();\n    };\n\n    const sampleTeaseAdventureImages = () => {\n        const adventures = Array.isArray(state.allByMode.adventures) ? state.allByMode.adventures : [];\n        const all = adventures\n            .flatMap((adv) => {\n                const lead = adv && adv.image ? [String(adv.image)] : [];\n                const media = Array.isArray(adv && adv.media)\n                    ? adv.media.map((m) => m && m.url ? String(m.url) : '').filter(Boolean)\n                    : [];\n                return lead.concat(media);\n            })\n            .filter(Boolean);\n\n        const unique = Array.from(new Set(all));\n        for (let i = unique.length - 1; i > 0; i--) {\n            const j = Math.floor(Math.random() * (i + 1));\n            const t = unique[i];\n            unique[i] = unique[j];\n            unique[j] = t;\n        }\n        return unique.slice(0, 6);\n    };\n\n    const renderSignedOutTeaseThumbs = () => {\n        if (!signedOutTeaseThumbsEl) return;\n        const images = sampleTeaseAdventureImages();\n        if (!images.length) return;\n\n        signedOutTeaseThumbsEl.innerHTML = images.map((url, i) => (\n            `<img decoding=\"async\" src=\"${safe(url)}\" alt=\"Adventure preview ${i + 1}\" \/>`\n        )).join('');\n    };\n\n    const setMapLoading = (isLoading, message) => {\n        if (mapLoadingTextEl && message) {\n            mapLoadingTextEl.innerText = String(message);\n        }\n\n        if (!mapLoadingEl) return;\n\n        mapLoadingEl.classList.remove('is-error');\n        if (mapRetryBtn) mapRetryBtn.classList.add('hidden');\n\n        if (isLoading) {\n            mapLoadingEl.classList.remove('hidden');\n            if (markersLayer) {\n                markersLayer.clearLayers();\n            }\n            return;\n        }\n\n        mapLoadingEl.classList.add('hidden');\n    };\n\n    const setMapLoadError = (message) => {\n        if (mapLoadingTextEl) mapLoadingTextEl.innerText = String(message || 'The map could not load.');\n        if (!mapLoadingEl) return;\n        mapLoadingEl.classList.remove('hidden');\n        mapLoadingEl.classList.add('is-error');\n        if (mapRetryBtn) mapRetryBtn.classList.remove('hidden');\n    };\n\n    const renderModeToggles = () => {\n        datasetTogglesEl.innerHTML = '';\n\n        if (!isLoggedIn) {\n            ['adventures', 'events', 'groups'].forEach((mode) => {\n                const rule = modeRules[mode];\n                const id = `buddyUpExploreMode_${mode}`;\n                const active = state.mode === mode;\n                datasetTogglesEl.insertAdjacentHTML('beforeend', `\n                    <button id=\"${id}\" type=\"button\" class=\"buddyUpButton3 buddyUpExploreToggle ${active ? 'isActive' : ''}\">\n                        ${rule.label}\n                    <\/button>\n                `);\n                const btn = document.getElementById(id);\n                if (btn) {\n                    btn.addEventListener('click', async () => {\n                        if (state.mode === mode) return;\n\n                        const loadToken = ++mapLoadingToken;\n                        setMapLoading(true, `Loading ${rule.label}...`);\n\n                        state.mode = mode;\n                        state.categories = new Set();\n\n                        try {\n                            await ensureModeLoaded(mode);\n                            renderModeToggles();\n                            renderCategories();\n                            toggleRadiusSection();\n                            renderMap();\n                        } finally {\n                            if (loadToken === mapLoadingToken) {\n                                setMapLoading(false);\n                            }\n                        }\n                    });\n                }\n            });\n            lockMessageEl.classList.add('hidden');\n            lockMessageEl.innerHTML = '';\n            return;\n        }\n\n        Object.keys(modeRules).forEach((mode) => {\n            const rule = modeRules[mode];\n            const id = `buddyUpExploreMode_${mode}`;\n            datasetTogglesEl.insertAdjacentHTML('beforeend', `\n                <button id=\"${id}\" type=\"button\" class=\"buddyUpButton3 buddyUpExploreToggle ${state.mode === mode ? 'isActive' : ''}\" ${rule.locked ? 'disabled=\"disabled\"' : ''}>\n                    ${rule.locked ? '\ud83d\udd12 ' : ''}${rule.label}\n                <\/button>\n            `);\n            const btn = document.getElementById(id);\n            if (btn) {\n                btn.addEventListener('click', async () => {\n                    if (state.mode === mode) return;\n\n                    const loadToken = ++mapLoadingToken;\n                    setMapLoading(true, `Loading ${rule.label}...`);\n\n                    state.mode = mode;\n                    state.categories = new Set();\n\n                    try {\n                        await ensureModeLoaded(mode);\n                        renderModeToggles();\n                        renderCategories();\n                        toggleRadiusSection();\n                        renderMap();\n                    } finally {\n                        if (loadToken === mapLoadingToken) {\n                            setMapLoading(false);\n                        }\n                    }\n                });\n            }\n        });\n\n        lockMessageEl.classList.add('hidden');\n        lockMessageEl.innerHTML = '';\n    };\n\n    const getCategoriesForMode = () => {\n        const items = state.allByMode[state.mode] || [];\n        const catMap = {};\n        items.forEach((item) => {\n            const cats = Array.isArray(item.categories) ? item.categories : [];\n            cats.forEach((cat) => {\n                const c = String(cat || '').trim();\n                if (!c) return;\n                const key = c.toLowerCase();\n                catMap[key] = c;\n            });\n        });\n        return Object.keys(catMap).sort().map((key) => catMap[key]);\n    };\n\n    const renderCategories = () => {\n        categoryFiltersEl.innerHTML = '';\n        const categories = getCategoriesForMode();\n        if (!categories.length) {\n            categoryFiltersEl.innerHTML = '<div class=\"textSmall\" style=\"opacity:.75;\">No categories found.<\/div>';\n            return;\n        }\n\n        categories.forEach((cat, i) => {\n            const id = `buddyUpExploreCat_${i}`;\n            const active = state.categories.has(cat.toLowerCase());\n            categoryFiltersEl.insertAdjacentHTML('beforeend', `\n                <button id=\"${id}\" type=\"button\" class=\"buddyUpButton3 buddyUpExploreToggle buddyUpExploreCategoryToggle ${active ? 'isActive' : ''}\">${safe(cat)}<\/button>\n            `);\n            const btn = document.getElementById(id);\n            if (btn) {\n                btn.addEventListener('click', () => {\n                    const key = cat.toLowerCase();\n                    if (state.categories.has(key)) {\n                        state.categories = new Set();\n                    } else {\n                        state.categories = new Set([key]);\n                    }\n                    renderCategories();\n                    renderMap();\n                    closeSidebarOnMobile();\n                });\n            }\n        });\n    };\n\n    const toggleRadiusSection = () => {\n        const show = isLoggedIn;\n        if (show) radiusSectionEl.classList.remove('hidden');\n        else radiusSectionEl.classList.add('hidden');\n    };\n\n    const updateRadiusLabel = () => {\n        if (!radiusInput || !radiusValueEl) return;\n        const miles = Number(radiusInput.value || state.radiusMiles || 25);\n        radiusValueEl.innerText = `${miles} miles`;\n    };\n\n    const initCollapsibleSections = () => {\n        if (!sidebarEl) return;\n\n        const toggles = sidebarEl.querySelectorAll('.buddyUpExploreSectionToggle[data-target]');\n        toggles.forEach((btn) => {\n            if (!btn || btn.dataset.bound === '1') return;\n\n            const targetId = String(btn.getAttribute('data-target') || '').trim();\n            if (!targetId) return;\n\n            const body = document.getElementById(targetId);\n            const section = btn.closest('.buddyUpExploreSectionCollapsible');\n            if (!body || !section) return;\n\n            btn.dataset.bound = '1';\n            btn.addEventListener('click', () => {\n                const isCollapsed = section.classList.toggle('isCollapsed');\n                btn.setAttribute('aria-expanded', isCollapsed ? 'false' : 'true');\n            });\n        });\n    };\n\n    const normalizeAdventureItems = (rows) => {\n        return (rows || []).filter((row) => row && hasValidMapCoordinates(row.latitude, row.longitude)).map((row) => ({\n            type: 'adventure',\n            id: Number(row.id),\n            title: row.title || 'Adventure',\n            subtitle: [row.city, row.state].filter(Boolean).join(', ') || row.location_label || '',\n            description: row.body || '',\n            latitude: Number(row.latitude),\n            longitude: Number(row.longitude),\n            categories: Array.isArray(row.categories) ? row.categories : [],\n            image: row.preview_url || '',\n            media: Array.isArray(row.media) ? row.media : [],\n        }));\n    };\n\n    const normalizeEvents = async (seedRows) => {\n        let rows = Array.isArray(seedRows) ? seedRows : null;\n        if (!rows) {\n            const resp = await BUDDYUP.apiRequest('events-search', {});\n            rows = pluckResponseArray(resp, 'upcoming');\n        }\n        const sourceRows = rows.slice(0, 60);\n\n        const buildEventLocationCandidates = (ev) => {\n            const candidates = [\n                [ev.address, ev.address2, ev.city, ev.state, ev.zip].filter(Boolean).join(', '),\n                [ev.address, ev.city, ev.state, ev.zip].filter(Boolean).join(', '),\n                String(ev.location_name || '').trim(),\n                String(ev.location_label || '').trim(),\n                [ev.city, ev.state, ev.zip].filter(Boolean).join(', '),\n                [ev.city, ev.state].filter(Boolean).join(', '),\n                String(ev.zip || '').trim(),\n            ];\n\n            return Array.from(new Set(candidates.map((item) => String(item || '').trim()).filter(Boolean)));\n        };\n\n        const buildEventLocText = (ev) => {\n            const candidates = buildEventLocationCandidates(ev);\n            return candidates.length > 0 ? candidates[0] : '';\n        };\n\n        const unresolvedTexts = sourceRows\n            .filter((ev) => !hasValidMapCoordinates(ev && ev.latitude, ev && ev.longitude))\n            .flatMap((ev) => buildEventLocationCandidates(ev));\n\n        const geoLookup = await resolveGeoLookupForTexts(unresolvedTexts, 'Resolving event locations');\n\n        const out = [];\n        for (const ev of sourceRows) {\n            const locText = buildEventLocText(ev);\n            const rowLat = Number(ev && ev.latitude);\n            const rowLng = Number(ev && ev.longitude);\n\n            let latitude = null;\n            let longitude = null;\n\n            if (hasValidMapCoordinates(rowLat, rowLng)) {\n                latitude = rowLat;\n                longitude = rowLng;\n            } else {\n                const geo = buildEventLocationCandidates(ev)\n                    .map((candidate) => geoLookup[candidate] || null)\n                    .find((candidate) => candidate && hasValidMapCoordinates(candidate.latitude, candidate.longitude)) || null;\n                if (!geo) continue;\n                latitude = Number(geo.latitude);\n                longitude = Number(geo.longitude);\n            }\n\n            out.push({\n                type: 'event',\n                id: Number(ev.event_id || ev.id || 0),\n                title: ev.event_name || ev.name || 'Event',\n                subtitle: [ev.city, ev.state].filter(Boolean).join(', ') || locText,\n                latitude,\n                longitude,\n                categories: Array.isArray(ev.event_categories) ? ev.event_categories : (Array.isArray(ev.categories) ? ev.categories : []),\n                image: ev.event_image || ev.image || '',\n            });\n        }\n        return out;\n    };\n\n    const normalizeGroups = async (seedRows) => {\n        let rows = Array.isArray(seedRows) ? seedRows : null;\n        if (!rows) {\n            const resp = await BUDDYUP.apiRequest('groups-search', {});\n            rows = pluckResponseArray(resp, 'groups');\n        }\n        const sourceRows = rows.slice(0, 30);\n        const fullRows = sourceRows.map((group) => {\n            const locText = [group.city, group.state].filter(Boolean).join(', ') || group.location_label || group.address_1 || group.address || '';\n            return { group, locText };\n        });\n\n        const unresolvedTexts = fullRows\n            .filter((x) => !hasValidMapCoordinates(x && x.group && x.group.latitude, x && x.group && x.group.longitude))\n            .map((x) => x.locText);\n\n        const geoLookup = await resolveGeoLookupForTexts(unresolvedTexts, 'Resolving group locations');\n\n        const out = [];\n        for (const row of fullRows) {\n            const group = row.group;\n            const locText = row.locText || '';\n            const rowLat = Number(group && group.latitude);\n            const rowLng = Number(group && group.longitude);\n\n            let latitude = null;\n            let longitude = null;\n\n            if (hasValidMapCoordinates(rowLat, rowLng)) {\n                latitude = rowLat;\n                longitude = rowLng;\n            } else {\n                const geo = geoLookup[locText] || null;\n                if (!geo || !hasValidMapCoordinates(geo.latitude, geo.longitude)) continue;\n                latitude = Number(geo.latitude);\n                longitude = Number(geo.longitude);\n            }\n\n            out.push({\n                type: 'group',\n                id: Number(group.id || 0),\n                title: group.name || 'Group',\n                subtitle: locText,\n                latitude,\n                longitude,\n                categories: Array.isArray(group.categories) ? group.categories : [],\n                image: group.image || '',\n            });\n        }\n        return out;\n    };\n\n    const resolveBuddyIds = async () => {\n        if (!isLoggedIn || !isFinite(currentUserId) || currentUserId <= 0) return;\n        const account = await BUDDYUP.apiRequest('account-get', {\n            id: currentUserId,\n            include: 'buddies',\n            fields: 'id,buddies'\n        });\n        const buddies = account && Array.isArray(account.buddies) ? account.buddies : [];\n        buddies.forEach((b) => {\n            if (b && b.id) state.buddyIds.add(Number(b.id));\n        });\n    };\n\n    const normalizeUsers = async () => {\n        const resp = await BUDDYUP.apiRequest('users-search', { location: '', categories: [] });\n        const rows = pluckResponseArray(resp, 'users');\n        const sourceRows = rows.slice(0, 250).filter((user) => {\n            if (!user || !user.id) return false;\n            if (isFinite(currentUserId) && currentUserId > 0) {\n                return Number(user.id) !== currentUserId;\n            }\n            return true;\n        });\n        const geoLookup = await resolveGeoLookupForTexts(\n            sourceRows.map((user) => buildRowLocationText(user)),\n            'Resolving buddies and users locations'\n        );\n        const out = [];\n        for (const user of sourceRows) {\n            const locText = buildRowLocationText(user);\n            const geo = geoLookup[locText] || null;\n            if (!geo || !hasValidMapCoordinates(geo.latitude, geo.longitude)) continue;\n            out.push({\n                type: state.buddyIds.has(Number(user.id)) ? 'buddy' : 'user',\n                id: Number(user.id),\n                title: (user.username || '').trim() || (user.full_name || '').trim() || `${user.first_name || ''} ${user.last_name || ''}`.trim() || 'User',\n                subtitle: locText,\n                latitude: Number(geo.latitude),\n                longitude: Number(geo.longitude),\n                categories: Array.isArray(user.interests) ? user.interests : [],\n                image: user.profile_image ? BUDDYUP.profileImageSrc(user.profile_image) : '',\n            });\n        }\n        state.allByMode.buddies = out.filter((x) => x.type === 'buddy');\n        state.allByMode.users = out.filter((x) => x.type === 'user');\n    };\n\n    const ensureModeLoaded = async (mode) => {\n        if (!mode || state.loadedModes[mode] === true) return;\n\n        if (mode === 'adventures') {\n            statusEl.innerText = 'Loading Adventures...';\n\n            let adventuresRows = [];\n            if (!usedExploreSSR && exploreSSR && String(exploreSSR.status || '').toLowerCase() === 'success' && Array.isArray(exploreSSR.adventures)) {\n                adventuresRows = exploreSSR.adventures;\n                usedExploreSSR = true;\n            } else {\n                const adv = await BUDDYUP.apiRequest('adventures-explore-map', { limit: 350 });\n                adventuresRows = pluckResponseArray(adv, 'adventures');\n            }\n\n            state.allByMode.adventures = normalizeAdventureItems(adventuresRows);\n            state.loadedModes.adventures = true;\n            renderSignedOutTeaseThumbs();\n            return;\n        }\n\n        if (mode === 'events') {\n            statusEl.innerText = 'Loading Events...';\n            const aggregate = await getExploreAggregatePayload();\n            const seed = aggregate && Array.isArray(aggregate.events) ? aggregate.events : null;\n            state.allByMode.events = await normalizeEvents(seed);\n            state.loadedModes.events = true;\n            return;\n        }\n\n        if (mode === 'groups') {\n            statusEl.innerText = 'Loading Groups...';\n            const aggregate = await getExploreAggregatePayload();\n            const seed = aggregate && Array.isArray(aggregate.groups) ? aggregate.groups : null;\n            state.allByMode.groups = await normalizeGroups(seed);\n            state.loadedModes.groups = true;\n            return;\n        }\n\n        if (!isLoggedIn) return;\n\n        if (mode === 'users' || mode === 'buddies') {\n            statusEl.innerText = 'Loading Buddies and Users...';\n            await resolveBuddyIds();\n            await normalizeUsers();\n            state.loadedModes.users = true;\n            state.loadedModes.buddies = true;\n            return;\n        }\n    };\n\n    const getActiveCenter = () => {\n        if (state.searchNearCenter) {\n            return {\n                latitude: Number(state.searchNearCenter.latitude),\n                longitude: Number(state.searchNearCenter.longitude),\n            };\n        }\n\n        if (state.mapFocus === 'nearme' && state.userNearCenter) {\n            return {\n                latitude: Number(state.userNearCenter.latitude),\n                longitude: Number(state.userNearCenter.longitude),\n            };\n        }\n\n        return null;\n    };\n\n    const getFilteredItems = () => {\n        let items = state.allByMode[state.mode] || [];\n\n        if (state.categories.size > 0) {\n            items = items.filter((item) => {\n                const itemCats = Array.isArray(item.categories) ? item.categories.map((c) => String(c).toLowerCase()) : [];\n                return itemCats.some((c) => state.categories.has(c));\n            });\n        }\n\n        const center = getActiveCenter();\n        if (center && state.mapFocus === 'nearme' && isFinite(state.radiusMiles)) {\n            items = items.filter((item) => {\n                const d = haversineMiles(center.latitude, center.longitude, Number(item.latitude), Number(item.longitude));\n                return d <= state.radiusMiles;\n            });\n        }\n\n        return items;\n    };\n\n    const buildIcon = (item) => {\n        if (item.type === 'adventure' && item.image) {\n            return L.divIcon({\n                className: 'buddyUpExplorePinWrap',\n                html: `<div class=\"buddyUpExplorePin\"><img decoding=\"async\" src=\"${safe(item.image)}\" alt=\"Adventure\" \/><span class=\"buddyUpExplorePinDot\"><\/span><\/div>`,\n                iconSize: [64, 72],\n                iconAnchor: [32, 60],\n                popupAnchor: [0, -56],\n            });\n        }\n        return null;\n    };\n\n    \/\/ Build deep links into the matching single-detail pages.\n    const buildDetailLink = (item) => {\n        if (!item || !item.id) return '';\n        if (!isLoggedIn) return '';\n        const id = Number(item.id);\n        if (!isFinite(id) || id <= 0) return '';\n\n        const addPathId = (base, paramName) => {\n            const url = String(base || '').trim();\n            if (!url) return '';\n            if (url.indexOf('?') >= 0) {\n                return `${url}${url.endsWith('?') || url.endsWith('&') ? '' : '&'}${paramName}=${id}`;\n            }\n            return `${url}${url.endsWith('\/') ? '' : '\/'}${id}`;\n        };\n\n        if (item.type === 'adventure') {\n            return addPathId(buddyUpVariables && buddyUpVariables.adventure_link ? buddyUpVariables.adventure_link : '', 'adventure_id');\n        }\n        if (item.type === 'event') {\n            return addPathId(buddyUpVariables && buddyUpVariables.event_link ? buddyUpVariables.event_link : '', 'event_id');\n        }\n        if (item.type === 'group') {\n            return addPathId(buddyUpVariables && buddyUpVariables.group_link ? buddyUpVariables.group_link : '', 'group_id');\n        }\n        if (item.type === 'user' || item.type === 'buddy') {\n            return addPathId(buddyUpVariables && buddyUpVariables.account_link ? buddyUpVariables.account_link : '', 'user_id');\n        }\n\n        return '';\n    };\n\n    \/\/ Adventure popups render richer media cards; other types use compact cards.\n    const buildPopupHtml = (item) => {\n        const detailLink = buildDetailLink(item);\n        if (item.type !== 'adventure') {\n            return `\n                <div class=\"buddyUpExplorePopupCard\">\n                    <div class=\"buddyUpExplorePopupTitle\">${safe(item.title)}<\/div>\n                    ${item.subtitle ? `<div class=\"buddyUpExplorePopupSubtitle\">${safe(item.subtitle)}<\/div>` : ''}\n                    ${item.image ? `<img decoding=\"async\" class=\"buddyUpExplorePopupHero\" src=\"${safe(item.image)}\" alt=\"${safe(item.title)}\" \/>` : ''}\n                    ${detailLink ? `<a href=\"${safe(detailLink)}\" class=\"buddyUpButton1 buddyUpExplorePopupLink\">Open ${safe(item.type === 'buddy' ? 'Buddy' : item.type.charAt(0).toUpperCase() + item.type.slice(1))}<\/a>` : ''}\n                <\/div>\n            `;\n        }\n\n        const descriptionRaw = String(item.description || '').replace(\/<[^>]*>\/g, ' ').trim();\n        const description = descriptionRaw.length > 0 ? descriptionRaw : '';\n        const media = Array.isArray(item.media) ? item.media : [];\n\n        const mediaHtml = media.length > 0\n            ? `<div class=\"buddyUpExplorePopupGallery\">${media.map((m, i) => {\n                const mUrl = m && m.url ? safe(m.url) : '';\n                const mType = m && String(m.type || '').toLowerCase() === 'video' ? 'video' : 'image';\n                const mDesc = m && m.description ? safe(m.description) : '';\n                if (!mUrl) return '';\n\n                return `\n                    <div class=\"buddyUpExplorePopupMediaItem\">\n                        ${mType === 'video'\n                            ? BUDDYUP.renderVideoMediaHtml(m.url, { className: 'buddyUpExplorePopupMedia', title: `${item && item.title ? item.title : 'Adventure'} video ${i + 1}` })\n                            : `<img decoding=\"async\" src=\"${mUrl}\" alt=\"${safe((m && m.description) ? m.description : `Adventure media ${i + 1}`)}\" class=\"buddyUpExplorePopupMedia\" \/>`\n                        }\n                        ${mDesc ? `<div class=\"buddyUpExplorePopupMediaCaption\">${mDesc}<\/div>` : ''}\n                    <\/div>\n                `;\n            }).join('')}<\/div>`\n            : (item.image ? `<img decoding=\"async\" class=\"buddyUpExplorePopupHero\" src=\"${safe(item.image)}\" alt=\"${safe(item.title)}\" \/>` : '');\n\n        return `\n            <div class=\"buddyUpExplorePopupCard\">\n                <div class=\"buddyUpExplorePopupHeader\">\n                    <div class=\"buddyUpExplorePopupBadge\">Adventure<\/div>\n                    <div class=\"buddyUpExplorePopupTitle\">${safe(item.title)}<\/div>\n                    ${item.subtitle ? `<div class=\"buddyUpExplorePopupSubtitle\">${safe(item.subtitle)}<\/div>` : ''}\n                <\/div>\n                ${description ? `<div class=\"buddyUpExplorePopupDescription\">${safe(description)}<\/div>` : ''}\n                ${mediaHtml}\n                ${detailLink ? `<a href=\"${safe(detailLink)}\" class=\"buddyUpButton1 buddyUpExplorePopupLink\">Open Adventure<\/a>` : ''}\n            <\/div>\n        `;\n    };\n\n    const renderMap = () => {\n        if (!map || !markersLayer) return;\n\n        const items = getFilteredItems();\n        markersLayer.clearLayers();\n\n        if (items.length === 0) {\n            statusEl.innerText = 'No map results match the current filters.';\n            return;\n        }\n\n        statusEl.innerText = `Showing ${items.length} ${state.mode}.`;\n\n        const markerRefs = [];\n        items.forEach((item) => {\n            const lat = Number(item.latitude);\n            const lng = Number(item.longitude);\n            if (!hasValidMapCoordinates(lat, lng)) return;\n\n            const opts = {};\n            const icon = buildIcon(item);\n            if (icon) opts.icon = icon;\n            const marker = L.marker([lat, lng], opts);\n\n            marker.bindPopup(() => buildPopupHtml(item), {\n                maxWidth: 420,\n                minWidth: 280,\n                className: 'buddyUpExplorePopup'\n            });\n\n            markersLayer.addLayer(marker);\n            markerRefs.push(marker);\n        });\n\n        if (markerRefs.length === 0) {\n            statusEl.innerText = 'No results have usable map locations yet.';\n            map.setView([39.5, -98.35], 4);\n            return;\n        }\n\n        if (markerRefs.length === 1) {\n            map.setView(markerRefs[0].getLatLng(), 11);\n        } else if (markerRefs.length > 1) {\n            const center = getActiveCenter();\n\n            if (center) {\n                if (state.mapFocus === 'nearme') {\n                    map.setView([center.latitude, center.longitude], 10);\n                } else {\n                    map.setView([center.latitude, center.longitude], 9);\n                }\n                return;\n            }\n\n            const group = L.featureGroup(markerRefs);\n            const bounds = group.getBounds();\n            map.fitBounds(bounds.pad(0.16), {\n                maxZoom: 10,\n                paddingTopLeft: isMobile() ? [24, 24] : [340, 24],\n                paddingBottomRight: [24, 24],\n            });\n        }\n    };\n\n    loadGeoCacheFromStorage();\n\n    let exploreStartupPromise = null;\n    const syncExploreUi = () => {\n        state.sidebarCollapsed = isMobile();\n        renderSignedOutState();\n        renderSignedOutTeaseThumbs();\n        renderFocusToggle();\n        renderModeToggles();\n        renderCategories();\n        toggleRadiusSection();\n        initCollapsibleSections();\n        updateRadiusLabel();\n        renderMap();\n        syncSidebarUi();\n    };\n\n    const refreshMapSize = () => {\n        if (!map || typeof map.invalidateSize !== 'function') return;\n        window.requestAnimationFrame(() => {\n            window.requestAnimationFrame(() => {\n                try { map.invalidateSize({ pan: false }); } catch (e) {}\n            });\n        });\n    };\n\n    const startExploreMap = async () => {\n        if (exploreStartupPromise) return exploreStartupPromise;\n        exploreStartupPromise = (async () => {\n            setMapLoading(true, map ? 'Loading Adventures...' : 'Loading map...');\n            const okLeaflet = await loadLeaflet();\n            if (!okLeaflet) throw new Error('The map library could not load. Check your connection and retry.');\n\n            if (!map) {\n                map = L.map(mapEl, {\n                    scrollWheelZoom: true,\n                    minZoom: 3,\n                    worldCopyJump: true,\n                });\n                map.setView([39.5, -98.35], 4);\n                L.tileLayer('https:\/\/tile.openstreetmap.org\/{z}\/{x}\/{y}.png', {\n                    minZoom: 3,\n                    maxZoom: 19,\n                    attribution: '&copy; OpenStreetMap contributors'\n                }).addTo(map);\n                markersLayer = L.layerGroup().addTo(map);\n                map.on('click', closeSidebarOnMobile);\n            }\n\n            \/\/ Reveal the base map as soon as Leaflet is ready; data loading can\n            \/\/ continue without making the page look frozen behind an overlay.\n            setMapLoading(false);\n            refreshMapSize();\n            if (statusEl) statusEl.innerText = 'Loading Adventures...';\n            await ensureModeLoaded('adventures');\n            syncExploreUi();\n            refreshMapSize();\n            return true;\n        })().catch((error) => {\n            const message = error && error.message\n                ? error.message\n                : 'The map could not load. Please retry.';\n            if (statusEl) statusEl.innerText = message;\n            setMapLoadError(message);\n            return false;\n        }).finally(() => {\n            exploreStartupPromise = null;\n        });\n        return exploreStartupPromise;\n    };\n\n    if (mapRetryBtn) {\n        mapRetryBtn.addEventListener('click', (event) => {\n            event.preventDefault();\n            startExploreMap();\n        });\n    }\n\n    await startExploreMap();\n\n    if (focusAllBtn) {\n        focusAllBtn.addEventListener('click', () => {\n            if (!isLoggedIn) return;\n            state.mapFocus = 'all';\n            renderFocusToggle();\n            renderMap();\n            closeSidebarOnMobile();\n        });\n    }\n\n    if (focusNearMeBtn) {\n        focusNearMeBtn.addEventListener('click', async () => {\n            if (!isLoggedIn) return;\n            const center = await resolveNearMeCenterFromUser();\n            if (!center) {\n                if (radiusHint) radiusHint.innerText = 'Set your location on account to use Near Me.';\n                return;\n            }\n\n            state.mapFocus = 'nearme';\n            state.radiusMiles = 15;\n            if (radiusInput) radiusInput.value = '15';\n            updateRadiusLabel();\n            if (radiusHint) radiusHint.innerText = 'Near Me active (15 mile radius).';\n            renderFocusToggle();\n            renderMap();\n            closeSidebarOnMobile();\n        });\n    }\n\n    if (sidebarToggleBtn) {\n        sidebarToggleBtn.addEventListener('click', () => {\n            const shelfOpenNow = sidebarEl && (sidebarEl.classList.contains('isOpen') || sidebarEl.classList.contains('activeMobileMenu'));\n            state.sidebarCollapsed = !!shelfOpenNow;\n            syncSidebarUi();\n        });\n    }\n\n    if (sidebarEl && typeof BUDDYUP.initShelfSwipeGestures === 'function') {\n        BUDDYUP.initShelfSwipeGestures({\n            shelf: sidebarEl,\n            tab: sidebarToggleBtn,\n            onOpen: () => { state.sidebarCollapsed = false; syncSidebarUi(); },\n            onClose: closeSidebarOnMobile,\n            isOpen: () => sidebarEl.classList.contains('isOpen') || sidebarEl.classList.contains('activeMobileMenu'),\n            key: 'explore.sidebar',\n        });\n    }\n\n    if (window && typeof window.addEventListener === 'function') {\n        window.addEventListener('resize', () => {\n            syncSidebarUi();\n            refreshMapSize();\n        });\n    }\n\n    document.addEventListener('buddyup:homeModeChange', (event) => {\n        if (event && event.detail && event.detail.mode === 'explore') refreshMapSize();\n    });\n    document.addEventListener('buddyUpPageChange', refreshMapSize);\n    document.addEventListener('visibilitychange', () => {\n        if (document.visibilityState === 'visible') refreshMapSize();\n    });\n    if (typeof ResizeObserver === 'function' && mapEl) {\n        const mapResizeObserver = new ResizeObserver(refreshMapSize);\n        mapResizeObserver.observe(mapEl);\n    }\n\n    if (applyRadiusBtn) {\n        applyRadiusBtn.addEventListener('click', async () => {\n            const locationQuery = String(zipInput && zipInput.value ? zipInput.value : '').trim();\n            if (!locationQuery) {\n                state.searchNearCenter = null;\n                radiusHint.innerText = 'Radius cleared.';\n                renderMap();\n                return;\n            }\n\n            const center = selectedRadiusLocation && selectedRadiusLocation.label === locationQuery\n                ? selectedRadiusLocation\n                : await geocodeText(locationQuery);\n            if (!center) {\n                radiusHint.innerText = 'Could not locate that place.';\n                return;\n            }\n\n            state.searchNearCenter = { latitude: Number(center.latitude), longitude: Number(center.longitude), label: center.label || locationQuery };\n            state.mapFocus = 'nearme';\n            state.radiusMiles = Number(radiusInput && radiusInput.value ? radiusInput.value : 25);\n            updateRadiusLabel();\n            renderFocusToggle();\n            radiusHint.innerText = `Showing ${state.radiusMiles} mile radius around ${state.searchNearCenter.label}.`;\n            renderMap();\n        });\n    }\n\n    if (zipInput) {\n        zipInput.addEventListener('input', () => {\n            const q = String(zipInput.value || '').trim();\n            selectedRadiusLocation = null;\n            if (radiusLocationDebounce) clearTimeout(radiusLocationDebounce);\n            if (q.length < 3) {\n                clearRadiusResults();\n                return;\n            }\n\n            radiusLocationDebounce = setTimeout(async () => {\n                const rows = await BUDDYUP.locationAutocompleteSearch(q);\n                renderRadiusResults(rows);\n            }, 250);\n        });\n\n        document.addEventListener('click', (e) => {\n            if (!zipResultsEl) return;\n            if (!zipResultsEl.contains(e.target) && e.target !== zipInput) {\n                clearRadiusResults();\n            }\n        });\n    }\n\n    if (radiusInput) {\n        radiusInput.addEventListener('input', () => {\n            state.radiusMiles = Number(radiusInput.value || 25);\n            updateRadiusLabel();\n        });\n    }\n})();\n<\/script><\/div><\/div>\n            <\/section>\n        <\/section>\n\n        <section id=\"buddyUpHomeForYouPanel\" class=\"buddyUpHomeModePanel\" data-home-mode-panel=\"for-you\" role=\"tabpanel\" aria-labelledby=\"buddyUpHomeForYouTab\" aria-hidden=\"true\">\n            <div id=\"buddyUpForYouStatus\" class=\"buddyUpForYouStatus\">Preparing your feed...<\/div>\n\n            <section class=\"buddyUpForYouRail\" data-rail=\"events\">\n                <div class=\"buddyUpForYouRailHead\">\n                    <h2>Events for You<\/h2>\n                    <a href=\"https:\/\/staging.buddyupgo.com\/events\/\" class=\"buddyUpLink\">See all events<\/a>\n                <\/div>\n                <div id=\"buddyUpForYouEvents\" class=\"buddyUpForYouRailTrack\"><\/div>\n            <\/section>\n\n            <section class=\"buddyUpForYouRail\" data-rail=\"groups\">\n                <div class=\"buddyUpForYouRailHead\">\n                    <h2>Groups for You<\/h2>\n                    <a href=\"https:\/\/staging.buddyupgo.com\/groups\/\" class=\"buddyUpLink\">See all groups<\/a>\n                <\/div>\n                <div id=\"buddyUpForYouGroups\" class=\"buddyUpForYouRailTrack\"><\/div>\n            <\/section>\n\n            <section class=\"buddyUpForYouRail\" data-rail=\"adventures\">\n                <div class=\"buddyUpForYouRailHead\">\n                    <h2>Adventures for You<\/h2>\n                    <a href=\"https:\/\/staging.buddyupgo.com\/explore\/\" class=\"buddyUpLink\">Browse explore<\/a>\n                <\/div>\n                <div id=\"buddyUpForYouAdventures\" class=\"buddyUpForYouRailTrack\"><\/div>\n            <\/section>\n        <\/section>\n    <\/div>\n<\/section>\n<script>(function() {\n    const wrapper = document.getElementById('buddyUpHomeLanding');\n    if (!wrapper) return;\n\n    const anonView = wrapper.querySelector('.buddyUpHomeLandingAnonView');\n    const forYouView = wrapper.querySelector('#buddyUpForYouView');\n    const onboardingFlow = wrapper.querySelector('#buddyUpOnboardingFlow');\n    const onboardingBackButton = wrapper.querySelector('#buddyUpOnboardingBack');\n    const onboardingNextButton = wrapper.querySelector('#buddyUpOnboardingNext');\n    const onboardingScreens = Array.from(wrapper.querySelectorAll('.buddyUpOnboardingScreen'));\n    const onboardingExploreHost = wrapper.querySelector('#buddyUpOnboardingExploreHost');\n    const exploreWidget = wrapper.querySelector('.buddyUpHomeLandingWidget');\n    const forYouStatus = wrapper.querySelector('#buddyUpForYouStatus');\n    const homeModeTabs = Array.from(wrapper.querySelectorAll('[data-home-mode]'));\n    const homeModePanels = Array.from(wrapper.querySelectorAll('[data-home-mode-panel]'));\n\n    const eventsRail = wrapper.querySelector('#buddyUpForYouEvents');\n    const groupsRail = wrapper.querySelector('#buddyUpForYouGroups');\n    const adventuresRail = wrapper.querySelector('#buddyUpForYouAdventures');\n\n    const imageFallback = (window.buddyUpVariables && buddyUpVariables.plugin_path)\n        ? `${buddyUpVariables.plugin_path}img\/trailer-image.webp`\n        : '';\n\n    let recommendationsLoaded = false;\n    let onboardingShowExplore = false;\n    let onboardingActiveScreen = '';\n    let onboardingInitialized = false;\n    let introFlipTimer = null;\n    let introFlipCategoryPromise = null;\n    let introFlipIndex = 0;\n    let homeModeInitialized = false;\n    let activeHomeMode = 'explore';\n    const postLoginRedirectKey = 'buddyup_post_login_redirect';\n    const registerSourceKey = 'buddyup_register_source';\n    const introCategoriesCacheKey = 'buddyup_intro_categories_v1';\n    const homeModeStorageKey = 'buddyup_home_mode';\n    const introFlipFallbackCategories = [\n        'Hiking',\n        'Camping',\n        'Trail Running',\n        'Paddling',\n        'Fishing',\n        'Climbing',\n        'Cycling'\n    ];\n\n    const resolveDestinationUrl = function(destinationKey) {\n        const key = String(destinationKey || '').trim().toLowerCase();\n        if (!key) return '';\n        const links = (window.buddyUpVariables && typeof buddyUpVariables === 'object') ? buddyUpVariables : {};\n\n        if (key === 'events') return links.events_link || '';\n        if (key === 'explore') return links.explore_link || '';\n        if (key === 'groups') return links.groups_link || '';\n        if (key === 'people') return links.user_search_link || '';\n        if (key === 'subscriptions') return links.subscriptions_info_link || '';\n        return links.for_me_link || links.home_link || links.account_link || '';\n    };\n\n    const isSafeInternalUrl = function(url) {\n        const raw = String(url || '').trim();\n        if (!raw) return false;\n\n        try {\n            const parsed = new URL(raw, window.location.origin);\n            return parsed.origin === window.location.origin;\n        } catch (e) {\n            return false;\n        }\n    };\n\n    const normalizeHomeMode = function(mode) {\n        const val = String(mode || '').trim().toLowerCase();\n        return val === 'for-you' ? 'for-you' : 'explore';\n    };\n\n    const readStoredHomeMode = function() {\n        const fromQuery = (new URLSearchParams(window.location.search)).get('home_tab');\n        if (fromQuery) return normalizeHomeMode(fromQuery);\n\n        try {\n            const localValue = localStorage.getItem(homeModeStorageKey);\n            if (localValue) return normalizeHomeMode(localValue);\n        } catch (e) {}\n\n        try {\n            const sessionValue = sessionStorage.getItem(homeModeStorageKey);\n            if (sessionValue) return normalizeHomeMode(sessionValue);\n        } catch (e) {}\n\n        return 'explore';\n    };\n\n    const writeStoredHomeMode = function(mode) {\n        const normalized = normalizeHomeMode(mode);\n        try { localStorage.setItem(homeModeStorageKey, normalized); } catch (e) {}\n        try { sessionStorage.setItem(homeModeStorageKey, normalized); } catch (e) {}\n    };\n\n    const setHomeMode = function(mode, persist) {\n        const normalized = normalizeHomeMode(mode);\n        activeHomeMode = normalized;\n        wrapper.setAttribute('data-home-mode', normalized);\n\n        homeModeTabs.forEach((tab) => {\n            const tabMode = normalizeHomeMode(tab.getAttribute('data-home-mode'));\n            const isActive = tabMode === normalized;\n            tab.classList.toggle('isActive', isActive);\n            tab.setAttribute('aria-selected', isActive ? 'true' : 'false');\n            tab.setAttribute('tabindex', isActive ? '0' : '-1');\n        });\n\n        homeModePanels.forEach((panel) => {\n            const panelMode = normalizeHomeMode(panel.getAttribute('data-home-mode-panel'));\n            const isActive = panelMode === normalized;\n            panel.classList.toggle('isActive', isActive);\n            panel.setAttribute('aria-hidden', isActive ? 'false' : 'true');\n        });\n\n        if (persist !== false) {\n            writeStoredHomeMode(normalized);\n        }\n\n        document.dispatchEvent(new CustomEvent('buddyup:homeModeChange', {\n            detail: { mode: normalized },\n        }));\n    };\n\n    const initHomeModeTabs = function() {\n        if (homeModeInitialized || homeModeTabs.length === 0 || homeModePanels.length === 0) return;\n        homeModeInitialized = true;\n\n        homeModeTabs.forEach((tab) => {\n            tab.addEventListener('click', function(e) {\n                e.preventDefault();\n                setHomeMode(tab.getAttribute('data-home-mode'));\n            });\n\n            tab.addEventListener('keydown', function(e) {\n                if (e.key === 'Enter' || e.key === ' ') {\n                    e.preventDefault();\n                    setHomeMode(tab.getAttribute('data-home-mode'));\n                }\n            });\n        });\n    };\n\n    const persistOnboardingRegistrationIntent = function(destinationKey, sourceKey) {\n        const resolved = resolveDestinationUrl(destinationKey);\n        if (!isSafeInternalUrl(resolved)) return;\n\n        try { localStorage.setItem(postLoginRedirectKey, resolved); } catch (e) {}\n        try { sessionStorage.setItem(postLoginRedirectKey, resolved); } catch (e) {}\n        try { localStorage.setItem(registerSourceKey, String(sourceKey || onboardingActiveScreen || 'onboarding')); } catch (e) {}\n        try { sessionStorage.setItem(registerSourceKey, String(sourceKey || onboardingActiveScreen || 'onboarding')); } catch (e) {}\n    };\n\n    const visibleOnboardingScreens = function() {\n        return onboardingScreens.filter((screen) => onboardingShowExplore || screen.getAttribute('data-optional') !== '1');\n    };\n\n    const activeOnboardingElement = function() {\n        if (!onboardingActiveScreen) return null;\n        return onboardingScreens.find((screen) => String(screen.getAttribute('data-screen') || '') === onboardingActiveScreen) || null;\n    };\n\n    const fitOnboardingScreen = function() {\n        if (!onboardingFlow) return;\n        const active = activeOnboardingElement();\n        if (!active) return;\n\n        const body = active.querySelector('.buddyUpOnboardingScreenBody');\n        const canvas = active.querySelector('.buddyUpOnboardingScreenCanvas');\n        if (!body || !canvas) return;\n\n        canvas.style.zoom = '1';\n\n        if (body.scrollTop < 0) {\n            body.scrollTop = 0;\n        }\n    };\n\n    const syncOnboardingNav = function() {\n        const screens = visibleOnboardingScreens();\n        if (screens.length === 0) return;\n\n        const activeIndex = Math.max(0, screens.findIndex((screen) => String(screen.getAttribute('data-screen') || '') === onboardingActiveScreen));\n        const isFirst = activeIndex <= 0;\n        const isLast = activeIndex >= screens.length - 1;\n\n        if (onboardingBackButton) {\n            onboardingBackButton.disabled = isFirst;\n            onboardingBackButton.setAttribute('aria-disabled', isFirst ? 'true' : 'false');\n        }\n\n        if (onboardingNextButton) {\n            onboardingNextButton.textContent = isLast ? 'Finish' : 'Next';\n            onboardingNextButton.setAttribute('data-onboarding-next-mode', isLast ? 'finish' : 'next');\n        }\n    };\n\n    const setOnboardingScreen = function(screenId) {\n        const id = String(screenId || '').trim();\n        const visible = visibleOnboardingScreens();\n        if (visible.length === 0) return false;\n\n        let target = visible.find((screen) => String(screen.getAttribute('data-screen') || '') === id);\n        if (!target) target = visible[0];\n\n        onboardingActiveScreen = String(target.getAttribute('data-screen') || '');\n        onboardingFlow.setAttribute('data-active-screen', onboardingActiveScreen);\n        onboardingFlow.setAttribute('data-show-explore', onboardingShowExplore ? '1' : '0');\n\n        onboardingScreens.forEach((screen) => {\n            const currentId = String(screen.getAttribute('data-screen') || '');\n            const isVisible = visible.indexOf(screen) >= 0;\n            const isActive = isVisible && currentId === onboardingActiveScreen;\n            screen.classList.toggle('isActive', isActive);\n            screen.classList.toggle('isHidden', !isVisible);\n            screen.setAttribute('aria-hidden', isActive ? 'false' : 'true');\n\n            if (isActive) {\n                const body = screen.querySelector('.buddyUpOnboardingScreenBody');\n                if (body) body.scrollTop = 0;\n            }\n        });\n\n        document.dispatchEvent(new CustomEvent('buddyup:onboarding-screen-change', {\n            detail: {\n                screen: onboardingActiveScreen,\n                showExplore: onboardingShowExplore ? 1 : 0,\n            }\n        }));\n\n        syncOnboardingNav();\n        fitOnboardingScreen();\n        setTimeout(fitOnboardingScreen, 40);\n        setTimeout(fitOnboardingScreen, 160);\n        setTimeout(fitOnboardingScreen, 320);\n        return true;\n    };\n\n    const nextOnboardingScreen = function() {\n        const visible = visibleOnboardingScreens();\n        if (visible.length === 0) return;\n\n        const activeIndex = Math.max(0, visible.findIndex((screen) => String(screen.getAttribute('data-screen') || '') === onboardingActiveScreen));\n        if (activeIndex >= visible.length - 1) {\n            const target = buddyUpVariables && buddyUpVariables.register_link ? buddyUpVariables.register_link : '#';\n            if (target && target !== '#') {\n                persistOnboardingRegistrationIntent('for-you', onboardingActiveScreen || 'onboarding-footer');\n                if (typeof BUDDYUP !== 'undefined' && typeof BUDDYUP.pjaxNavigate === 'function') {\n                    BUDDYUP.pjaxNavigate(target);\n                } else {\n                    window.location.href = target;\n                }\n            }\n            return;\n        }\n\n        const nextScreen = visible[activeIndex + 1];\n        setOnboardingScreen(nextScreen ? nextScreen.getAttribute('data-screen') : '');\n    };\n\n    const previousOnboardingScreen = function() {\n        const visible = visibleOnboardingScreens();\n        if (visible.length === 0) return;\n\n        const activeIndex = Math.max(0, visible.findIndex((screen) => String(screen.getAttribute('data-screen') || '') === onboardingActiveScreen));\n        if (activeIndex <= 0) return;\n        const prevScreen = visible[activeIndex - 1];\n        setOnboardingScreen(prevScreen ? prevScreen.getAttribute('data-screen') : '');\n    };\n\n    const initOnboardingFlow = function() {\n        if (!onboardingFlow || onboardingScreens.length === 0) return;\n\n        if (!onboardingInitialized) {\n            onboardingInitialized = true;\n\n            onboardingFlow.addEventListener('click', function(e) {\n                const registerTrigger = e.target.closest('a[data-register-destination]');\n                if (registerTrigger) {\n                    const destination = registerTrigger.getAttribute('data-register-destination');\n                    const source = registerTrigger.getAttribute('data-register-source') || onboardingActiveScreen || 'onboarding';\n                    persistOnboardingRegistrationIntent(destination, source);\n\n                    if (typeof BUDDYUP !== 'undefined' && typeof BUDDYUP.pjaxNavigate === 'function') {\n                        e.preventDefault();\n                        BUDDYUP.pjaxNavigate(registerTrigger.getAttribute('href'));\n                    }\n                    return;\n                }\n\n                const trigger = e.target.closest('[data-onboarding-action], [data-step-target]');\n                if (!trigger) return;\n\n                const stepTarget = trigger.getAttribute('data-step-target');\n                if (stepTarget) {\n                    e.preventDefault();\n                    setOnboardingScreen(stepTarget);\n                    return;\n                }\n\n                const action = String(trigger.getAttribute('data-onboarding-action') || '').trim();\n                if (!action) return;\n\n                if (action === 'see-how') {\n                    e.preventDefault();\n                    onboardingShowExplore = true;\n                    setOnboardingScreen('explore');\n                }\n            });\n\n            if (onboardingBackButton) {\n                onboardingBackButton.addEventListener('click', function(e) {\n                    e.preventDefault();\n                    previousOnboardingScreen();\n                });\n            }\n\n            if (onboardingNextButton) {\n                onboardingNextButton.addEventListener('click', function(e) {\n                    e.preventDefault();\n                    nextOnboardingScreen();\n                });\n            }\n\n            window.addEventListener('resize', fitOnboardingScreen);\n            window.addEventListener('orientationchange', fitOnboardingScreen);\n\n            if (document.fonts && typeof document.fonts.ready === 'object' && typeof document.fonts.ready.then === 'function') {\n                document.fonts.ready.then(fitOnboardingScreen).catch(() => {});\n            }\n\n            onboardingFlow.querySelectorAll('img').forEach((img) => {\n                img.addEventListener('load', fitOnboardingScreen);\n                img.addEventListener('error', fitOnboardingScreen);\n            });\n        }\n\n        onboardingShowExplore = false;\n        setOnboardingScreen('introduction');\n    };\n\n    const syncExploreWidgetPlacement = function() {\n        if (!exploreWidget) return;\n        let moved = false;\n        const anonHost = onboardingExploreHost || anonView;\n        if (!anonHost) return;\n\n        if (exploreWidget.parentElement !== anonHost) {\n            anonHost.appendChild(exploreWidget);\n            moved = true;\n        }\n\n        if (moved) {\n            document.dispatchEvent(new Event('buddyup:explore-widget-relocated'));\n        }\n    };\n\n    const safe = function(value) {\n        if (typeof BUDDYUP !== 'undefined' && typeof BUDDYUP.escapeHtml === 'function') {\n            return BUDDYUP.escapeHtml(value);\n        }\n        return String(value == null ? '' : value)\n            .replace(\/&\/g, '&amp;')\n            .replace(\/<\/g, '&lt;')\n            .replace(\/>\/g, '&gt;')\n            .replace(\/\"\/g, '&quot;')\n            .replace(\/'\/g, '&#39;');\n    };\n\n    const normalizeList = function(raw) {\n        if (Array.isArray(raw)) {\n            return raw.map((v) => String(v || '').trim()).filter(Boolean);\n        }\n        if (typeof raw === 'string') {\n            return raw.split(',').map((v) => String(v || '').trim()).filter(Boolean);\n        }\n        return [];\n    };\n\n    const rankedCategoriesFromAggregate = function(aggregate) {\n        const counts = new Map();\n        const bump = function(label) {\n            const key = String(label || '').trim();\n            if (!key) return;\n            const normalized = key.toLowerCase();\n            counts.set(normalized, {\n                label: key,\n                count: (counts.get(normalized) && counts.get(normalized).count ? counts.get(normalized).count : 0) + 1,\n            });\n        };\n\n        const consumeRows = function(rows, fieldName) {\n            if (!Array.isArray(rows)) return;\n            rows.forEach((row) => {\n                normalizeList(row && row[fieldName]).forEach(bump);\n                normalizeList(row && row.categories).forEach(bump);\n            });\n        };\n\n        consumeRows(aggregate && aggregate.events, 'event_categories');\n        consumeRows(aggregate && aggregate.groups, 'group_categories');\n        consumeRows(aggregate && aggregate.adventures, 'adventure_categories');\n\n        return Array.from(counts.values())\n            .sort((a, b) => {\n                if (b.count !== a.count) return b.count - a.count;\n                return a.label.localeCompare(b.label);\n            })\n            .map((entry) => entry.label)\n            .slice(0, 12);\n    };\n\n    const readCachedIntroCategories = function() {\n        try {\n            const raw = localStorage.getItem(introCategoriesCacheKey);\n            const parsed = raw ? JSON.parse(raw) : null;\n            if (Array.isArray(parsed) && parsed.length > 0) {\n                return parsed.map((value) => String(value || '').trim()).filter(Boolean);\n            }\n        } catch (e) {}\n        return [];\n    };\n\n    const writeCachedIntroCategories = function(values) {\n        if (!Array.isArray(values) || values.length === 0) return;\n        try {\n            localStorage.setItem(introCategoriesCacheKey, JSON.stringify(values.slice(0, 12)));\n        } catch (e) {}\n    };\n\n    const getIntroCategories = async function() {\n        const cached = readCachedIntroCategories();\n        if (cached.length > 0) return cached;\n\n        if (introFlipCategoryPromise) return introFlipCategoryPromise;\n\n        introFlipCategoryPromise = (async function() {\n            if (typeof BUDDYUP === 'undefined' || typeof BUDDYUP.apiRequest !== 'function') {\n                return introFlipFallbackCategories;\n            }\n\n            try {\n                const aggregate = await BUDDYUP.apiRequest('explore-aggregate', {\n                    limit_adventures: 80,\n                    limit_events: 80,\n                    limit_groups: 80,\n                    include_events: 1,\n                    include_groups: 1,\n                });\n                const ranked = rankedCategoriesFromAggregate(aggregate);\n                if (ranked.length > 0) {\n                    writeCachedIntroCategories(ranked);\n                    return ranked;\n                }\n            } catch (e) {}\n\n            return introFlipFallbackCategories;\n        })();\n\n        return introFlipCategoryPromise;\n    };\n\n    const buildIntroPhrases = function(categories) {\n        const list = Array.isArray(categories) ? categories : [];\n        const themed = list.slice(0, 7).map((category) => String(category || '').trim()).filter(Boolean);\n        const fallback = ['adventure', 'hiking', 'camping', 'paddling'];\n        return Array.from(new Set(themed.concat(fallback))).filter(Boolean);\n    };\n\n    const updateIntroFlipText = function(el, nextText) {\n        if (!el) return;\n        const current = String(el.textContent || '').trim();\n        const incoming = String(nextText || '').trim();\n        if (!incoming || current === incoming) return;\n\n        el.classList.add('is-swapping');\n        window.setTimeout(function() {\n            el.textContent = incoming;\n            el.classList.remove('is-swapping');\n        }, 150);\n    };\n\n    const stopIntroCategoryFlip = function() {\n        if (introFlipTimer) {\n            clearInterval(introFlipTimer);\n            introFlipTimer = null;\n        }\n    };\n\n    const initIntroCategoryFlip = async function() {\n        const flipEl = wrapper.querySelector('.category-flip');\n        if (!flipEl) return;\n\n        stopIntroCategoryFlip();\n\n        const phrases = buildIntroPhrases(await getIntroCategories());\n        if (phrases.length === 0) return;\n\n        introFlipIndex = 0;\n        flipEl.textContent = String(phrases[introFlipIndex] || 'adventure').toLowerCase();\n\n        if (phrases.length === 1) return;\n\n        introFlipTimer = setInterval(function() {\n            introFlipIndex = (introFlipIndex + 1) % phrases.length;\n            updateIntroFlipText(flipEl, String(phrases[introFlipIndex] || 'adventure').toLowerCase());\n        }, 3600);\n    };\n\n    const toDateValue = function(raw) {\n        if (!raw) return null;\n        const val = Date.parse(String(raw));\n        return Number.isFinite(val) ? val : null;\n    };\n\n    const haversineMiles = function(lat1, lon1, lat2, lon2) {\n        if (![lat1, lon1, lat2, lon2].every((v) => Number.isFinite(Number(v)))) return null;\n        const R = 3958.8;\n        const toRad = function(d) { return Number(d) * (Math.PI \/ 180); };\n        const dLat = toRad(lat2 - lat1);\n        const dLon = toRad(lon2 - lon1);\n        const a = Math.sin(dLat \/ 2) * Math.sin(dLat \/ 2) +\n            Math.cos(toRad(lat1)) * Math.cos(toRad(lat2)) *\n            Math.sin(dLon \/ 2) * Math.sin(dLon \/ 2);\n        const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));\n        return R * c;\n    };\n\n    const buildDetailLink = function(type, id) {\n        const addPathId = function(base, paramName) {\n            const url = String(base || '').trim();\n            if (!url) return '#';\n            if (url.indexOf('?') >= 0) {\n                return `${url}${url.endsWith('?') || url.endsWith('&') ? '' : '&'}${paramName}=${Number(id)}`;\n            }\n            return `${url}${url.endsWith('\/') ? '' : '\/'}${Number(id)}`;\n        };\n\n        if (!Number.isFinite(Number(id)) || Number(id) <= 0) return '#';\n\n        if (type === 'events') {\n            return addPathId(buddyUpVariables && buddyUpVariables.event_link ? buddyUpVariables.event_link : '', 'event_id');\n        }\n        if (type === 'groups') {\n            return addPathId(buddyUpVariables && buddyUpVariables.group_link ? buddyUpVariables.group_link : '', 'group_id');\n        }\n        return addPathId(buddyUpVariables && buddyUpVariables.adventure_link ? buddyUpVariables.adventure_link : '', 'adventure_id');\n    };\n\n    const percentFromScore = function(score) {\n        const value = 58 + (Number(score || 0) * 1.8);\n        return Math.max(54, Math.min(98, Math.round(value)));\n    };\n\n    const itemCompletenessScore = function(item) {\n        if (!item || typeof item !== 'object') return 0;\n\n        let score = 0;\n        if (String(item.title || '').trim() !== '') score += 3;\n        if (String(item.subtitle || '').trim() !== '') score += 2;\n        if (String(item.image || '').trim() !== '') score += 2;\n        if (Array.isArray(item.categories) && item.categories.length > 0) score += 2;\n        if (Number.isFinite(item.latitude)) score += 1;\n        if (Number.isFinite(item.longitude)) score += 1;\n        if (Number(item.popularity || 0) > 0) score += 1;\n        return score;\n    };\n\n    const mergeFeedItem = function(current, incoming) {\n        if (!current) return incoming;\n        if (!incoming) return current;\n\n        return {\n            ...current,\n            ...incoming,\n            title: String(incoming.title || '').trim() !== '' ? incoming.title : current.title,\n            subtitle: String(incoming.subtitle || '').trim() !== '' ? incoming.subtitle : current.subtitle,\n            image: String(incoming.image || '').trim() !== '' ? incoming.image : current.image,\n            categories: Array.from(new Set([...(Array.isArray(current.categories) ? current.categories : []), ...(Array.isArray(incoming.categories) ? incoming.categories : [])])),\n            latitude: Number.isFinite(incoming.latitude) ? incoming.latitude : current.latitude,\n            longitude: Number.isFinite(incoming.longitude) ? incoming.longitude : current.longitude,\n            dateValue: incoming.dateValue || current.dateValue,\n            popularity: Math.max(Number(current.popularity || 0), Number(incoming.popularity || 0)),\n        };\n    };\n\n    const dedupeFeedItems = function(items) {\n        if (!Array.isArray(items) || items.length === 0) return [];\n\n        const seen = new Map();\n        items.forEach((item) => {\n            const key = Number(item && item.id);\n            if (!Number.isFinite(key) || key <= 0) return;\n\n            if (!seen.has(key)) {\n                seen.set(key, item);\n                return;\n            }\n\n            const existing = seen.get(key);\n            const existingScore = itemCompletenessScore(existing);\n            const incomingScore = itemCompletenessScore(item);\n            const merged = incomingScore >= existingScore\n                ? mergeFeedItem(existing, item)\n                : mergeFeedItem(item, existing);\n            seen.set(key, merged);\n        });\n\n        return Array.from(seen.values());\n    };\n\n    const accountEvents = (accountResp) => {\n        const eventsRoot = (accountResp && accountResp.events)\n            || (accountResp && accountResp.data && accountResp.data.events)\n            || {};\n\n        const upcoming = Array.isArray(eventsRoot.upcoming) ? eventsRoot.upcoming : [];\n        const past = Array.isArray(eventsRoot.past) ? eventsRoot.past : [];\n        return upcoming.concat(past);\n    };\n\n    const accountGroups = (accountResp) => {\n        if (accountResp && Array.isArray(accountResp.groups)) return accountResp.groups;\n        if (accountResp && accountResp.data && Array.isArray(accountResp.data.groups)) return accountResp.data.groups;\n        return [];\n    };\n\n    const normalizeEventId = (event) => {\n        const id = Number(event && (event.id || event.event_id || event.eventId || 0));\n        return Number.isFinite(id) && id > 0 ? id : 0;\n    };\n\n    const normalizeGroupId = (group) => {\n        const id = Number(group && (group.id || group.group_id || group.groupId || 0));\n        return Number.isFinite(id) && id > 0 ? id : 0;\n    };\n\n    const normalizeAdventureId = (adventure) => {\n        const id = Number(adventure && (adventure.id || adventure.adventure_id || adventure.adventureId || 0));\n        return Number.isFinite(id) && id > 0 ? id : 0;\n    };\n\n    const collectParticipatingIds = function(accountResp, adventuresResp) {\n        const eventIds = new Set();\n        const groupIds = new Set();\n        const adventureIds = new Set();\n\n        accountEvents(accountResp).forEach((event) => {\n            const id = normalizeEventId(event);\n            if (id > 0) eventIds.add(id);\n        });\n\n        accountGroups(accountResp).forEach((group) => {\n            const id = normalizeGroupId(group);\n            if (id > 0) groupIds.add(id);\n        });\n\n        const createdAdventures = Array.isArray(adventuresResp && adventuresResp.created_adventures)\n            ? adventuresResp.created_adventures\n            : (Array.isArray(adventuresResp && adventuresResp.adventures) ? adventuresResp.adventures : []);\n        const taggedAdventures = Array.isArray(adventuresResp && adventuresResp.tagged_adventures)\n            ? adventuresResp.tagged_adventures\n            : [];\n\n        createdAdventures.concat(taggedAdventures).forEach((adventure) => {\n            const id = normalizeAdventureId(adventure);\n            if (id > 0) adventureIds.add(id);\n        });\n\n        return { eventIds, groupIds, adventureIds };\n    };\n\n    const normalizeFeed = function(aggregate) {\n        const result = {\n            events: [],\n            groups: [],\n            adventures: []\n        };\n\n        const events = Array.isArray(aggregate && aggregate.events) ? aggregate.events : [];\n        const groups = Array.isArray(aggregate && aggregate.groups) ? aggregate.groups : [];\n        const adventures = Array.isArray(aggregate && aggregate.adventures) ? aggregate.adventures : [];\n\n        result.events = dedupeFeedItems(events.map((row) => ({\n            id: Number(row.event_id || row.id || 0),\n            title: String(row.event_name || row.name || 'Event'),\n            subtitle: String(row.location_label || [row.city, row.state].filter(Boolean).join(', ')),\n            categories: normalizeList(row.event_categories || row.categories),\n            image: String(row.event_image || row.image || imageFallback),\n            latitude: Number(row.latitude),\n            longitude: Number(row.longitude),\n            dateValue: toDateValue(row.event_date || row.date),\n            popularity: Number(row.attendees_count || row.joined_count || row.member_count || 0),\n        })).filter((row) => row.id > 0));\n\n        result.groups = dedupeFeedItems(groups.map((row) => ({\n            id: Number(row.id || row.group_id || 0),\n            title: String(row.name || 'Group'),\n            subtitle: String(row.location_label || [row.city, row.state].filter(Boolean).join(', ')),\n            categories: normalizeList(row.categories || row.group_categories),\n            image: String(row.image || row.group_image || imageFallback),\n            latitude: Number(row.latitude),\n            longitude: Number(row.longitude),\n            dateValue: null,\n            popularity: Number(row.member_count || row.members_count || row.total_members || 0),\n        })).filter((row) => row.id > 0));\n\n        result.adventures = dedupeFeedItems(adventures.map((row) => ({\n            id: Number(row.id || row.adventure_id || 0),\n            title: String(row.title || 'Adventure'),\n            subtitle: String(row.location_label || [row.city, row.state].filter(Boolean).join(', ')),\n            categories: normalizeList(row.categories),\n            image: String(row.preview_url || (Array.isArray(row.media) && row.media[0] && row.media[0].url ? row.media[0].url : '') || imageFallback),\n            latitude: Number(row.latitude),\n            longitude: Number(row.longitude),\n            dateValue: toDateValue(row.adventure_date || row.event_date || row.date),\n            popularity: Number(row.participant_count || row.member_count || row.attendees_count || 0),\n        })).filter((row) => row.id > 0));\n\n        return result;\n    };\n\n    const scoreItem = function(item, context) {\n        const userInterests = context.userInterests;\n        const userKeywords = context.userKeywords;\n\n        let score = 0;\n\n        const itemCats = Array.isArray(item.categories) ? item.categories.map((cat) => String(cat || '').toLowerCase()) : [];\n        const overlap = itemCats.filter((cat) => userInterests.has(cat)).length;\n        score += overlap * 12;\n\n        const blob = `${String(item.title || '')} ${String(item.subtitle || '')} ${itemCats.join(' ')}`.toLowerCase();\n        let keywordHits = 0;\n        userKeywords.forEach((kw) => {\n            if (kw && blob.includes(kw)) keywordHits += 1;\n        });\n        score += Math.min(15, keywordHits * 2.5);\n\n        if (Number.isFinite(context.userLatitude) && Number.isFinite(context.userLongitude) && Number.isFinite(item.latitude) && Number.isFinite(item.longitude)) {\n            const miles = haversineMiles(context.userLatitude, context.userLongitude, item.latitude, item.longitude);\n            if (miles !== null) {\n                const distanceBonus = Math.max(0, 30 - miles) * 0.7;\n                score += distanceBonus;\n            }\n        }\n\n        if (item.dateValue) {\n            const now = Date.now();\n            const deltaDays = (item.dateValue - now) \/ (1000 * 60 * 60 * 24);\n            if (deltaDays >= 0 && deltaDays <= 21) {\n                score += 10;\n            } else if (deltaDays > 21 && deltaDays <= 60) {\n                score += 6;\n            } else if (deltaDays < 0) {\n                score -= 4;\n            }\n        }\n\n        const pop = Number(item.popularity || 0);\n        if (pop > 0) {\n            score += Math.min(8, Math.log(pop + 1) * 2.2);\n        }\n\n        return score;\n    };\n\n    const renderRail = function(trackEl, type, items) {\n        if (!trackEl) return;\n\n        if (!Array.isArray(items) || items.length === 0) {\n            trackEl.innerHTML = '<div class=\"buddyUpForYouEmpty\">No matches yet for this rail. Try adding more interests or location details in your profile.<\/div>';\n            return;\n        }\n\n        trackEl.innerHTML = items.slice(0, 18).map((item) => {\n            const href = buildDetailLink(type, item.id);\n\n            let meta = item.subtitle || '';\n            if (type === 'events' && item.dateValue) {\n                const dateText = new Date(item.dateValue).toLocaleDateString(undefined, { month: 'short', day: 'numeric', year: 'numeric' });\n                meta = meta ? `${meta} \u2022 ${dateText}` : dateText;\n            }\n            if (type === 'groups') {\n                const countText = Number(item.popularity || 0) > 0 ? `${Number(item.popularity)} members` : '';\n                meta = meta ? `${meta}${countText ? ` \u2022 ${countText}` : ''}` : countText;\n            }\n\n            return `\n                <a class=\"buddyUpForYouRailCard\" href=\"${safe(href)}\">\n                    <img decoding=\"async\" class=\"buddyUpForYouRailCardMedia\" src=\"${safe(item.image || imageFallback)}\" alt=\"${safe(item.title)}\" \/>\n                    <div class=\"buddyUpForYouRailCardBody\">\n                        <div class=\"buddyUpForYouRailCardTitle\">${safe(item.title)}<\/div>\n                        <div class=\"buddyUpForYouRailCardMeta\">${safe(meta || 'Recommended for your current profile intent')}<\/div>\n                        <div class=\"buddyUpForYouRailCardScore\">${percentFromScore(item.intentScore)}% intent match<\/div>\n                    <\/div>\n                <\/a>\n            `;\n        }).join('');\n    };\n\n    const loadRecommendations = async function() {\n        if (recommendationsLoaded) return;\n\n        const user = typeof BUDDYUP !== 'undefined' && typeof BUDDYUP.getCurrentUser === 'function' ? BUDDYUP.getCurrentUser() : null;\n        if (!user || !user.id) {\n            if (forYouStatus) forYouStatus.textContent = 'Please log in to view your personalized feed.';\n            return;\n        }\n\n        if (forYouStatus) forYouStatus.textContent = 'Matching your interests with upcoming activity...';\n\n        try {\n            const [accountRes, aggregateRes, myAdventuresRes] = await Promise.all([\n                BUDDYUP.apiRequest('account-get', {\n                    id: user.id,\n                    include: 'events,groups',\n                    fields: 'id,username,profile_image,interests,about_me,latitude,longitude,events,groups',\n                    _force: true\n                }),\n                BUDDYUP.apiRequest('explore-aggregate', {\n                    limit_adventures: 400,\n                    limit_events: 220,\n                    limit_groups: 220,\n                    include_events: 1,\n                    include_groups: 1,\n                }),\n                BUDDYUP.apiRequest('adventures-list-mine', { limit: 200 })\n            ]);\n\n            if (!aggregateRes || aggregateRes.status !== 'success') {\n                throw new Error('Could not load recommendation content.');\n            }\n\n            const account = accountRes && accountRes.status === 'success' ? accountRes : user;\n\n            const profileInterests = normalizeList((account && account.interests) || (user && user.interests));\n            const profileAbout = String((account && account.about_me) || (user && user.about_me) || '').toLowerCase();\n\n            const keywordSet = new Set(profileInterests.map((i) => i.toLowerCase()));\n            profileAbout.split(\/[^a-z0-9]+\/gi).map((w) => w.trim()).filter((w) => w.length >= 4).forEach((w) => keywordSet.add(w.toLowerCase()));\n\n            const context = {\n                userInterests: new Set(profileInterests.map((i) => i.toLowerCase())),\n                userKeywords: keywordSet,\n                userLatitude: Number((account && account.latitude) || (user && user.latitude)),\n                userLongitude: Number((account && account.longitude) || (user && user.longitude)),\n            };\n\n            const normalized = normalizeFeed(aggregateRes);\n            const participating = collectParticipatingIds(accountRes, myAdventuresRes);\n\n            normalized.events = normalized.events.filter((item) => !participating.eventIds.has(Number(item.id || 0)));\n            normalized.groups = normalized.groups.filter((item) => !participating.groupIds.has(Number(item.id || 0)));\n            normalized.adventures = normalized.adventures.filter((item) => {\n                const itemId = Number(item.id || 0);\n                const ownerId = Number(item.user_id || 0);\n                if (itemId > 0 && participating.adventureIds.has(itemId)) return false;\n                if (ownerId > 0 && ownerId === Number(user.id || 0)) return false;\n                return true;\n            });\n\n            ['events', 'groups', 'adventures'].forEach((type) => {\n                normalized[type].forEach((item) => {\n                    item.intentScore = scoreItem(item, context);\n                });\n                normalized[type].sort((a, b) => b.intentScore - a.intentScore);\n            });\n\n            renderRail(eventsRail, 'events', normalized.events);\n            renderRail(groupsRail, 'groups', normalized.groups);\n            renderRail(adventuresRail, 'adventures', normalized.adventures);\n\n            const totalMatches = normalized.events.length + normalized.groups.length + normalized.adventures.length;\n            if (forYouStatus) {\n                forYouStatus.textContent = totalMatches > 0\n                    ? `Showing ${totalMatches} ranked recommendations across events, groups, and adventures.`\n                    : 'No recommendation content available yet.';\n            }\n\n            recommendationsLoaded = true;\n        } catch (err) {\n            if (forYouStatus) {\n                forYouStatus.textContent = err && err.message ? err.message : 'Unable to build your For You feed right now.';\n            }\n            if (eventsRail) eventsRail.innerHTML = '<div class=\"buddyUpForYouEmpty\">Could not load events right now.<\/div>';\n            if (groupsRail) groupsRail.innerHTML = '<div class=\"buddyUpForYouEmpty\">Could not load groups right now.<\/div>';\n            if (adventuresRail) adventuresRail.innerHTML = '<div class=\"buddyUpForYouEmpty\">Could not load adventures right now.<\/div>';\n        }\n    };\n\n    const updateLandingState = function() {\n        const isLoggedIn = !!(\n            typeof BUDDYUP !== 'undefined' &&\n            typeof BUDDYUP.hasAuthenticatedUser === 'function' &&\n            BUDDYUP.hasAuthenticatedUser(BUDDYUP.getCurrentUser())\n        );\n\n        if (anonView) {\n            anonView.classList.toggle('hidden', isLoggedIn);\n        }\n        if (forYouView) {\n            forYouView.classList.toggle('hidden', !isLoggedIn);\n        }\n\n        syncExploreWidgetPlacement();\n\n        if (!isLoggedIn) {\n            recommendationsLoaded = false;\n            if (forYouStatus) {\n                forYouStatus.textContent = 'Please log in to view your personalized feed.';\n            }\n            initOnboardingFlow();\n            initIntroCategoryFlip();\n            setHomeMode('explore', false);\n        } else {\n            stopIntroCategoryFlip();\n            initHomeModeTabs();\n            setHomeMode(readStoredHomeMode());\n        }\n\n        if (isLoggedIn) {\n            loadRecommendations();\n        }\n\n        document.body.classList.toggle('buddyup-home-landing-anon', !isLoggedIn);\n        document.body.classList.toggle('buddyup-home-onboarding-active', !isLoggedIn);\n    };\n\n    updateLandingState();\n\n    if (typeof BUDDYUP !== 'undefined' && typeof BUDDYUP.setGlobalHandler === 'function') {\n        BUDDYUP.setGlobalHandler('homeLanding.state.sync', document, 'buddyUpPageChange', updateLandingState);\n        BUDDYUP.setGlobalHandler('homeLanding.state.sync.paging', document, 'buddyup:paging', updateLandingState);\n        BUDDYUP.setGlobalHandler('homeLanding.state.sync.auth', document, 'buddyup:auth-changed', updateLandingState);\n    }\n\n})();<\/script><\/div><br \/>\n<!-- [widget_blocks title=\"hero\"]\n[widget_blocks title=\"Interests\"]\n[widget_blocks title=\"Intro\"]\n[widget_blocks title=\"Locals Section\"]\n[widget_blocks title=\"Events\"] --><\/p>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-44","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/staging.buddyupgo.com\/api\/wp\/v2\/pages\/44","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/staging.buddyupgo.com\/api\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/staging.buddyupgo.com\/api\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/staging.buddyupgo.com\/api\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/staging.buddyupgo.com\/api\/wp\/v2\/comments?post=44"}],"version-history":[{"count":1,"href":"https:\/\/staging.buddyupgo.com\/api\/wp\/v2\/pages\/44\/revisions"}],"predecessor-version":[{"id":516,"href":"https:\/\/staging.buddyupgo.com\/api\/wp\/v2\/pages\/44\/revisions\/516"}],"wp:attachment":[{"href":"https:\/\/staging.buddyupgo.com\/api\/wp\/v2\/media?parent=44"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}