/* Sidebar scrolling – Admin & Resident portals (used with assets/js/sidebar-scroll.js)
   A slim scrollbar that shows on hover, soft fades where there is more to scroll,
   and a "more below" button. */
.sb-nav {
    overflow-y: auto;
    overscroll-behavior: contain;               /* scrolling the menu never scrolls the page behind it */
    scrollbar-gutter: stable;
    --fade-top: 0px;
    --fade-bottom: 0px;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 var(--fade-top), #000 calc(100% - var(--fade-bottom)), transparent 100%);
            mask-image: linear-gradient(to bottom, transparent 0, #000 var(--fade-top), #000 calc(100% - var(--fade-bottom)), transparent 100%);
}
.sb-nav.can-up   { --fade-top: 26px; }
.sb-nav.can-down { --fade-bottom: 40px; }
/* Firefox: the slim bar, hidden until the menu is hovered / scrolled (in Chrome / Edge these would bring back the grey bar with arrows) */
@supports not selector(::-webkit-scrollbar) {
    .sb-nav { scrollbar-width: thin; scrollbar-color: transparent transparent; transition: scrollbar-color .25s; }
    .sb-nav:hover, .sb-nav:focus-within, .sb-nav.is-scrolling { scrollbar-color: rgba(var(--brand-alt-rgb, 255,142,28),.55) transparent; }
    [data-theme="light"] .sb-nav:hover, [data-theme="light"] .sb-nav.is-scrolling { scrollbar-color: rgba(180,83,9,.5) transparent; }
}

/* Chrome / Edge / Safari */
.sb-nav::-webkit-scrollbar { width: 6px; }
.sb-nav::-webkit-scrollbar-track { background: transparent; }
.sb-nav::-webkit-scrollbar-button { display: none; height: 0; }
.sb-nav::-webkit-scrollbar-thumb { background: transparent; border-radius: 999px; }
.sb-nav:hover::-webkit-scrollbar-thumb, .sb-nav:focus-within::-webkit-scrollbar-thumb, .sb-nav.is-scrolling::-webkit-scrollbar-thumb { background: rgba(var(--brand-alt-rgb, 255,142,28),.55); }
.sb-nav::-webkit-scrollbar-thumb:hover { background: var(--brand-alt, #FF8E1C); }

/* "More below" button, sits on the bottom fade */
.sb-more {
    position: relative; z-index: 3;
    align-self: center; flex: none;
    width: 30px; height: 30px; margin: -36px auto 6px;
    display: grid; place-items: center;
    border-radius: 50%; border: 1px solid rgba(var(--brand-rgb, 255,138,0),.45);
    background: rgba(20,18,15,.92); color: var(--brand, #FF8A00);
    cursor: pointer; opacity: 0; transform: translateY(6px); pointer-events: none;
    transition: opacity .2s, transform .2s, background .2s;
    box-shadow: 0 6px 16px -6px rgba(0,0,0,.6);
}
.sb-more.show { opacity: 1; transform: none; pointer-events: auto; animation: sb-more-nudge 2.4s ease-in-out 1s 2; }
.sb-more:hover { background: var(--brand, #FF8A00); color: #17140F; }
.sb-more:focus-visible { outline: 2px solid var(--brand, #FF8A00); outline-offset: 2px; }
@keyframes sb-more-nudge { 0%, 100% { transform: none; } 50% { transform: translateY(3px); } }
[data-theme="light"] .sb-more { background: rgba(255,255,255,.95); }
[data-tone="medium"] .sb-more { background: rgba(31, 32, 35,.96); color: #FFCB8A; border-color: #55575D; }
[data-theme="light"] .sb-nav:hover::-webkit-scrollbar-thumb, [data-theme="light"] .sb-nav.is-scrolling::-webkit-scrollbar-thumb { background: rgba(180,83,9,.5); }
.sb.collapsed .sb-more { display: none; }
@media (prefers-reduced-motion: reduce) { .sb-more, .sb-more.show { animation: none; transition: none; } }
