/* Sidebar click and zoom fixes.

   This file used to paint the sidebar navy with !important. Those rules never
   applied: includes/sidebar.html carries an inline <style> that sets the same
   properties to #ffffff !important and, being later in the document, wins every
   time. sidebar.html even documents overriding them. They are removed rather
   than left to read as the source of a colour they never produced -- the
   sidebar's appearance is owned by sidebar.html alone.

   What remains is the part that does work: pointer-events and stacking so the
   nav stays clickable, and the compositing hints that stop it flickering at
   non-100% zoom. */

/* Compositing hints -- keep the sidebar from flickering when the page is zoomed. */
.sidebar,
.sidebar * {
    backface-visibility: hidden !important;
    -webkit-backface-visibility: hidden !important;
    transform: translateZ(0) !important;
    -webkit-transform: translateZ(0) !important;
}

/* Ensure all navigation links are clickable */
.navbar-nav,
.nav-item,
.sidebar-nav-link {
    pointer-events: auto !important;
    cursor: pointer !important;
    z-index: 1050 !important;
}

/* Fix for Bootstrap collapse buttons */
.sidebar-nav-link[data-bs-toggle="collapse"] {
    pointer-events: auto !important;
    cursor: pointer !important;
    position: relative !important;
    z-index: 1060 !important;
}

/* Prevent zoom color changes */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
    .sidebar {
        -webkit-transform: translateZ(0) translate3d(0, 0, 0) !important;
        transform: translateZ(0) translate3d(0, 0, 0) !important;
        -webkit-font-smoothing: antialiased !important;
    }
}

/* Submenus must stay clickable when expanded. */
.collapse,
.sidebar-submenu {
    pointer-events: auto !important;
}

.collapse.show {
    display: block !important;
}

/* Minimal link state fixes */
.sidebar-nav-link:hover,
.sidebar-nav-link:focus,
.sidebar-nav-link:active {
    text-decoration: none !important;
    pointer-events: auto !important;
}

/* Remove transitions for minimal look */
.sidebar-nav-link,
.sidebar-nav-link i,
.sidebar-nav-link .material-icons-round {
    transition: none !important;
}

/* Prevent text selection but allow clicks */
.sidebar-nav-link {
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
    -webkit-tap-highlight-color: transparent !important;
}

/* Responsive mobile fixes */
@media (max-width: 1199.98px) {
    .sidebar {
        transform: translateX(-100%) translateZ(0) !important;
        -webkit-transform: translateX(-100%) translateZ(0) !important;
    }
    
    .sidebar.show {
        transform: translateX(0) translateZ(0) !important;
        -webkit-transform: translateX(0) translateZ(0) !important;
    }
}