/* ============================================================
   TEBA Header Submenus
   Header-only nested dropdowns. No mega menu, no page content.
   ============================================================ */

body.teba-hsm-active {
    --teba-hsm-paper: #F2EFE6;
    --teba-hsm-card: #FAF7EE;
    --teba-hsm-ink: #0B0B0C;
    --teba-hsm-muted: #777268;
    --teba-hsm-line: rgba(26,26,26,.14);
    --teba-hsm-accent: #D62246;
    --teba-hsm-gold: #C8A85A;
    --teba-hsm-shadow: 0 18px 38px rgba(0,0,0,.20);
    --teba-hsm-display: 'Barlow Condensed','Antonio','Archivo Black',system-ui,sans-serif;
    --teba-hsm-ui: 'Inter','Source Sans 3',system-ui,sans-serif;
}

body.teba-hsm-style-dark {
    --teba-hsm-paper: #0B0B0C;
    --teba-hsm-card: #111114;
    --teba-hsm-ink: #FFFFFF;
    --teba-hsm-muted: rgba(255,255,255,.68);
    --teba-hsm-line: rgba(255,255,255,.16);
    --teba-hsm-shadow: 0 18px 38px rgba(0,0,0,.42);
}

body.teba-hsm-style-minimal {
    --teba-hsm-paper: #FFFFFF;
    --teba-hsm-card: #FFFFFF;
    --teba-hsm-ink: #0B0B0C;
    --teba-hsm-muted: #777268;
    --teba-hsm-line: rgba(26,26,26,.12);
    --teba-hsm-shadow: 0 10px 24px rgba(0,0,0,.10);
}

/* Desktop primary header menu */
body.teba-hsm-active .teba-nav-wrapper,
body.teba-hsm-active #site-navigation {
    overflow: visible !important;
}

body.teba-hsm-active .teba-nav,
body.teba-hsm-active .teba-nav ul {
    overflow: visible !important;
}

body.teba-hsm-active .teba-nav .teba-hsm-has-children {
    position: relative;
}

body.teba-hsm-active .teba-nav .teba-hsm-has-children > .teba-hsm-link {
    padding-right: 18px;
}

body.teba-hsm-active .teba-nav .teba-hsm-has-children > .teba-hsm-link::after {
    content: "";
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: 7px;
    vertical-align: middle;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid currentColor;
    opacity: .72;
    transform: translateY(-1px);
}

body.teba-hsm-active .teba-nav .sub-menu {
    list-style: none !important;
    margin: 0 !important;
    padding: 8px 0 !important;
}

body.teba-hsm-active .teba-nav > .teba-hsm-has-children > .sub-menu {
    position: absolute !important;
    top: calc(100% + 16px) !important;
    left: 50% !important;
    z-index: 9999 !important;
    min-width: 236px;
    width: max-content;
    max-width: 320px;
    background: var(--teba-hsm-paper) !important;
    border: 1px solid var(--teba-hsm-line) !important;
    border-top: 3px solid var(--teba-hsm-accent) !important;
    box-shadow: var(--teba-hsm-shadow) !important;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(-50%) translateY(8px);
    transition: opacity 140ms ease, transform 140ms ease, visibility 140ms ease;
}

body.teba-hsm-active .teba-nav > .teba-hsm-has-children > .sub-menu::before {
    content: "";
    position: absolute;
    top: -9px;
    left: 50%;
    width: 14px;
    height: 14px;
    background: var(--teba-hsm-paper);
    border-left: 1px solid var(--teba-hsm-line);
    border-top: 1px solid var(--teba-hsm-line);
    transform: translateX(-50%) rotate(45deg);
}

body.teba-hsm-active .teba-nav > .teba-hsm-has-children:hover > .sub-menu,
body.teba-hsm-active .teba-nav > .teba-hsm-has-children:focus-within > .sub-menu,
body.teba-hsm-active .teba-nav > .teba-hsm-has-children.is-submenu-open > .sub-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

body.teba-hsm-active .teba-nav .sub-menu li {
    position: relative;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    white-space: nowrap;
}

