document.addEventListener("DOMContentLoaded", function() {
  const offmenu = document.getElementById("offSideMenu");
  const sidemenu = document.getElementById("secondary-nav");

  function toggleMenus(mediaQuery) {
    if (!mediaQuery.matches) { 
      offmenu.style.display = "none";
      sidemenu.style.display = "block";
    } else {
      offmenu.style.display = "block";
      sidemenu.style.display = "none";
    }
  }

  const mediaQuery = window.matchMedia("(max-width: 992px)");
  toggleMenus(mediaQuery); // Initial check
  mediaQuery.addEventListener('change', (e) => toggleMenus(e));
});
