document.addEventListener("DOMContentLoaded",function(){document.querySelectorAll(".fb-off-canvas-menu-block").forEach(e=>{const t=e.querySelector(".fb-menu-toggle-btn"),n=e.querySelector(".fb-close-menu"),s=e.querySelector(".fb-off-canvas-menu");let a=e.querySelector(".fb-menu-overlay");function c(){s.classList.add("open"),a.classList.add("active"),document.body.classList.add("fb-menu-open"),e.classList.add("fb-menu-open"),t.classList.add("active"),t.setAttribute("aria-expanded","true"),t.setAttribute("aria-label","Close menu")}function o(){t.classList.remove("active"),e.classList.remove("fb-menu-open"),t.setAttribute("aria-expanded","false"),t.setAttribute("aria-label","Open menu"),s.classList.remove("open"),a.classList.remove("active"),document.body.classList.remove("fb-menu-open")}a||(a=document.createElement("div"),a.className="fb-menu-overlay",e.appendChild(a)),t&&(t.addEventListener("click",function(){s.classList.contains("open")?o():c()}),t.addEventListener("keydown",function(e){"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),s.classList.contains("open")?o():c())})),n&&n.addEventListener("click",function(){o()}),a&&a.addEventListener("click",function(){o()}),document.addEventListener("keydown",function(e){"Escape"===e.key&&s.classList.contains("open")&&o()})})});