/* =========================================================
   HEADER & LOGO
   ========================================================= */
.nav-header-text span {
  padding: 0;
}

.nav-header-text img {
  width: 55px;
  height: 50px;
  vertical-align: middle;
  margin-right: 8px;
}

#header, #header1 {
  background-color: #fff;
  box-shadow: 0 0 0.125em 0 rgba(0,0,0,0.35);
  font-family: "Raleway", Helvetica, sans-serif;
  font-weight: 500;
  left: 0;
  line-height: 3.5em;
  position: fixed;
  text-transform: uppercase;
  top: 0;
  width: 100%;
  z-index: 20000;
}

#header { height: 3.5em; overflow: visible; }
#header1 { height: 6.5em; }

#header h1 {
  height: inherit;
  left: 1.5em;
  line-height: inherit;
  margin: 0;
  position: absolute;
  top: 0;
}

#header h1 a { color: inherit; text-decoration: none; }
#header h1 a span { font-weight: 500; }

#header + #banner { margin-top: -3.5em; }

/* Reveal animation */
#header.reveal { animation: reveal-header 0.5s ease; }

/* Alt header (transparent) */
#header.alt {
  background-color: transparent;
  box-shadow: none;
  color: #fff;
  overflow: visible;
  position: absolute;
  top: 1.5em;
}

#header.alt h1 { left: 2.5em; }
#header.alt .navPanelToggle { color: #fff; }

#header.alt a,
#header.alt strong,
#header.alt b,
#header.alt h1,
#header.alt h2,
#header.alt h3,
#header.alt h4,
#header.alt h5,
#header.alt h6 {
  color: #fff;
}

@media screen and (max-width:1280px) {
  #header.alt { top:0.75em; }
  #header.alt h1 { left:1.5em; }
  .nav-header-text { font-size:75%; }
}

/* =========================================================
   MAIN NAVIGATION (TOP LEVEL)
   ========================================================= */
#header nav {
  height: inherit;
  line-height: inherit;
  position: absolute;
  right: 1.5em;
  top: 0;
  z-index: 20002;
}

#header nav > ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

#header nav > ul > li {
  display: inline-block;
  margin-left: 2em;
  position: relative;
  z-index: 20001;
}

#header nav > ul > li:first-child { margin-left: 0; }

#header nav > ul > li > a {
  text-decoration: none;
  border-bottom: 0;
  color: #142236;
  font-weight: 600;
  font-size: 0.95em;
  transition: color 0.2s ease;
}

#header nav > ul > li > a:hover {
  color: #2c7cf0;
}

/* Alt header color adjustments */
#header.alt nav > ul > li > a {
  color: #fff;
}
#header.alt nav > ul > li > a:hover {
  color: #9ec3ff;
}

/* =========================================================
   MEGA MENU WRAPPER
   ========================================================= */
#nav .has-mega {
  position: static;
}

#nav .has-mega > a {
  cursor: pointer;
}

/* Full-width mega dropdown */
#nav .mega-menu {
  display: none;
  position: fixed; /* key change */
  left: 0;
  top: 3.5em; /* aligns directly under the header */
  width: 100vw;
  background: #fff;
  padding: 2.5rem 5%;
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
  z-index: 30000;
  border-top: 1px solid rgba(0,0,0,0.05);
}

#header.alt #nav .mega-menu {
  top: calc(3.5em + 1.5em); /* push down a bit more if your alt header sits lower */
}

#header.alt #nav .mega-menu {
  background: rgba(20, 34, 54, .88);
  color: #f1f5fb;
  box-shadow: 0 6px 20px rgba(0,0,0,0.35);
}

#nav li.active > .mega-menu {
  display: grid;
}

/* Responsive grid layout */
#nav .mega-menu {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2.5rem;
}

/* =========================================================
   MEGA MENU - SECTION HEADER / MAIN LINK
   ========================================================= */
