/* ==========================================================================
   MOBILE SIDEBAR (OFF-CANVAS) NAVIGATION
   ========================================================================== */

/* Hamburger – hidden on desktop */
.siu-mobile-menu-toggle {
    display: none;
}

/* Show + position hamburger on small screens */
@media (max-width: 900px) {
    .siu-main-header__inner {
        position: relative;
    }

    .siu-mobile-menu-toggle {
        display: inline-flex;
        position: absolute;
        left: 1rem;
        top: 1.1rem;
        width: 2.5rem;
        height: 2.5rem;
        align-items: center;
        justify-content: center;
        border: 0;
        background: transparent;
        cursor: pointer;
    }

    .siu-mobile-menu-toggle:focus-visible {
        outline: 2px solid #fff;
        outline-offset: 2px;
    }

    .siu-mobile-menu-toggle__icon,
    .siu-mobile-menu-toggle__icon::before,
    .siu-mobile-menu-toggle__icon::after {
        display: block;
        width: 25px;
        height: 3px;
        background-color: #ffffff;
        border-radius: 1px;
        position: relative;
        content: "";

        /* animate to X */
        transition:
            transform 0.25s ease,
            top 0.25s ease,
            background-color 0.25s ease;
    }

    .siu-mobile-menu-toggle__icon::before,
    .siu-mobile-menu-toggle__icon::after {
        position: absolute;
        left: 0;
    }

    .siu-mobile-menu-toggle__icon::before {
        top: -8px;
    }

    .siu-mobile-menu-toggle__icon::after {
        top: 8px;
    }

    /* ====== OPEN STATE → TURN INTO "X" ====== */

    .siu-mobile-menu-toggle[aria-expanded="true"] .siu-mobile-menu-toggle__icon {
        background-color: transparent;
        /* hide middle bar */
    }

    .siu-mobile-menu-toggle[aria-expanded="true"] .siu-mobile-menu-toggle__icon::before {
        top: 0;
        transform: rotate(45deg);
    }

    .siu-mobile-menu-toggle[aria-expanded="true"] .siu-mobile-menu-toggle__icon::after {
        top: 0;
        transform: rotate(-45deg);
    }
}


/* ==========================================================================
   MOBILE MENU PANEL – DROPS OUT UNDER HEADER, PUSHES CONTENT DOWN (ANIMATED)
   ========================================================================== */

.siu-mobile-menu {
    position: relative;
    background: rgb(var(--color-maroon-500));
    z-index: 1;

    max-height: 0;
    overflow: hidden;

    /* keep it fully visible, no fade */
    opacity: 1;

    /* only animate the push */
    transition: max-height 0.5s ease;
}

.siu-mobile-menu.is-open {
    max-height: 100vh;
    /* enough to fit the menu */
}


/* Inner content: same visual styling as before */
.siu-mobile-menu__inner {
    width: 100%;
    max-width: var(--siu-max-width);
    margin: 0 auto;
    padding: 1.5rem 2.25rem 2rem;
    background: rgb(var(--color-maroon-500));
    color: #ffffff;

    /* NEW: flex column so children (sections + close button) stack properly */
    display: flex;
    flex-direction: column;
    align-items: stretch;

    /* subtle drop-in that matches the push */
    transition: transform 0.5s ease;
}


.siu-mobile-menu.is-open .siu-mobile-menu__inner {
    transform: translateY(0);
}


/* Only show on small screens */
@media (min-width: 901px) {
    .siu-mobile-menu {
        display: none;
    }
}




/* Top bar inside slideout: title left, close right */
.siu-mobile-menu__top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.siu-mobile-menu__title {
    flex: 1;
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
    text-decoration: none;
}

.siu-mobile-menu__title:hover,
.siu-mobile-menu__title:focus-visible {
    text-decoration: none;
}


