/* =========================================================
   WSU HEADER
   Desktop: fixed header below the top black navigation
   Mobile: normal responsive header
   ========================================================= */

.custom-hover:hover {
    color: red;
}

/* ================= TOP BLACK NAVIGATION ================= */

.top-nav-container {
    position: relative;
    z-index: 1100;
    width: 100%;
    background: #000;
    color: #fff;
    font-family: Arial, sans-serif;
}

.top-nav-bar {
    min-height: 40px;
    padding: 0 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    box-sizing: border-box;
}

.top-nav-links {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    min-width: 0;
}

.top-nav-link {
    display: inline-block;
    color: #dadee1 !important;
    text-decoration: none;
    padding: 8px 12px;
    margin: 0 2px;
    font-size: 14px;
    white-space: nowrap;
    transition: color .3s ease;
}

.top-nav-link:hover {
    color: #fff !important;
}

.top-nav-language {
    margin-left: auto;
    padding-left: 10px;
    flex-shrink: 0;
}

.language-selector {
    min-width: 90px;
    height: 30px;
    padding: 4px 8px;
    border: none;
    border-radius: 4px;
    background: #17a2b8 !important;
    color: #fff !important;
    font-size: 13px;
    cursor: pointer;
}

/* ================= DESKTOP HEADER ================= */

