/**
 * Custom styles for the Our Mega Menu plugin.
 */
/**
 * CCSU Bootstrap Mega Menu Plugin Styles
 * HYBRID SUPPORT: Bootstrap 4 & Bootstrap 5
 */
/** ON 1/8/26, MOVED FROM THEME'S CSS/CUSTOM-NAVBAR.CSS */
/* ==========================================================================
   4. MEGA MENU BACKGROUND For CCSU
   ========================================================================== */

/* 1. Reset the parent container anchor */
#secondNav .container { 
    position: static !important; 
}
/* 2. Breakout to Viewport Width WORKED BUT MEGA MENU STYLING IS ALSO IN THE PLUGINS/MEGA-MENU/ASSETS/CSS, SO COMMENT & TEST */
/*.dropdown-menu.mega-menu {
    position: absolute;
    width: 100vw !important;  /* Match Viewport Width */
/*    left: 0 !important;       /* Align to the very left edge of the screen */
/*   margin-top: 0;            /* Flush with the white navbar */
/* background-color: #072141;
    background-image: url('https://www.ccsu.edu/themes/custom/ccsu_main/assets/images/dark-blue-pattren.jpg');
    background-repeat: repeat;
    padding: 2.5rem 0;
    border: none;
    border-radius: 0;   
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    z-index: 9999 !important; /* Higher than the stuck utility bar */
/* } */

/* 3. The Content Container (The "Invisble Box" that holds the links) */
/* We target the direct child (your wp-block-columns) to align with the site content */
.dropdown-menu.mega-menu > .is-layout-flex,
.dropdown-menu.mega-menu > div:first-child {
    max-width: 1320px;       /* Match your header.php container width */
    margin: 0 auto !important; /* Centering the links */
    padding: 0 1.5rem;        /* Gutter spacing */
    display: flex;            /* Ensure columns behave correctly */
    justify-content: space-between;
}

/* Triangle Arrow Pointer */
@media (min-width: 992px) {
   #menu-secondary-top-nav-bar > .nav-item.show > a.nav-link::after{
        content: "";
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        bottom: -1px;
        width: 0; height: 0;
        border-left: 15px solid transparent;
        border-right: 15px solid transparent;
        border-bottom: 15px solid yellow; /* WAS 205898, FLIPPED */
        z-index: 20000;
    }
    .secondary-nav-bar .dropdown-toggle::after { display: none !important; }
}
/* 1. LAYOUT: FULL-WIDTH BREAKOUT (BS4 & BS5) */

/* BS4/Legacy Theme Target */
.navbar .nav-item.position-static .dropdown-menu.mega-menu {
    width: 100%;
    left: 0;
    right: 0;
    margin-top: 0;
    border-radius: 0;
}

/* BS5/New Theme Target */
#secondNav .container {
    position: static !important; 
}

.secondary-nav-bar .dropdown-menu.mega-menu{
    width: 100vw !important;
    left: 0 !important;
    right: 0 !important;
    margin-top: 0;
    padding: 2.5rem 0;
    border: none;
    border-radius: 0;
    box-shadow: 0 10px 15px rgba(0,0,0,0.2);
    z-index: 3000 !important;
    /* Background Pattern Branding */
    background-color: #072141 !important; 
    background-image: url('https://www.ccsu.edu/themes/custom/ccsu_main/assets/images/dark-blue-pattren.jpg') !important;
    background-repeat: repeat !important;
    background-size: auto !important;
}

/* 2. CONTENT STYLING */
.mega-menu .container {
    max-width: 100%;
}

.mega-menu > *:not(.alignfull) {
    max-width: 1140px; 
    margin-left: auto;
    margin-right: auto;
    padding-left: 15px;
    padding-right: 15px;
}

/* Typography */
.mega-menu h1, .mega-menu h2, .mega-menu h3, 
.mega-menu h4, .mega-menu h5, .mega-menu h6 {
    color: #ffffff; 
    margin-bottom: 1rem;
}

.mega-menu h2.wp-block-heading {
    font-size: 1.25rem;
    font-weight: 700;
    border-bottom: 2px solid rgba(255,255,255,0.2);
    padding-bottom: 0.5rem;
    text-transform: uppercase;
}

.mega-menu ul.wp-block-list {
    list-style: none;
    padding-left: 0;
}

.mega-menu ul.wp-block-list li a {
    color: rgba(255,255,255,0.9) !important;
    text-decoration: none;
    display: block;
    padding: 4px 0;
    transition: color 0.2s ease;
}

.mega-menu ul.wp-block-list li a:hover {
    color: #ffffff !important;
    text-decoration: underline;
}
/* for drop down showing - make sure random links in blocks used to populate are not default link bright blue, but high contrast color */
/* High contrast links for the active Mega Menu */
.dropdown-menu.mega-menu.show a {
    color: #ffffff !important; /* Use !important only if Bootstrap's utility classes are fighting you */
    /* text-decoration: underline; /* Good for accessibility to distinguish links from text */
}

/* Ensure they remain visible and clear on hover */
.dropdown-menu.mega-menu.show a:hover,
.dropdown-menu.mega-menu.show a:focus {
    color: #f8f9fa; 
    text-decoration: none;
    background-color: rgba(255, 255, 255, 0.1); /* Subtle highlight for better UX */
}
.dropdown-menu.mega-menu.show a::after {
    content: ' ›'; /* Subtle breadcrumb style arrow */
    opacity: 0.5;
    margin-left: 5px;
    transition: opacity 0.2s;
}

.dropdown-menu.mega-menu.show a:hover::after {
    opacity: 1;
    color: #ffc107;
}

/* 3. THE LARGE WHITE BRIDGE ARROW (BS5 Focus)  */

@media (min-width: 992px) {
    /* 1. Force the parent containers to allow the triangle to hang out */
    #secondNav, 
    #secondaryNavbarCollapse, 
    .secondary-nav-bar .container,
    #menu-secondary-top-nav-bar {
        overflow: visible !important;
    }

    /* 2. Position the anchor relative to the whole bar height */
    #menu-secondary-top-nav-bar .nav-item,
    #menu-secondary-top-nav-bar .nav-link.show {
        position: relative !important;
    }

    /* 3. The Triangle Pointer */
    #menu-secondary-top-nav-bar .nav-link.dropdown-toggle.show::after {
        content: "" !important;
        position: absolute !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        
        /* ADJUST THIS VALUE: 
           If your navbar is 80px tall, 80px will put the triangle 
           exactly at the seam. Use 79px to overlap slightly. */
        top: 60px !important; 
        
        /* Triangle Geometry */
        width: 0 !important;
        height: 0 !important;
        border-left: 20px solid transparent !important;
        border-right: 20px solid transparent !important;
        
        /* Pointing DOWN into the menu */
        border-top: 20px solid #ffffff !important; 
        
        /* High Z-index to ensure it sits ON TOP of the mega menu edge */
        z-index: 10001 !important;
        display: block !important;
        visibility: visible !important;
    }
}