body.teba-hsm-active .teba-nav .sub-menu a {
    display: block !important;
    color: var(--teba-hsm-ink) !important;
    font-family: var(--teba-hsm-display) !important;
    font-size: 15px !important;
    line-height: 1.1 !important;
    font-weight: 800 !important;
    letter-spacing: .04em !important;
    text-transform: uppercase !important;
    text-decoration: none !important;
    padding: 12px 18px !important;
    border-left: 3px solid transparent;
    transition: color 120ms ease, background 120ms ease, border-color 120ms ease;
}

body.teba-hsm-active .teba-nav .sub-menu a:hover,
body.teba-hsm-active .teba-nav .sub-menu a:focus,
body.teba-hsm-active .teba-nav .teba-hsm-is-active > a {
    color: var(--teba-hsm-accent) !important;
    background: rgba(214,34,70,.055) !important;
    border-left-color: var(--teba-hsm-accent);
    outline: none;
}

/* Third-level flyouts stay small and simple, not mega-menu style. */
body.teba-hsm-active .teba-nav .sub-menu .sub-menu {
    position: absolute !important;
    top: -9px !important;
    left: calc(100% + 8px) !important;
    min-width: 220px;
    background: var(--teba-hsm-paper) !important;
    border: 1px solid var(--teba-hsm-line) !important;
    border-top: 3px solid var(--teba-hsm-accent) !important;
    box-shadow: var(--teba-hsm-shadow) !important;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(8px);
    transition: opacity 140ms ease, transform 140ms ease, visibility 140ms ease;
}

body.teba-hsm-active .teba-nav .sub-menu .teba-hsm-has-children:hover > .sub-menu,
body.teba-hsm-active .teba-nav .sub-menu .teba-hsm-has-children:focus-within > .sub-menu,
body.teba-hsm-active .teba-nav .sub-menu .teba-hsm-has-children.is-submenu-open > .sub-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(0);
}

/* Toggle button: hidden on desktop, used for mobile/touch. */
body.teba-hsm-active .teba-hsm-toggle {
    display: none;
    appearance: none;
    -webkit-appearance: none;
    border: 0;
    background: transparent;
    color: currentColor;
    cursor: pointer;
    font: inherit;
}

/* Mobile drawer / smaller headers. */
@media (max-width: 760px) {
    body.teba-hsm-active .teba-nav .teba-hsm-has-children > .teba-hsm-link::after {
        display: none;
    }

    body.teba-hsm-active .teba-mobile-nav .teba-hsm-has-children,
    body.teba-hsm-active .teba-nav .teba-hsm-has-children {
        position: relative;
    }

    body.teba-hsm-active .teba-mobile-nav .teba-hsm-toggle,
    body.teba-hsm-active .teba-nav .teba-hsm-toggle {
        display: inline-grid;
        place-items: center;
        position: absolute;
        top: 7px;
        right: 10px;
        width: 34px;
        height: 34px;
        color: inherit;
        z-index: 2;
    }

    body.teba-hsm-active .teba-mobile-nav .teba-hsm-toggle span,
    body.teba-hsm-active .teba-nav .teba-hsm-toggle span {
        display: block;
        transition: transform 140ms ease;
    }

    body.teba-hsm-active .teba-mobile-nav .is-submenu-open > .teba-hsm-toggle span,
    body.teba-hsm-active .teba-nav .is-submenu-open > .teba-hsm-toggle span {
        transform: rotate(180deg);
    }

    body.teba-hsm-active .teba-mobile-nav .teba-hsm-has-children > a,
    body.teba-hsm-active .teba-nav .teba-hsm-has-children > a {
        padding-right: 52px !important;
    }

    body.teba-hsm-active .teba-mobile-nav .sub-menu,
    body.teba-hsm-active .teba-nav .sub-menu,
    body.teba-hsm-active .teba-nav > .teba-hsm-has-children > .sub-menu,
    body.teba-hsm-active .teba-nav .sub-menu .sub-menu {
        position: static !important;
        top: auto !important;
        left: auto !important;
        width: 100% !important;
        max-width: none !important;
        min-width: 0 !important;
        margin: 0 !important;
        padding: 0 0 8px 16px !important;
        border: 0 !important;
        border-left: 2px solid var(--teba-hsm-accent) !important;
        box-shadow: none !important;
        background: transparent !important;
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
        transform: none !important;
        display: none !important;
    }

    body.teba-hsm-active .teba-mobile-nav .sub-menu::before,
    body.teba-hsm-active .teba-nav .sub-menu::before {
        display: none !important;
    }

    body.teba-hsm-active .teba-mobile-nav .is-submenu-open > .sub-menu,
    body.teba-hsm-active .teba-nav .is-submenu-open > .sub-menu {
        display: block !important;
    }

    body.teba-hsm-active .teba-mobile-nav .sub-menu a,
    body.teba-hsm-active .teba-nav .sub-menu a {
        color: inherit !important;
        background: transparent !important;
        border-left: 0 !important;
        padding: 10px 12px !important;
        font-size: 14px !important;
        opacity: .86;
    }
}


