/* ==========================================================
   NSSC GLOBAL HEADER & BULLETIN BAR
   ========================================================== */

/* --- Base / Mobile Defaults (Up to 991px) --- */
#nssc-header {
  padding: 10px 0;
  margin-bottom: 0 !important;
  min-height: 80px;
  position: relative; 
}

#nssc-header .row {
  display: flex !important;
  flex-wrap: nowrap !important; 
  align-items: center !important; 
  justify-content: space-between !important;
}

.nssc-branding {
  display: flex;
  align-items: center; 
  flex: 0 0 auto !important; 
  max-width: 75%; 
}

.nssc-branding img {
  max-width: 100%; 
  max-height: 60px; 
  height: auto;
  width: auto;
}

.nssc-navigation {
  display: flex;
  flex-direction: column;
  justify-content: center; 
  align-items: flex-end;
  flex: 1 1 auto; 
  min-width: 0;
  position: static !important; 
}

.nssc-main-menu-header {
  width: 100%;
  display: flex;
  justify-content: flex-end;
  position: static !important; 
}

/* Hide Utility Menu on mobile */
.nssc-utility-menu {
  display: none !important;
}

/* --- Bootstrap Hamburger Styling (Mobile) --- */
.nssc-main-menu-header .navbar-toggler {
  display: block;
  background: transparent !important;
  border: none !important;
  padding: 8px 12px;
  margin: 0;
}

.nssc-main-menu-header .navbar-toggler:focus {
  box-shadow: none !important;
  outline: none !important;
}

/* Custom thin blue lines for the hamburger icon */
.nssc-main-menu-header .navbar-toggler-icon {
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(4, 41, 105, 1)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='round' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E") !important;
}

/* --- Base Collapse Container (Mobile Blue Bar) --- */
#nssc-mobile-menu.collapse:not(.show) {
  display: none !important; 
}

#nssc-mobile-menu.collapsing,
#nssc-mobile-menu.collapse.show {
  position: absolute !important;
  top: 100%;
  left: 0;
  width: 100vw;
  background-color: #042969;
  z-index: 1000;
  padding: 15px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
  border-top: 1px solid rgba(255,255,255,0.1);
}


/* ==========================================================
   MOBILE MENU SWAPPER & STYLING (Up to 991px)
   ========================================================== */
@media (max-width: 991px) {
  
  /* 1. HIDE TB MEGA MENU */
  #nssc-mobile-menu .tb-megamenu,
  #nssc-mobile-menu .block-tb-megamenu-block {
    display: none !important;
    height: 0 !important;
    visibility: hidden !important;
  }

  /* 2. SHOW & FORCE DISPLAY OF STANDARD MENU */
  #nssc-mobile-menu .block:not(.block-tb-megamenu-block),
  #nssc-mobile-menu nav:not(.tb-megamenu) {
    display: block !important;
    width: 100%;
  }

  /* 3. STYLE STANDARD MENU LINKS (White text on blue) */
  #nssc-mobile-menu ul {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex;
    flex-direction: column;
  }

  #nssc-mobile-menu li {
    border-bottom: 1px solid rgba(255,255,255,0.1);
  }

  #nssc-mobile-menu li:last-child {
    border-bottom: none;
  }

  /* Broad anchor catch to ensure white text regardless of Drupal classes */
  #nssc-mobile-menu a {
    color: #ffffff !important;
    font-family: 'Inter', sans-serif !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    padding: 12px 5px !important;
    display: block !important;
    text-decoration: none !important;
  }

  #nssc-mobile-menu a:hover {
    color: #953Eb5 !important;
  }

  /* Submenus in standard mobile nav */
  #nssc-mobile-menu ul ul {
    padding-left: 15px !important;
    border-top: 1px solid rgba(255,255,255,0.1);
  }
  
  #nssc-mobile-menu ul ul a {
    font-weight: 400 !important;
    font-size: 14px !important;
  }
}


/* ==========================================================
   DESKTOP ONLY OVERRIDES (992px and up)
   ========================================================== */