@media (min-width: 992px) {

    /*
       IMPORTANT:
       This fixes the complete header (logo + red menu)
       near the top of the screen and keeps it there on scroll.
    */

    .header {
        position: fixed !important;
        top: 50px !important;
        left: 50% !important;
        right: auto !important;
        transform: translateX(-50%) !important;

        width: calc(100% - 30px) !important;
        max-width: 1600px !important;
        min-height: 100px !important;
        height: 100px !important;

        margin: 0 !important;
        padding: 0 10px !important;

        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 12px;

        box-sizing: border-box;
        background: transparent !important;
        border: none !important;
        border-radius: 0 !important;

        z-index: 2000 !important;
        overflow: visible !important;
    }

    /* Logo area */

    .header > div:first-child {
        flex: 0 0 auto;
        min-width: 0;
    }

    .logo_container {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0 8px;
        max-width: 230px;
        box-sizing: border-box;
    }

    .logo {
        display: block;
    }

    .logo-img {
        display: block;
        width: auto;
        max-width: 210px;
        max-height: 75px;
        height: auto;
        object-fit: contain;
    }

    /* Red menu panel */

    .main_nav_container {
        position: relative !important;
        z-index: 2001 !important;

        display: flex !important;
        align-items: center !important;
        justify-content: flex-end !important;

        flex: 1 1 auto;
        min-width: 0;
        max-width: calc(100% - 240px);

        height: 85px !important;
        background: #880502 !important;
        border-radius: 42.5px !important;

        overflow: visible !important;
        box-sizing: border-box;
    }

    .main_nav {
        width: 100%;
        min-width: 0;
    }

    .main_nav_list {
        display: flex;
        align-items: center;
        justify-content: flex-end;

        width: 100%;
        height: 100%;
        min-width: 0;

        margin: 0;
        padding: 0;
        list-style: none;
    }

    .main_nav_item {
        position: relative !important;
        display: flex;
        align-items: center;

        height: 85px;
        flex: 0 1 auto;
        min-width: 0;
        white-space: nowrap;
    }

    .main_nav_item > a {
        display: flex;
        align-items: center;
        justify-content: center;

        height: 100%;
        padding: 0 clamp(5px, 0.8vw, 13px);

        color: #fff !important;
        font-size: clamp(11px, 0.95vw, 15px);
        text-decoration: none;
        white-space: nowrap;

        transition: color .3s ease;
    }

    .main_nav_item:hover > a {
        color: #ffb606 !important;
    }

    /* Allow dropdowns to extend outside the menu panel */

    .header,
    .main_nav_container,
    .main_nav,
    .main_nav_list,
    .main_nav_item {
        overflow: visible !important;
    }

    /* ================= FIRST LEVEL DROPDOWN ================= */

    .sub_menu {
        position: absolute;
        top: 100%;
        left: 0;
        right: auto;

        width: max-content;
        min-width: 210px;
        max-width: calc(100vw - 20px);

        margin: 0;
        padding: 0;
        list-style: none;

        background: #880502;
        border-radius: 0 0 10px 10px;
        box-shadow: 0 10px 20px rgba(0, 0, 0, .2);

        z-index: 2100;
        box-sizing: border-box;

        display: block !important;
        visibility: hidden;
        opacity: 0;
        transform: translateY(10px);

        transition:
            opacity .25s ease,
            transform .25s ease,
            visibility .25s ease;

        pointer-events: none;
    }

    .main_nav_item:hover > .sub_menu {
        visibility: visible;
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
    }

    .main_nav_item.align-right > .sub_menu {
        left: auto;
        right: 0;
    }

    .sub_menu li {
        position: relative;
        display: block;
        width: 100%;
        margin: 0;
        padding: 0;
    }

    .sub_menu li a {
        display: block;
        width: 100%;
        padding: 12px 18px;

        box-sizing: border-box;
        line-height: 1.4;

        color: #fff !important;
        text-decoration: none;
        white-space: normal;
        overflow-wrap: anywhere;

        transition: background .3s ease, color .3s ease;
    }

    .sub_menu li a:hover {
        background: #6a0403;
        color: #ffb606 !important;
    }

    /* ================= SECOND LEVEL DROPDOWN ================= */

    .sub_sub_menu {
        position: absolute;
        top: 0;
        left: 100%;
        right: auto;

        width: max-content;
        min-width: 180px;
        max-width: min(520px, calc(100vw - 20px));

        margin: 0;
        padding: 5px 0;
        list-style: none;

        background: #880502;
        border-radius: 0 10px 10px 10px;
        box-shadow: 0 10px 20px rgba(0, 0, 0, .2);

        z-index: 2101;
        box-sizing: border-box;

        display: block !important;
        visibility: hidden;
        opacity: 0;
        transform: translateX(10px);

        transition:
            opacity .25s ease,
            transform .25s ease,
            visibility .25s ease;

        pointer-events: none;
    }

    .sub_menu li:hover > .sub_sub_menu {
        visibility: visible;
        opacity: 1;
        transform: translateX(0);
        pointer-events: auto;
    }

    .sub_sub_menu li {
        display: block;
        width: 100%;
    }

    .sub_sub_menu li a {
        display: block;
        width: 100%;
        padding: 9px 15px;

        box-sizing: border-box;
        color: #fff !important;
        line-height: 1.4;
        text-decoration: none;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .sub_sub_menu li a:hover {
        background: #6a0403;
        color: #ffb606 !important;
    }

    /* Open nested dropdown to the left when needed */

    .sub_menu > li.has_sub_sub_menu.right-edge > .sub_sub_menu {
        left: auto;
        right: 100%;
        border-radius: 10px 0 10px 10px;
        transform: translateX(-10px);
    }

    .sub_menu > li.has_sub_sub_menu.right-edge:hover > .sub_sub_menu {
        transform: translateX(0);
    }

    /*
       Spacer is inserted by JavaScript after the fixed header.
       It preserves the original space in the page layout.
    */

    .header-scroll-spacer {
        display: block !important;
        width: 100%;
        height: 100px;
        visibility: hidden;
        pointer-events: none;
    }
}

/* ================= MOBILE NAVIGATION ================= */

.mobile_nav_container {
    position: fixed;
    top: 0;
    left: 0;

    width: min(85%, 360px);
    height: 100vh;
    overflow-y: auto;

    background: #fff;
    box-shadow: 2px 0 15px rgba(0, 0, 0, .2);

    transform: translateX(-110%);
    transition: transform .4s ease;

    z-index: 3002;
}

.mobile_nav_container.open {
    transform: translateX(0);
}

.mobile_nav_list,
.mobile_sub_menu,
.mobile_sub_sub_menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile_nav_item {
    border-bottom: 1px solid #ddd;
}

.mobile_nav_item a {
    display: block;
    padding: 15px 20px;
    color: #333;
    text-decoration: none;
    font-weight: 500;
}

.mobile_nav_item a:hover {
    color: #880502;
}

.mobile_sub_menu,
.mobile_sub_sub_menu {
    display: none;
    background: #f8f9fa;
}

.mobile_sub_menu.open,
.mobile_sub_sub_menu.open {
    display: block;
}

.mobile_sub_menu a {
    padding-left: 35px;
}

.mobile_sub_sub_menu a {
    padding-left: 50px;
}

.mobile_nav_item.has_sub_menu > a,
.mobile_sub_menu .has_sub_sub_menu > a {
    position: relative;
    padding-right: 45px;
}

.sub_menu_indicator {
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    font-size: 12px;
}

/* ================= MOBILE OVERLAY ================= */

.mobile_menu_overlay {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;

    background: rgba(0, 0, 0, .6);

    z-index: 3001;
    opacity: 0;
    visibility: hidden;

    transition: all .3s ease;
}

.mobile_menu_overlay.open {
    opacity: 1;
    visibility: visible;
}

/* ================= LOGO AND HAMBURGER ================= */

.hamburger_container {
    display: none;
    position: relative;
    padding: 10px;
    cursor: pointer;
    z-index: 1002;
}

.logo_container {
    display: flex;
    align-items: center;
}

.logo {
    display: inline-block;
}

.logo-img {
    display: block;
    height: auto;
    max-width: 100%;
}

/* ================= RESPONSIVE MOBILE HEADER ================= */

@media (max-width: 991px) {

    .header-scroll-spacer {
        display: none !important;
        height: 0 !important;
    }

    .top-nav-bar {
        min-height: 45px;
        height: 45px;
        padding: 0 8px;

        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 5px;

        overflow: hidden;
    }

    .top-nav-links {
        flex: 1 1 auto;
        min-width: 0;

        display: flex;
        flex-wrap: nowrap;

        overflow-x: auto;
        overflow-y: hidden;
        white-space: nowrap;

        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .top-nav-links::-webkit-scrollbar {
        display: none;
    }

    .top-nav-link {
        flex: 0 0 auto;
        font-size: 12px;
        padding: 6px 8px;
        margin: 0;
    }

    .top-nav-language {
        flex: 0 0 auto;
        margin-left: 4px;
        padding-left: 0;
    }

    .language-selector {
        width: 82px;
        min-width: 82px;
        height: 28px;
        padding: 3px 5px;
        font-size: 11px;
    }

    /* Mobile header stays in normal page flow */

    .header {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        transform: none !important;

        width: 100% !important;
        max-width: 100% !important;
        height: 65px !important;
        min-height: 65px !important;

        margin: 0 !important;
        padding: 0 12px !important;

        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 10px;

        background: #880502 !important;
        border-radius: 0 !important;

        box-sizing: border-box;
        z-index: 1000 !important;
        overflow: visible !important;
    }

    .header > div:first-child {
        flex: 0 1 auto;
        min-width: 0;
    }

    .logo_container {
        order: 1;
        width: auto;
        max-width: 190px;

        padding: 4px 10px !important;
        background: #fff;
        border-radius: 30px;
        box-shadow: 0 2px 5px rgba(0, 0, 0, .2);
    }

    .logo-img {
        width: 130px;
        max-width: 100%;
        max-height: 35px;
        object-fit: contain;
    }

    .main_nav_container {
        display: none !important;
    }

    .hamburger_container {
        order: 2;
        display: flex !important;
        align-items: center;
        justify-content: center;

        flex: 0 0 40px;
        width: 40px;
        height: 40px;

        margin-left: auto;
        padding: 0;
        background: transparent;
    }

    .header .hamburger_container i {
        color: #fff !important;
        font-size: 28px;
        opacity: 1;
    }
}

/* ================= SMALL MOBILE SCREENS ================= */

@media (max-width: 400px) {

    .top-nav-link {
        font-size: 11px;
        padding: 6px;
    }

    .language-selector {
        width: 75px;
        min-width: 75px;
    }

    .logo-img {
        width: 115px;
    }
}


/* =========================================================
   FINAL DESKTOP HEADER DESIGN
   The outer navigation container owns the single maroon panel.
   The inner .main_nav remains transparent.
   ========================================================= */

@media (min-width: 992px) {

    .header {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        box-sizing: border-box;
    }

    .header .main_nav_container {
        flex: 1 1 auto !important;
        min-width: 0 !important;
        height: 65px !important;
        min-height: 65px !important;

        display: flex !important;
        align-items: center !important;
        justify-content: center !important;

        background: #880502 !important;
        border: none !important;
        border-radius: 10px !important;
        box-shadow: 0 3px 8px rgba(0, 0, 0, 0.10);
        overflow: visible !important;
    }

    .header .main_nav {
        position: relative;
        isolation: isolate;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;

        width: 100% !important;
        height: 65px !important;
        min-height: 65px !important;
        min-width: 0 !important;
        padding: 0 !important;
        box-sizing: border-box;

        background: transparent !important;
        border: none !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        overflow: visible !important;
    }

    .header .main_nav::before,
    .header .main_nav::after {
        display: none !important;
        content: none !important;
    }

    .header .main_nav:hover {
        box-shadow: none !important;
    }

    .header .main_nav_list {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-evenly !important;

        width: 100% !important;
        height: 65px !important;
        min-width: 0 !important;
        margin: 0 !important;
        padding: 0 10px !important;
        gap: 5px;
        list-style: none;
    }

    .header .main_nav_item {
        position: relative !important;
        display: flex !important;
        align-items: center !important;
        height: 65px !important;
        flex: 0 1 auto;
        min-width: 0;
        margin: 0 !important;
        padding: 0;
        text-align: center;
        white-space: nowrap;
    }

    .header .main_nav_item > a {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;

        height: 100% !important;
        padding: 0 9px !important;

        color: #fff !important;
        font-size: clamp(11px, 0.95vw, 15px) !important;
        font-weight: 500;
        line-height: 1.3;
        text-align: center;
        text-decoration: none !important;
        white-space: nowrap;

        transition: color 0.25s ease, transform 0.25s ease;
    }

    .header .main_nav_item > a::after {
        display: none !important;
        content: none !important;
    }

    .header .main_nav_item > a:hover,
    .header .main_nav_item.active > a {
        color: #fff !important;
    }

    .header .main_nav_item > a:hover {
        transform: translateY(-1px);
    }

    /* Keep dropdown menus above page content and allow them to overflow. */
    .header,
    .header .main_nav_container,
    .header .main_nav,
    .header .main_nav_list,
    .header .main_nav_item {
        overflow: visible !important;
    }

    .header .main_nav_item:hover {
        z-index: 2200 !important;
    }

    .header .main_nav_item > .sub_menu {
        z-index: 2300 !important;
    }

    .header .sub_menu .sub_sub_menu {
        z-index: 2400 !important;
    }
}

/* Slightly tighter menu spacing on narrower desktop screens. */
@media (min-width: 992px) and (max-width: 1199px) {
    .header {
        gap: 10px !important;
    }

    .header .main_nav_list {
        gap: 1px !important;
        padding-left: 5px !important;
        padding-right: 5px !important;
    }

    .header .main_nav_item > a {
        padding-left: 5px !important;
        padding-right: 5px !important;
        font-size: clamp(10px, 1vw, 13px) !important;
    }
}

/* Mobile header/navigation rules above remain unchanged. */


/* =========================================================
   DESKTOP NAVIGATION: OVAL PANEL + CENTERED MENU LABELS
   ========================================================= */

@media (min-width: 992px) {

    /* The outer container is the single visible oval panel. */
    .header .main_nav_container {
        height: 65px !important;
        min-height: 65px !important;
        background: #880502 !important;
        border: 0 !important;
        border-radius: 999px !important;
        box-shadow: 0 3px 9px rgba(0, 0, 0, .12);
        overflow: visible !important;
    }

    /* Inner navigation must not draw a second background. */
    .header .main_nav {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 100% !important;
        height: 65px !important;
        min-height: 65px !important;
        padding: 0 18px !important;
        background: transparent !important;
        border: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        overflow: visible !important;
    }

    .header .main_nav::before,
    .header .main_nav::after {
        display: none !important;
        content: none !important;
    }

    .header .main_nav_list {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: center !important;
        gap: clamp(4px, .65vw, 12px) !important;
        width: 100% !important;
        height: 65px !important;
        margin: 0 !important;
        padding: 0 8px !important;
        list-style: none !important;
    }

    .header .main_nav_item {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        height: 65px !important;
        margin: 0 !important;
        padding: 0 !important;
        text-align: center !important;
    }

    .header .main_nav_item > a {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        height: 100% !important;
        padding: 0 clamp(5px, .65vw, 12px) !important;
        color: #fff !important;
        text-align: center !important;
        line-height: 1.25 !important;
        white-space: nowrap !important;
        text-decoration: none !important;
    }

    .header .main_nav_item > a::after {
        display: none !important;
        content: none !important;
    }

    /* Dropdowns must be allowed to extend beyond the oval panel. */
    .header,
    .header .main_nav_container,
    .header .main_nav,
    .header .main_nav_list,
    .header .main_nav_item {
        overflow: visible !important;
    }

    .header .sub_menu {
        max-width: calc(100vw - 20px) !important;
        box-sizing: border-box !important;
        overflow: visible !important;
    }

    .header .sub_menu li a,
    .header .sub_sub_menu li a {
        box-sizing: border-box !important;
        overflow-wrap: anywhere !important;
        word-break: normal !important;
    }

    .header .sub_menu > li.has_sub_sub_menu {
        position: relative !important;
    }

    .header .sub_sub_menu {
        max-width: calc(100vw - 20px);
        box-sizing: border-box !important;
    }
}

@media (min-width: 992px) and (max-width: 1199px) {
    .header .main_nav {
        padding-left: 8px !important;
        padding-right: 8px !important;
    }

    .header .main_nav_list {
        gap: 2px !important;
        padding-left: 4px !important;
        padding-right: 4px !important;
    }

    .header .main_nav_item > a {
        padding-left: 4px !important;
        padding-right: 4px !important;
        font-size: clamp(10px, .95vw, 13px) !important;
    }
}

/* =========================================================
   FINAL FIX: CENTER, BOLD AND ENLARGE DESKTOP MENU TEXT
   ========================================================= */

@media (min-width: 992px) {

    /* Maroon background panel */
    .header .main_nav_container {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        height: 85px !important;
        min-height: 85px !important;
        border-radius: 999px !important;
        padding: 0 20px !important;
        box-sizing: border-box !important;
    }

    /* Navigation content */
    .header .main_nav {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 100% !important;
        height: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Center all menu items */
    .header .main_nav_list {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 100% !important;
        height: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        gap: clamp(8px, 1.2vw, 22px) !important;
    }

    /* Center each menu item */
    .header .main_nav_item {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        height: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Menu text */
    .header .main_nav_item > a {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;

        height: 100% !important;
        padding: 0 8px !important;
        margin: 0 !important;

        color: #ffffff !important;
        font-family: Arial, sans-serif !important;
        font-size: 17px !important;
        font-weight: 700 !important;
        line-height: 1.2 !important;
        text-align: center !important;
        text-decoration: none !important;
        white-space: nowrap !important;
    }

    /* Hover effect */
    .header .main_nav_item > a:hover {
        color: #ffcc33 !important;
    }

    /* Keep dropdown positioning unaffected */
    .header .main_nav_item > .sub_menu {
        top: 100% !important;
    }
}

/* Smaller desktop screens */
@media (min-width: 992px) and (max-width: 1199px) {

    .header .main_nav_item > a {
        font-size: 14px !important;
        padding-left: 5px !important;
        padding-right: 5px !important;
    }

    .header .main_nav_list {
        gap: 4px !important;
    }
}
/* =========================================================
   LEFT ALIGNMENT FOR DESKTOP DROPDOWN SUBMENU TEXT
   ========================================================= */

@media (min-width: 992px) {

    /* First-level submenu */
    .header .sub_menu li a {
        display: block !important;
        width: 100% !important;
        text-align: left !important;

        padding: 12px 18px !important;
        margin: 0 !important;

        justify-content: flex-start !important;
        align-items: center !important;
        box-sizing: border-box !important;
    }

    /* Second-level submenu */
    .header .sub_sub_menu li a {
        display: block !important;
        width: 100% !important;
        text-align: left !important;

        padding: 10px 18px !important;
        margin: 0 !important;

        justify-content: flex-start !important;
        align-items: center !important;
        box-sizing: border-box !important;
    }

    /* Ensure submenu list items start from the left */
    .header .sub_menu li,
    .header .sub_sub_menu li {
        text-align: left !important;
        margin: 0 !important;
    }
}