/*
 * Admin sidebar tweaks on top of CoreUI v4.
 *
 * Backpack pre-renders the SimpleBar markup inside .sidebar-nav, so the real
 * scroller is .simplebar-content-wrapper - and that element has
 * "overflow: auto" on BOTH axes with the scrollbars hidden. Because CoreUI sets
 * white-space: nowrap on nav links, any label wider than the sidebar made the
 * whole menu draggable left/right with a finger, with no visible scrollbar to
 * explain it. Below we lock the X axis and let labels wrap instead.
 *
 * Submenu links are indented by --cui-sidebar-nav-icon-width (4rem out of a
 * 16rem sidebar), which left very little room for the label on a phone, so on
 * small screens the icon column and the type are scaled down.
 */

/* Vertical scrolling stays; horizontal panning is off. */
#sidebar .simplebar-content-wrapper {
    overflow-x: hidden;
    overscroll-behavior: contain;
    touch-action: pan-y pinch-zoom;
}

/* Long labels wrap instead of being clipped by the rule above. */
#sidebar .sidebar-nav .nav-link {
    white-space: normal;
    overflow-wrap: anywhere;
}

/* Keep the expand/collapse chevron at full width now that labels can wrap. */
#sidebar .sidebar-nav .nav-group-toggle::after {
    flex: 0 0 12px;
}

/* Phones/tablets: the sidebar is an overlay here, so make it fit the label. */

@media (max-width: 991.98px) {

    /*
    #sidebar {
        --cui-sidebar-nav-link-padding-x: 0.75rem;
        --cui-sidebar-nav-link-padding-y: 0.6rem;
        --cui-sidebar-nav-icon-width: 2.5rem;
        --cui-sidebar-nav-icon-font-size: 1.1rem;
        --cui-sidebar-nav-title-padding-y: 0.5rem;
        --cui-sidebar-nav-title-margin-top: 0.5rem;
    }

    #sidebar .sidebar-nav .nav-link {
        font-size: 1.5rem;
        line-height: 1.3;
    }

    #sidebar .sidebar-nav .nav-group-items .nav-link {
        font-size: 1.25rem;
    }

    */
}