function toggleSidebarForSmallScreens() {
  const sidebar = document.getElementById("sidebar");
  if (window.innerWidth <= 991.98) {
    // Bootstrap lg breakpoint
    sidebar.classList.add("closed");
  } else {
    sidebar.classList.remove("closed");
  }
}

// Run on load
window.addEventListener("DOMContentLoaded", toggleSidebarForSmallScreens);

// Run on resize
window.addEventListener("resize", toggleSidebarForSmallScreens);