@media (min-width: 992px) {
  
  #nssc-header {
    min-height: 100px;
    padding: 15px 0;
  }

  /* --- Column 1: Branding --- */
  .nssc-branding {
    padding-right: 40px; 
    max-width: none;
  }

  .nssc-branding img {
    max-height: 100px; 
    max-width: 320px;  
  }

  /* --- Utility Menu --- */
  .nssc-utility-menu {
    width: 100%;
    display: flex !important; 
    justify-content: flex-end;
    margin-bottom: 12px; 
  }

  .nssc-utility-menu ul,
  .nssc-utility-menu .navbar-nav {
    display: flex !important;
    flex-direction: row !important;
    justify-content: flex-end !important;
    gap: 1.5rem !important;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .nssc-utility-menu .nav-item {
    flex: 0 0 auto !important;
  }

  .nssc-utility-menu .nav-link {
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: #006BB6;
    text-decoration: none;
    white-space: nowrap;
  }

  /* ========================================================
     DESKTOP MENU SWAPPER 
     ======================================================== */
     
  /* 1. HIDE STANDARD DRUPAL MENU ON DESKTOP */
  #nssc-mobile-menu .block:not(.block-tb-megamenu-block),
  #nssc-mobile-menu nav:not(.tb-megamenu) {
    display: none !important;
  }

  /* 2. ENSURE WRAPPER DOESNT COLLAPSE ON DESKTOP */
  #nssc-mobile-menu {
    position: static !important;
    background: transparent !important;
    padding: 0 !important;
    box-shadow: none !important;
    width: auto !important;
    border-top: none !important;
    display: flex !important; 
  }

  /* Hide the Bootstrap Hamburger Toggle on Desktop */
  .nssc-main-menu-header .navbar-toggler { 
    display: none !important; 
  }

  /* Restore TB Mega Menu Carets on Desktop */
  .nssc-main-menu-header .tbm-caret,
  .nssc-main-menu-header .caret {
    display: inline-block !important;
  }

  /* Reset Desktop Collapses & Wrappers */
  .nssc-main-menu-header .tbm-collapse,
  .nssc-main-menu-header .tbm-nav,
  .nssc-main-menu-header .tbm-item {
    background-color: transparent !important;
  }

  .nssc-main-menu-header .tbm-collapse {
    position: static !important;
    border: none !important;
    box-shadow: none !important;
    margin: 0 !important;
    padding: 0 !important;
    width: auto !important;
  }

  /* Horizontal Top-Level Navigation */
  .nssc-main-menu-header .tbm-nav {
    display: flex !important; 
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 0 !important;
    align-items: center !important;
  }

  .nssc-main-menu-header .tbm-nav > li {
    border: none !important;
    flex: 0 0 auto !important;
    width: auto !important; 
  }

  /* Desktop Top-Level Links (Blue text on the white header) */
  .nssc-main-menu-header .tbm-link.level-1 {
    color: #042969 !important;
    font-family: 'Inter', sans-serif !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    line-height: 1.1 !important;
    min-height: 44px !important; 
    padding: 0 0.75rem !important; 
    margin: 0 !important;
    white-space: normal !important; 
    text-align: left !important;
    text-decoration: none !important;
  }
  
  .nssc-main-menu-header .tbm-item.level-1:hover > .tbm-link-container .tbm-link,
  .nssc-main-menu-header .tbm-item.level-1.active > .tbm-link-container .tbm-link {
    color: #953Eb5 !important;
  }

  .tbm-link.level-1:hover, .tbm-link.level-1:focus {
    background-color: #ffffff !important;
  }

  /* Breakout ALL parent containers so the submenu breaks out to the full header */
  #nssc-header .row,
  .nssc-navigation,
  .nssc-main-menu-header,
  .nssc-main-menu-header .contextual-region,
  .nssc-main-menu-header .block__content,
  .nssc-main-menu-header .tbm,
  .nssc-main-menu-header .tbm-item.level-1 {
    position: static !important;
  }

  /* The Dropdown Container (Dark Blue Tray) */
  .tbm-nssc-mega-menu .tbm-submenu {
    background-color: #042969 !important;
    border-radius: 0 0 25px 25px !important;
    padding: 30px !important; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.15) !important;
    margin-top: -8px !important; 
    position: absolute !important;
    width: 100vw !important; 
    max-width: 1200px !important; 
    left: 50% !important;
    transform: translateX(-50%) !important; 
  }

  .tbm-nssc-mega-menu .tbm-submenu::before {
    content: "";
    position: absolute;
    top: -20px; 
    left: 0;
    right: 0;
    height: 20px;
    background: transparent;
    display: block !important;
  }

  /* Specific Widths for Top-Level Wrapping */
  .nssc-main-menu-header .tbm-item:nth-child(1) .tbm-link { width: 104px !important; }
  .nssc-main-menu-header .tbm-item:nth-child(2) .tbm-link { width: 124px !important; }
  .nssc-main-menu-header .tbm-item:nth-child(3) .tbm-link { width: 134px !important; }
  .nssc-main-menu-header .tbm-item:nth-child(4) .tbm-link { width: 114px !important;  }
  .nssc-main-menu-header .tbm-item:nth-child(5) .tbm-link { width: 204px !important; }
  .nssc-main-menu-header .tbm-item:nth-child(6) .tbm-link { width: 164px !important; }
  .nssc-main-menu-header .tbm-item:nth-child(7) .tbm-link { width: 124px !important; }
}