/* ============================================================
   TEBA League Theme Exact Header Integration
   - Theme desktop menu: #site-navigation .teba-nav
   - Theme mobile drawer: #teba-mobile-menu .teba-mobile-nav
   - Theme mobile breakpoint: 760px
   ============================================================ */

body.teba-hsm-active #site-navigation.teba-nav-wrapper {
    overflow: visible !important;
    z-index: 60;
}

body.teba-hsm-active .teba-header,
body.teba-hsm-active .teba-header__inner {
    overflow: visible !important;
}

body.teba-hsm-active .teba-nav > .teba-hsm-has-children > .sub-menu {
    top: calc(100% + 12px) !important;
}

body.teba-hsm-active .teba-nav > .teba-hsm-has-children > .teba-hsm-link {
    display: inline-flex !important;
    align-items: center;
}

body.teba-hsm-active .teba-nav > .teba-hsm-has-children:hover > .teba-hsm-link,
body.teba-hsm-active .teba-nav > .teba-hsm-has-children:focus-within > .teba-hsm-link,
body.teba-hsm-active .teba-nav > .teba-hsm-has-children.is-submenu-open > .teba-hsm-link {
    background: var(--color-accent) !important;
    color: #fff !important;
}

/* Keep submenu active styles from accidentally turning every top parent into a cream item. */
body.teba-hsm-active .teba-nav > .teba-hsm-has-children.teba-hsm-is-active > .teba-hsm-link {
    background: var(--color-accent) !important;
    color: #fff !important;
}

/* Mobile drawer: theme closes on link click, so the plugin uses the small toggle
   and a first-tap guard in JS for parents with children. */
@media (max-width: 760px) {
    body.teba-hsm-active #teba-mobile-menu {
        overflow: hidden !important;
    }

    body.teba-hsm-active #teba-mobile-menu .teba-mobile-nav .teba-hsm-has-children > a {
        padding-right: calc(var(--hub-gutter) + 48px) !important;
    }

    body.teba-hsm-active #teba-mobile-menu .teba-mobile-nav .teba-hsm-toggle {
        top: 7px !important;
        right: var(--hub-gutter) !important;
        color: #fff !important;
    }

    body.teba-hsm-active #teba-mobile-menu .teba-mobile-nav .sub-menu {
        padding: 0 0 8px calc(var(--hub-gutter) + 12px) !important;
        border-left: 0 !important;
        background: rgba(255,255,255,.035) !important;
    }

    body.teba-hsm-active #teba-mobile-menu .teba-mobile-nav .sub-menu a {
        color: rgba(255,255,255,.86) !important;
        border-bottom-color: rgba(255,255,255,.06) !important;
        font-size: 14px !important;
        padding-left: 0 !important;
    }

    body.teba-hsm-active #teba-mobile-menu .teba-mobile-nav .sub-menu a:hover,
    body.teba-hsm-active #teba-mobile-menu .teba-mobile-nav .sub-menu a:focus,
    body.teba-hsm-active #teba-mobile-menu .teba-mobile-nav .sub-menu .current-menu-item > a {
        color: #fff !important;
        background: transparent !important;
    }
}
