/* Fantasy Pro UX patch: preserve original appearance, improve navigation and scrolling. */
html { scroll-behavior: auto; }
body { -webkit-overflow-scrolling: touch; }
body.fantasy-menu-open { overflow: hidden; }

/* Keep the fixed desktop navigation within the viewport on short screens. */
aside {
    max-height: calc(100vh - 2rem);
    max-height: calc(100dvh - 2rem);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
}
aside::-webkit-scrollbar { width: 4px; }
aside::-webkit-scrollbar-thumb { background: rgba(119,119,144,.22); border-radius: 8px; }
.sub-menu { pointer-events: none; }
.nav-item.has-child:hover .sub-menu,
.nav-item.has-child:focus-within .sub-menu,
.nav-item.has-child.active .sub-menu { pointer-events: auto; }

/* Avoid expensive long transitions during normal wheel scrolling. */
main { transition: opacity .16s ease; }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media screen and (max-width: 600px) {
    aside {
        max-height: 100vh;
        max-height: 100dvh;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        padding-top: max(2em, env(safe-area-inset-top));
        padding-bottom: max(2em, env(safe-area-inset-bottom));
    }
    .sub-menu { pointer-events: auto; }
    .sub-menu .wrapper { gap: .25em 0; }
    .side-window { z-index: 3; }
    header .toggle { z-index: 5; }
}