/* ==========================================================
   MEGA MENU SUBMENU STYLES (Applies to Desktop)
   ========================================================== */

/* Submenu Links (White text on dark blue) */
.tbm-nssc-mega-menu .tbm-submenu .tbm-link {
  color: #ffffff !important;
  font-weight: 400 !important;
  font-size: 14px !important;
  padding: 8px 0 !important;
  text-decoration: none !important;
  line-height: 1.5rem !important;
}

.tbm-nssc-mega-menu .tbm-submenu .tbm-link:hover {
  text-decoration: underline !important;
}

/* Override uppercase on group titles */
.tbm-group-title{
  text-transform: none !important;
  color: #ffffff !important;
}

/* Override default subsubmenu border */
.tbm-group-container{
  border: 0 !important;
}

.tbm-subnav>.tbm-item>.tbm-link-container>.tbm-link.no-link{
  color: #ffffff !important;
  text-transform: uppercase !important;
}

/* Target only the direct link (the heading) inside your custom class */
.p5-mm-heading > .tbm-link-container > .tbm-link {
  text-transform: uppercase !important;
  font-weight: 600 !important; 
  letter-spacing: 0.1em;      
}

/* Ensure the sub-navigation links remain in their normal case */
.p5-mm-heading .tbm-subnav .tbm-link {
  text-transform: none !important;
}

.p5-mm-level3 {
  margin-left: 15px !important;
  padding-left: 5px !important;
}

/* Create the horizontal line below the mega menu headings */
.p5-mm-heading > .tbm-link-container {
  position: relative;
  margin-bottom: 15px !important; 
}

.p5-mm-heading > .tbm-link-container::after {
  content: "";
  position: absolute;
  bottom: -8px; 
  left: 0;
  width: 100%; 
  height: 1px; 
  background-color: #ffffff; 
  opacity: 0.8; 
}

/* Ensure the Level 2 links (headings) have breathing room from the line */
.p5-mm-heading > .tbm-link-container .tbm-link {
  padding-bottom: 5px !important;
  display: block !important;
}

/* Adjust spacing for the level 3 items starting below the line */
.p5-mm-heading .tbm-subnav {
  margin-top: 10px !important;
}

/* Add spacing between the 4 columns */
.tbm-nssc-mega-menu .tbm-column {
  padding-left: 25px !important;
  padding-right: 25px !important;
  box-sizing: border-box !important;
}

/* Remove padding on the far left and right edges to stay aligned */
.tbm-nssc-mega-menu .tbm-row > .tbm-column:first-child {
  padding-left: 0 !important;
}

.tbm-nssc-mega-menu .tbm-row > .tbm-column:last-child {
  padding-right: 0 !important;
}

.p5-mm-resources{
  margin-top: 40px;
}


/* ==========================================================
   BULLETIN BAR
   ========================================================== */

#nssc-bulletin {
  background-color: #042969;
  color: #ffffff;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
}

/* Align left and top by default (mobile) */
.nssc-bulletin-left {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
}

/* Strip forced flex/centering off the p tag to let text flow naturally */
.nssc-bulletin-left p {
  margin-bottom: 0 !important;
}

#nssc-bulletin a {
  color: #ffffff;
  font-weight: 600;
  text-decoration: none;
}

/* Snap back to fixed height and vertical center on Desktop */
@media (min-width: 992px) {
  #nssc-bulletin,
  #nssc-bulletin .container {
    min-height: 67px;
  }
  
  .nssc-bulletin-left {
    align-items: center;
  }

  /* Centering/spacing for the right side bulletin items on desktop */
  #nssc-bulletin .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
}