function toggleMenu() { const el = document.getElementById("menu-mobile"); if (el) el.classList.toggle("hidden"); } async function injectPart(id, url) { const target = document.getElementById(id); if (!target) return; const res = await fetch(url, { cache: "no-store" }); target.innerHTML = await res.text(); } function setActiveNav() { const page = (document.body.dataset.page || "").trim(); if (!page) return; document.querySelectorAll(`[data-nav="${page}"]`).forEach(a => { a.classList.remove("text-white/80", "text-white/90", "text-white/95"); a.classList.add("text-white"); a.setAttribute("aria-current", "page"); }); } (async function initLayout() { await injectPart("site-header", "header.html"); await injectPart("site-footer", "footer.html"); setActiveNav(); })();