#nav .mega-menu h2 {
  grid-column: 1 / -1; /* full width */
  margin: 0 0 1.5rem 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: #142236;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  border-bottom: 1px solid rgba(0,0,0,0.1);
  padding-bottom: 0.75rem;
}

#nav .mega-menu h2 .btn {
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  padding: 0.5em 1.25em;
  border-radius: 2em;
  background-color: #198754; /* Bootstrap success color */
  color: #fff;
  text-decoration: none;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

#nav .mega-menu h2 .btn:hover {
  background-color: #157347;
  transform: translateY(-1px);
}

#header.alt #nav .mega-menu h2 {
  color: #f1f5fb;
  border-color: rgba(255,255,255,0.15);
}


/* Column titles */
#nav .mega-col h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: #142236;
}

#header.alt #nav .mega-col h3 {
  color: #f1f5fb;
}

/* Column links */
#nav .mega-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

#nav .mega-col ul li {
  margin-bottom: 0.4rem;
}

#nav .mega-col ul li a {
  color: #000;
  text-decoration: none;
  font-size: 0.93em;
  line-height: 1.5;
  display: inline-block;
  transition: color 0.2s ease;
}

#nav .mega-col ul li a:hover {
  color: #2c7cf0;
}

#header.alt #nav .mega-col ul li a {
  color: #f1f5fb;
}
#header.alt #nav .mega-col ul li a:hover {
  color: #9ec3ff;
}

/* Smooth fade */
#nav .mega-menu {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
#nav li.active > .mega-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* =========================================================
   MOBILE MENU
   ========================================================= */
#header .navPanelToggle {
  text-decoration: none;
  border: 0;
  height: 4em;
  width: 5em;
  position: absolute;
  right: 0;
  top: 0;
  display: none;
  align-items: center;
  justify-content: center;
  color: inherit;
}
#header .navPanelToggle .navPanelToggle-icon {
  font-size: 1.75rem;
  line-height: 1;
}

#navPanel {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  height: 100vh;
  background-color: #fff;
  overflow-y: auto;
  z-index: 99999 !important;
  transform: translateX(100%);
  transition: transform 0.3s ease;
}
#navPanel.visible {
  transform: translateX(0);
}
body.nav-open {
  overflow: hidden;
}

#navPanel nav { padding: 3em 2em; }

#navPanel .link {
  border: 0;
  border-top: solid 1px #e6e6e6;
  color: inherit !important;
  display: block;
  font-size: 0.9em;
  padding: 0.75em 0;
  text-decoration: none;
}
#navPanel .link:first-child { border-top: 0; }
#navPanel .link.depth-0 { font-weight: 700; }

#navPanel .close {
  border: 0;
  color: #444;
  cursor: pointer;
  position: absolute;
  right: 0;
  top: 0;
  width: 5em;
  height: 4em;
  text-align: right;
  padding-right: 1.25em;
}
#navPanel .close:before {
  content: '\f00d';
  font-family: FontAwesome;
  position: absolute;
  right: 0;
  top: 0;
  width: 3em;
  height: 3em;
  line-height: 3em;
  text-align: center;
}

@media screen and (max-width: 980px) {
  #header nav { display: none; }
  #header .navPanelToggle { display: flex; }
  #header.alt { top: 0; }
  #navPanel { display: block; }
}

@media screen and (max-width: 736px) {
  #header { height: 4em; line-height: 3em; }
  #header h1 { left: 1em !important; }
  #header h1 a { font-size: 0.9em; }
  #navPanel nav { padding: 2.25em 1.25em; }
  #navPanel .close { height: 4em; line-height: 4em; }
  #navPanel ul, #navPanel li, #navPanel nav ul, #navPanel nav li {
    list-style: none !important;
    margin-left: 0;
    padding-left: 0;
  }
  #navPanel a {
    display: block;
    text-decoration: none;
    border-bottom: none;
    padding: 0.75em 0;
  }
  #navPanel ul ul { padding-left: 1em; border: none; }
}