.siu-mobile-menu__close {
    border: none;
    background: transparent;
    color: #ffffff;
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;

    /* CENTER IT */
    margin-top: 1.5rem;
    margin-left: auto;
    margin-right: auto;
    display: flex;
    /* block-level flex item now */
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.siu-mobile-menu__close:hover,
.siu-mobile-menu__close:focus-visible {
    outline: none;
}

.siu-mobile-menu__close-text {
    letter-spacing: 0.05em;
}



/* =========
   SECTIONS
   ========= */

/* Generic section wrapper inside the mobile slideout */
.siu-mobile-menu__section {
    margin-top: 1.5rem;
}

/* Sidebar section (white panel at the top) */
.siu-mobile-menu__section--sidebar {
    background: #ffffff;
    color: rgb(var(--theme-text-color));
    /* pull it full-width inside the padded inner */
    margin: 1.5rem -2.25rem 0;
    padding: 1.5rem 2.25rem 2rem;
}

/* Global header section (keeps maroon background) */
.siu-mobile-menu__section--primary {
    /* margin-top: 2rem; */
    padding-top: 0;
    /* border-top: 1px solid rgba(255, 255, 255, 0.25); */
}

/* =========
   LISTS
   ========= */

.siu-mobile-menu__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.siu-mobile-menu__list>li {
    margin: 0.25rem 0;
}

/* Base link styling (primary/global menu defaults) */
.siu-mobile-menu__list a {
    display: block;
    padding: 0.65rem 0.25rem;
    font-weight: 700;
    text-decoration: none;
    color: #ffffff;
}

/* Hover: yellow for primary/global menu */
.siu-mobile-menu__list a:hover,
.siu-mobile-menu__list a:focus-visible {
    text-decoration: none;
    color: rgb(var(--color-yellow-200));
    /* SIU yellow */
}

/* Primary (header) menu tweaks */
.siu-mobile-menu__list--primary>li>a {
    padding: 0.65rem 0.25rem;
    font-size: 1.05rem;
}

/* Sidebar menu tweaks */
.siu-mobile-menu__list--sidebar {
    margin-top: 0.5rem;
}

/* Sidebar links: maroon on white */
.siu-mobile-menu__list--sidebar a {
    color: rgb(var(--color-maroon-500));
}

.siu-mobile-menu__list--sidebar a:hover,
.siu-mobile-menu__list--sidebar a:focus-visible {
    color: rgb(var(--color-maroon-700));
    text-decoration: underline;
}

/* Sidebar submenu styling – mimic desktop sidebar nav */
.siu-mobile-menu__list--sidebar .sub-menu {
    list-style: none;
    margin: 0.25rem 0 0 0;
    padding: 0;
    border-top: 1px solid rgba(0, 0, 0, 0.04);

    /* NEW: hide all child lists by default */
    display: none;
}

/* Show children only for the active branch (parent or ancestor is current) */
.siu-mobile-menu__list--sidebar .current-menu-item>.sub-menu,
.siu-mobile-menu__list--sidebar .current-menu-parent>.sub-menu,
.siu-mobile-menu__list--sidebar .current-menu-ancestor>.sub-menu {
    display: block;
}

.siu-mobile-menu__list--sidebar .sub-menu li a {
    position: relative;
    padding: 0.35rem 0 0.35rem 2.5rem;
    /* indent like desktop */
}

/* Deeper levels: indent nested children more on mobile */

/* 2nd level (child-of-child) */
.siu-mobile-menu__list--sidebar .sub-menu .sub-menu li a {
    padding-left: 3.25rem;
}

/* 3rd level */
.siu-mobile-menu__list--sidebar .sub-menu .sub-menu .sub-menu li a {
    padding-left: 4rem;
}

/* 4th level and deeper */
.siu-mobile-menu__list--sidebar .sub-menu .sub-menu .sub-menu .sub-menu li a {
    padding-left: 4.75rem;
}

/* Adjust » bullet positions for deeper levels */
.siu-mobile-menu__list--sidebar .sub-menu .sub-menu li a::before {
    left: 2rem;
}

.siu-mobile-menu__list--sidebar .sub-menu .sub-menu .sub-menu li a::before {
    left: 2.75rem;
}

.siu-mobile-menu__list--sidebar .sub-menu .sub-menu .sub-menu .sub-menu li a::before {
    left: 3.5rem;
}

/* » bullet on sidebar submenu links */
.siu-mobile-menu__list--sidebar .sub-menu li a::before {
    content: "»";
    position: absolute;
    left: 1.3rem;
}


/* =========
   STATE
   ========= */

/* Open state – JS toggles this class */
.siu-mobile-menu.is-open {
    opacity: 1;
    pointer-events: auto;
}

/* Only use mobile off-canvas on small screens */
@media (min-width: 901px) {
    .siu-mobile-menu {
        display: none;
    }
}

/* Active link color in mobile slideout – PRIMARY (header) menu only */
@media (max-width: 900px) {

    .siu-mobile-menu__list--primary .current-menu-item>a,
    .siu-mobile-menu__list--primary .current_page_item>a {
        color: rgb(var(--color-yellow-200));
        /* SIU yellow */
        text-decoration: none;
    }
}

/* Active state & hierarchy for SIDEBAR section on mobile */
@media (max-width: 900px) {

    /* Current page in sidebar = black + slightly larger */
    .siu-mobile-menu__list--sidebar .current-menu-item>a,
    .siu-mobile-menu__list--sidebar .current_page_item>a {
        color: #000000;
        font-size: 1.15rem;
        /* bump size */
        font-weight: 700;
        text-decoration: none;
    }

    /* When you're on a child page, highlight the parent too */
    .siu-mobile-menu__list--sidebar .current-menu-parent>a,
    .siu-mobile-menu__list--sidebar .current-menu-ancestor>a {
        color: #000000;
        font-weight: 700;
    }

    /* Make sure the active branch submenu is visible (like desktop) */
    .siu-mobile-menu__list--sidebar .current-menu-parent>.sub-menu,
    .siu-mobile-menu__list--sidebar .current-menu-ancestor>.sub-menu {
        display: block;
    }
}