/* =========================================================
   AAAP Offcanvas Menu 1.5
   Contextual silo navigation.
   Links exist server-side before JavaScript execution.
   ========================================================= */

.aaap-menu-wrap {
    position: fixed;
    inset: 0;
    z-index: 9999;

    visibility: hidden;
    opacity: 0;
    pointer-events: none;

    transition:
        opacity .2s ease,
        visibility .2s ease;
}

.aaap-menu-wrap[aria-hidden="false"] {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.aaap-menu-overlay {
    position: absolute;
    inset: 0;

    width: 100%;
    height: 100%;

    margin: 0;
    padding: 0;
    border: 0;

    background: rgba(0, 0, 0, .45);

    cursor: pointer;
}

html.aaap-menu-open {
    overflow: hidden;
}


/* =========================================================
   Drawer
   ========================================================= */

.aaap-menu-drawer {
    position: relative;

    width: 380px;
    max-width: 90vw;
    height: 100vh;

    margin-right: auto;

    overflow: hidden;

    background: #fff;
    border-right: 1px solid #eee;

    transform: translateX(-100%);
    transition: transform .28s ease;
}

.aaap-menu-wrap[aria-hidden="false"]
.aaap-menu-drawer {
    transform: translateX(0);
}

.aaap-menu-close {
    position: absolute;
    z-index: 3;
    top: 18px;
    right: 18px;

    width: 36px;
    height: 36px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    margin: 0;
    padding: 0;
    border: 0;

    background: transparent;
    color: #111;

    font-size: 29px;
    line-height: 1;

    cursor: pointer;
}


/* =========================================================
   Panel
   ========================================================= */

.aaap-menu-panel {
    height: 100%;

    overflow-y: auto;
    overscroll-behavior: contain;

    padding:
        66px
        26px
        max(34px, env(safe-area-inset-bottom));

    background: #fff;
}

.aaap-title {
    margin: 0 0 18px;

    color: #999;

    font-size: 11px;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: .08em;

    text-transform: uppercase;
}


/* =========================================================
   Lists
   ========================================================= */

.aaap-list {
    list-style: none;

    margin: 0;
    padding: 0;
}

.aaap-list li {
    margin: 0;
    padding: 0;
}

.aaap-list a {
    display: block;

    padding: 15px 2px;

    border-bottom: 1px solid #f0f0f0;

    color: #111;

    font-size: 16px;
    font-weight: 500;
    line-height: 1.35;

    text-decoration: none;
}

.aaap-list a:hover,
.aaap-list a:focus-visible {
    color: #7d5557;
}


/* =========================================================
   Silo hierarchy
   ========================================================= */

.aaap-pillar-link {
    font-weight: 700 !important;
}

.aaap-silo-children {
    margin: 0;
    padding: 0;
}

.aaap-silo-children > li {
    margin: 0;
}

.aaap-all-link a {
    font-weight: 600;
}

.aaap-group-label {
    padding:
        28px
        2px
        9px !important;

    color: #999;

    font-size: 11px;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: .08em;

    text-transform: uppercase;
}

.aaap-group-label span {
    display: block;
}


/* =========================================================
   Header trigger
   ========================================================= */

.aaap-menu-link,
.aaap-menu-toggle {
    display: inline-flex;
    align-items: center;

    gap: 8px;
}

.aaap-menu-toggle::before {
    content: "";

    display: inline-block;
    flex: 0 0 auto;

    width: 19px;
    height: 14px;

    background:
        linear-gradient(currentColor, currentColor)
            0 0 / 100% 1.5px no-repeat,
        linear-gradient(currentColor, currentColor)
            0 50% / 100% 1.5px no-repeat,
        linear-gradient(currentColor, currentColor)
            0 100% / 100% 1.5px no-repeat;
}

.aaap-left {
    order: -999;
    margin-right: auto;
}


/* =========================================================
   Moderno integration
   ========================================================= */

.c-header__mobile-menu,
.c-header__drawer,
.c-offcanvas,
.js-mobile-menu {
    display: none !important;
}

@media (max-width: 1024px) {

    .aaap-menu-text {
        display: none;
    }
}

@media (max-width: 767px) {

    .aaap-menu-drawer {
        width: 92vw;
        max-width: 390px;
    }

    .aaap-menu-panel {
        padding-left: 20px;
        padding-right: 20px;
    }

    .c-header__menu-button {
        visibility: hidden;
    }

    .h-cb.c-header__button-link.c-header__custom-button {
        position: absolute;
        left: 10px;
    }
}


/* =========================================================
   Keyboard / reduced motion
   ========================================================= */

.aaap-menu-wrap button:focus-visible,
.aaap-menu-wrap a:focus-visible {
    outline: 2px solid #7d5557;
    outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {

    .aaap-menu-wrap,
    .aaap-menu-drawer {
        transition: none;
    }
}


/* =========================================================
   AAAP MOBILE HAMBURGER — FORCED VISIBLE
   2026-08-21

   Use Moderno's existing native menu control as the physical
   trigger, but draw our own hamburger so theme icon visibility
   cannot make the AAAP navigation inaccessible.
   ========================================================= */

@media (max-width: 767px) {

    /*
     * The native Moderno trigger is the single mobile trigger.
     * Force it into the layout even if the theme hides it.
     */
    .c-header__menu-button {
        display: inline-flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        pointer-events: auto !important;

        position: relative !important;

        width: 44px !important;
        min-width: 44px !important;
        height: 44px !important;
        min-height: 44px !important;

        margin: 0 !important;
        padding: 0 !important;

        align-items: center !important;
        justify-content: center !important;

        overflow: visible !important;

        background: transparent !important;
        border: 0 !important;
        box-shadow: none !important;

        color: #111 !important;

        z-index: 50 !important;

        cursor: pointer !important;
    }


    /*
     * We deliberately draw the icon ourselves.
     */
    .c-header__menu-button::before {
        content: "" !important;

        display: block !important;

        width: 21px !important;
        height: 15px !important;

        flex: 0 0 21px !important;

        background:
            linear-gradient(
                currentColor,
                currentColor
            )
            0 0 / 100% 1.5px no-repeat,

            linear-gradient(
                currentColor,
                currentColor
            )
            0 50% / 100% 1.5px no-repeat,

            linear-gradient(
                currentColor,
                currentColor
            )
            0 100% / 100% 1.5px no-repeat
            !important;

        opacity: 1 !important;

        transform: none !important;
    }


    /*
     * Any Moderno icon inside the trigger is unnecessary now.
     * Hide it to prevent duplicate hamburger graphics.
     */
    .c-header__menu-button svg,
    .c-header__menu-button i,
    .c-header__menu-button .fi-bd21-hamburger,
    .c-header__menu-button [class*="hamburger"] {
        display: none !important;
    }


    /*
     * The separate custom mobile button remains available only
     * as a fallback if a template has no native button. On normal
     * Moderno templates it stays hidden so we get one control.
     */
    body:has(.c-header__menu-button)
    .h-cb.c-header__button-link.c-header__custom-button {
        display: none !important;
    }
}
