/* ctrl QS Nav Colour Manager - frontend styles */

/* Header layout */
#masthead {
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    z-index: 99;
}

#desktop-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 999;
    background-color: #2A0229;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: #fff;
    border-bottom: 1px solid #2A0229;
}

/* Desktop Elementor nav layout */
#masthead nav.elementor-nav-menu__container {
    display: flex;
    justify-content: flex-end;
    padding-right: 3%;
    font-weight: 500;
    letter-spacing: -0.6px;
}

#masthead nav.elementor-nav-menu__container > ul.elementor-nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

/* IMPORTANT: only top-level menu items get the 30px gap */
#masthead nav.elementor-nav-menu__container > ul.elementor-nav-menu > li.menu-item {
    margin-left: 30px;
}

/* Submenu list items must not inherit the top-level gap */
#masthead nav.elementor-nav-menu__container ul.sub-menu,
#masthead nav.elementor-nav-menu__container ul.sub-menu li,
#masthead ul.sub-menu,
#masthead ul.sub-menu li {
    margin-left: 0 !important;
    background-color: var(--cq-nav-dark, #2A0229) !important;
}

#masthead nav.elementor-nav-menu__container > ul.elementor-nav-menu > li.menu-item > a.elementor-item {
    position: relative;
    font-size: 16px;
    font-weight: 500;
    text-decoration: none !important;
    color: var(--cq-nav-colour, #CBF831) !important;
    padding: 0;
    transition: color 0.3s ease;
}

/* Top-level underline */
#masthead nav.elementor-nav-menu__container > ul.elementor-nav-menu > li.menu-item > a.elementor-item::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 15px;
    width: 100%;
    height: 2px;
    background-color: currentColor;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s ease;
}

#masthead nav.elementor-nav-menu__container > ul.elementor-nav-menu > li.menu-item > a.elementor-item:hover::after,
#masthead nav.elementor-nav-menu__container > ul.elementor-nav-menu > li.current-menu-item > a.elementor-item::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* Kill old dropdown-level underline completely */
#masthead nav.elementor-nav-menu__container ul.sub-menu::before,
#masthead nav.elementor-nav-menu__container ul.sub-menu::after,
#masthead ul.sub-menu::before,
#masthead ul.sub-menu::after {
    content: none !important;
    display: none !important;
}

/* Submenu container */
#masthead nav.elementor-nav-menu__container ul.sub-menu,
#masthead nav.elementor-nav-menu__container ul.sub-menu.elementor-nav-menu--dropdown,
#masthead .elementor-nav-menu--dropdown ul.sub-menu {
    background-color: var(--cq-nav-dark, #2A0229) !important;
    padding: 16px 28px 18px 28px !important;
    border: 0 !important;
}

/* Submenu links: inline-block means underline follows text width, not dropdown width */
#masthead nav.elementor-nav-menu__container ul.sub-menu li a.elementor-sub-item,
#masthead nav.elementor-nav-menu__container ul.sub-menu li a.elementor-sub-item:visited,
#masthead nav.elementor-nav-menu__container ul.sub-menu li a.elementor-sub-item:hover,
#masthead nav.elementor-nav-menu__container ul.sub-menu li a.elementor-sub-item:focus,
#masthead nav.elementor-nav-menu__container ul.sub-menu li a.elementor-sub-item.elementor-item-active,
#masthead a.elementor-sub-item,
#masthead a.elementor-sub-item:visited,
#masthead a.elementor-sub-item:hover,
#masthead a.elementor-sub-item:focus {
    color: var(--cq-nav-colour, #CBF831) !important;
    background-color: var(--cq-nav-dark, #2A0229) !important;
    font-size: 16px !important;
    font-weight: 500 !important;
    line-height: 1.4 !important;
    padding: 0 !important;
    margin: 0 !important;
    position: relative !important;
    display: inline-block !important;
    width: auto !important;
    max-width: none !important;
    text-decoration: none !important;
    white-space: nowrap !important;

    /* Text-width underline animation, avoids Elementor pseudo-element conflicts */
    background-image: linear-gradient(currentColor, currentColor) !important;
    background-repeat: no-repeat !important;
    background-position: 0 100% !important;
    background-size: 0 2px !important;
    transition: background-size 0.3s ease, color 0.3s ease !important;
}

#masthead nav.elementor-nav-menu__container ul.sub-menu li {
    padding: 10px 0 !important;
}

#masthead nav.elementor-nav-menu__container ul.sub-menu li a.elementor-sub-item:hover,
#masthead nav.elementor-nav-menu__container ul.sub-menu li a.elementor-sub-item:focus,
#masthead a.elementor-sub-item:hover,
#masthead a.elementor-sub-item:focus {
    background-size: 100% 2px !important;
}

/* Disable Elementor underline pseudo-elements on submenu anchors */
#masthead nav.elementor-nav-menu__container ul.sub-menu li a.elementor-sub-item::before,
#masthead nav.elementor-nav-menu__container ul.sub-menu li a.elementor-sub-item::after,
#masthead a.elementor-sub-item::before,
#masthead a.elementor-sub-item::after {
    content: none !important;
    display: none !important;
}

/* CTA is intentionally retained as its own button */
#masthead .cq-ai-cta {
    background-color: #CBF831 !important;
    color: #2A0229 !important;
}

/* Hide duplicate Elementor dropdown menu if present */
#masthead ul#menu-2-c199c59 {
    display: none;
}

@media (max-width: 1024px) {
    #masthead a.hfe-sub-menu-item {
        color: white !important;
        font-size: 29px !important;
        line-height: 33px !important;
    }

    #masthead a.hfe-menu-item {
        border: 0 !important;
    }
}
