/* PS-STAB-01 B01. Scoped support; PS-LAYOUT-01: mobile through979px, desktop from980px. */
#menu.ps-mobile-ready #menupanel,
#menu.ps-mobile-ready .ps-mobile-panel,
#menu.ps-mobile-ready .ps-mobile-panel[hidden] {
    display: none !important;
}

#menu .ps-mobile-fallback {
    display: none;
}

@media (max-width: 979px) {
    /* Both controls use the same 44px column from the first paint. */
    #menu #menu-handler > .row-fluid {
        display: grid;
        grid-template-columns: 44px minmax(0, 1fr);
        align-items: center;
        gap: 8px;
        width: 100%;
    }
    #menu:not(.ps-mobile-ready) .ps-mobile-fallback {
        display: block;
    }
    #menu .ps-mobile-fallback > summary {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
        width: 44px;
        height: 44px;
        margin: 0;
        color: #783500;
        cursor: pointer;
        list-style: none;
    }
    #menu .ps-mobile-fallback > summary::-webkit-details-marker {
        display: none;
    }
    #menu .ps-mobile-fallback > summary:focus-visible {
        outline: 2px solid #783500;
        outline-offset: -2px;
    }
    #menu .ps-mobile-fallback .rm-line {
        display: block;
        width: 20px;
        height: 3px;
        margin: 2px 0;
        border-radius: 1px;
        background: currentColor;
    }

    /* The original Joomla links remain available via native disclosure.
       Its list floats below the controls and has its own scroll area. */
    #menu .ps-mobile-fallback ~ #nav,
    #menu.ps-mobile-ready #nav {
        display: none !important;
    }
    #menu:not(.ps-mobile-ready) .ps-mobile-fallback[open] ~ #nav {
        display: block !important;
        position: absolute !important;
        inset: calc(100% + 4px) 0 auto;
        z-index: 300002;
        box-sizing: border-box;
        width: auto !important;
        max-height: 55vh;
        max-height: 55dvh;
        margin: 0;
        padding: 8px;
        overflow: auto;
        overscroll-behavior: contain;
        background: #fff;
        border: 1px solid #ddd;
    }
    #menu:not(.ps-mobile-ready) .ps-mobile-fallback[open] ~ #nav ul {
        display: block !important;
        position: static !important;
        width: auto !important;
        visibility: visible !important;
        opacity: 1 !important;
        margin: 0;
        padding-inline-start: 12px;
    }
    #menu:not(.ps-mobile-ready) .ps-mobile-fallback[open] ~ #nav li {
        float: none !important;
        width: auto !important;
        margin: 0;
    }
    #menu:not(.ps-mobile-ready) .ps-mobile-fallback[open] ~ #nav a {
        display: block;
        padding: 8px;
        color: #783500;
        white-space: normal;
        overflow-wrap: anywhere;
    }
    #menu:not(.ps-mobile-ready) .ps-mobile-fallback[open] ~ #nav a:focus-visible {
        outline: 2px solid #783500;
        outline-offset: -2px;
    }
    #menu.ps-mobile-ready #menupanel {
        display: inline-flex !important;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        box-sizing: border-box;
        min-width: 44px;
        min-height: 44px;
        margin: 4px;
        border: 1px solid currentColor;
        border-radius: 4px;
    }
    #menu.ps-mobile-ready #menupanel .rm-line {
        display: block;
        width: 22px;
        height: 2px;
        margin: 3px 0;
        background: currentColor;
    }
    body.ps-menu-open {
        overflow: hidden;
    }
    #menu.ps-mobile-open {
        z-index: 300001;
    }
    #menu.ps-mobile-open .ps-mobile-panel:not([hidden]) {
        display: flex !important;
        flex-direction: column;
        position: fixed;
        top: 16px;
        right: 16px;
        bottom: auto;
        left: 16px;
        box-sizing: border-box;
        width: auto;
        height: auto;
        max-width: none;
        max-height: calc(100vh - 32px);
        max-height: calc(100dvh - 32px);
        margin: 0;
        overflow: hidden;
        border: 1px solid #ddd;
        background: #fff;
        color: #222;
        z-index: 300002;
    }
    #menu.ps-mobile-ready .ps-mobile-panel .menupanel {
        display: flex;
        flex-direction: column;
        min-height: 0;
        box-sizing: border-box;
        padding: 8px 12px 16px;
    }
    #menu.ps-mobile-ready .ps-mobile-panel .closemenu {
        display: flex;
        flex: none;
        position: static;
        justify-content: center;
        align-items: center;
        width: 44px;
        height: 44px;
        margin: 0 0 8px auto;
        padding: 0;
        float: none;
        font-size: 30px;
        color: #222;
        cursor: pointer;
    }
    #menu .ps-mobile-tree,
    #menu .ps-mobile-tree ul {
        width: auto;
        margin: 0;
        padding: 0;
        list-style: none;
    }
    #menu .ps-mobile-tree {
        min-height: 0;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }
    #menu .ps-mobile-tree [hidden] {
        display: none !important;
    }
    #menu .ps-mobile-tree li {
        display: block;
        width: auto;
        margin: 0;
        padding: 0;
        float: none;
        background: none;
    }
    #menu .ps-mobile-tree .ps-mobile-row {
        display: flex;
        min-width: 0;
    }
    #menu .ps-mobile-tree > li > .ps-mobile-row {
        background: #fff7ec;
        border-bottom: 1px solid #efd9bc;
    }
    #menu .ps-mobile-tree .ps-mobile-label {
        display: flex;
        flex: 1;
        align-items: center;
        box-sizing: border-box;
        min-width: 0;
        min-height: 44px;
        padding: 9px 10px;
        font-size: 15px;
        font-weight: 650;
        line-height: 1.4;
        white-space: normal;
        overflow-wrap: anywhere;
        word-break: normal;
        text-indent: 0;
        text-decoration: none;
        color: #783500;
    }
    #menu .ps-mobile-tree .ps-mobile-label small {
        font-size: 0.85em;
    }
    #menu .ps-mobile-tree ul {
        margin-inline-start: 12px;
        padding-inline-start: 8px;
        border-inline-start: 1px solid #dc913d;
    }
    #menu .ps-mobile-tree ul .ps-mobile-label {
        color: #a35d06;
        font-weight: 500;
    }
    #menu .ps-mobile-tree ul ul {
        margin-inline-start: 10px;
        padding-inline-start: 7px;
        border-inline-start-color: #efc58f;
    }
    #menu .ps-mobile-tree ul ul .ps-mobile-row {
        position: relative;
    }
    #menu .ps-mobile-tree ul ul .ps-mobile-row::before {
        content: "";
        position: absolute;
        inset-inline-start: -7px;
        top: 22px;
        width: 7px;
        border-top: 1px solid #efc58f;
        pointer-events: none;
    }
    #menu .ps-mobile-tree ul ul .ps-mobile-label {
        color: #783500;
        font-weight: 400;
    }
    #menu .ps-mobile-tree .ps-mobile-active > .ps-mobile-row > .ps-mobile-label {
        color: #783500;
        box-shadow: inset 2px 0 #dc913d;
    }
    #menu .ps-mobile-tree .ps-mobile-row > .ps-mobile-label[aria-current="page"],
    #menu .ps-mobile-tree .ps-mobile-label:hover {
        color: #783500;
        background: #ffeed8;
    }
    #menu .ps-mobile-tree .ps-mobile-toggle {
        display: grid;
        flex: 0 0 44px;
        place-items: center;
        box-sizing: border-box;
        min-height: 44px;
        margin: 0;
        padding: 0 !important;
        border: 0;
        border-radius: 0 !important;
        color: #783500 !important;
        background: transparent !important;
        box-shadow: none;
    }
    #menu .ps-mobile-tree .ps-mobile-toggle:hover {
        background: #ffeed8 !important;
    }
    #menu .ps-mobile-tree .ps-mobile-toggle::before {
        content: "";
        width: 8px;
        height: 8px;
        border-right: 2px solid currentColor;
        border-bottom: 2px solid currentColor;
        transform: rotate(-45deg);
    }
    #menu .ps-mobile-tree .ps-mobile-toggle[aria-expanded="true"]::before {
        transform: rotate(45deg);
    }
    #menu .ps-mobile-tree :is(a, button):focus-visible {
        outline: 2px solid #783500;
        outline-offset: -3px;
    }
    #menu.ps-mobile-ready #menupanel:focus-visible,
    #menu.ps-mobile-ready .ps-mobile-panel .closemenu:focus-visible {
        outline: 2px solid #005fcc;
        outline-offset: 2px;
    }
}
