import{g as n,S as l}from"./ScrollTrigger.C8IefbVz.js";n.registerPlugin(l);function r(){console.log("Initializing navigation..."),l.getAll().forEach(e=>e.kill());function d(){const e=document.getElementById("mobile-menu");e&&(e.classList.contains("hidden")?(e.classList.remove("hidden"),n.fromTo(e,{opacity:0,y:-20},{duration:.3,opacity:1,y:0,ease:"power2.out"})):n.to(e,{duration:.2,opacity:0,y:-20,onComplete:()=>e.classList.add("hidden")}))}function s(e){const t=e.nextElementSibling,o=e.querySelector("svg");t&&(t.classList.contains("hidden")?(t.classList.remove("hidden"),n.fromTo(t,{height:0,opacity:0},{duration:.3,height:"auto",opacity:1,ease:"power2.out"}),o&&n.to(o,{duration:.2,rotate:180,ease:"power2.out"})):(n.to(t,{duration:.2,height:0,opacity:0,onComplete:()=>t.classList.add("hidden")}),o&&n.to(o,{duration:.2,rotate:0,ease:"power2.out"})))}function u(e){n.to(e,{duration:.2,y:-1,color:"var(--color-primary)",ease:"power2.out"})}function g(e){n.to(e,{duration:.2,y:0,color:"var(--color-text-secondary)",ease:"power2.out"})}function m(e){n.to(e,{duration:.2,scale:1.05,boxShadow:"0 4px 12px rgba(128, 0, 0, 0.3)",ease:"power2.out"})}function p(e){n.to(e,{duration:.2,scale:1,boxShadow:"none",ease:"power2.out"})}const a=document.querySelector("nav");a&&l.create({trigger:document.body,start:"top top",onUpdate:e=>{e.scroll()>100?n.to(a,{duration:.3,boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1)",backdropFilter:"blur(16px)",backgroundColor:"rgba(255, 255, 255, 0.98)"}):n.to(a,{duration:.3,boxShadow:"none",backdropFilter:"blur(8px)",backgroundColor:"rgba(255, 255, 255, 0.95)"})}});const i=document.getElementById("mobile-menu-button");if(i){const e=i.cloneNode(!0);i.parentNode?.replaceChild(e,i)}document.querySelectorAll(".nav-link-hover").forEach(e=>{const t=e,o=t.cloneNode(!0);t.parentNode?.replaceChild(o,t),o.addEventListener("mouseenter",()=>u(o)),o.addEventListener("mouseleave",()=>g(o))}),document.querySelectorAll(".donate-pulse").forEach(e=>{const t=e,o=t.cloneNode(!0);t.parentNode?.replaceChild(o,t),o.addEventListener("mouseenter",()=>m(o)),o.addEventListener("mouseleave",()=>p(o))}),document.querySelectorAll(".mobile-submenu-trigger").forEach(e=>{const t=e,o=t.cloneNode(!0);t.parentNode?.replaceChild(o,t),o.addEventListener("click",()=>s(o))});const c=document.getElementById("mobile-menu-button");c&&c.addEventListener("click",d),window.toggleMobileMenu=d,window.toggleMobileSubmenu=s}typeof window<"u"&&(r(),document.addEventListener("astro:page-load",()=>{console.log("Astro page transition detected, reinitializing navigation..."),r()}),document.addEventListener("astro:after-swap",()=>{console.log("Astro after-swap detected, reinitializing navigation..."),r()}));
