/* ==========================================================================
   Desktop Header & Navigation Styles
   ========================================================================== */
.site-header {
  background-color: var(--secondary-color);
  padding: 1rem 2rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  position: sticky;
  top: 0;
  z-index: 1001;
  transition: background-color 0.3s ease;
  overflow-x: clip;
}
.site-header.is-scrolled {
  background-color: rgba(26, 34, 56, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom-color: rgba(255, 255, 255, 0.05);
}
.site-header .header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 62px;
  max-width: 1400px;
  margin: 0 auto;
}
.header-col {
  flex: 1;
}
.nav-left {
  display: flex;
  justify-content: flex-end;
}
.nav-right {
  display: flex;
  justify-content: flex-start;
}
.main-navigation > ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 3rem;
}
.main-navigation a {
  color: var(--text-color);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 1.4rem;
  position: relative;
  padding: 1rem 0;
  transition: color 0.3s ease;
}
.main-navigation a:hover {
  color: var(--accent-color);
}
.main-navigation a::after {
  content: "";
  position: absolute;
  bottom: 10px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--primary-color);
  transition: width 0.3s ease;
}
.main-navigation a:hover::after {
  width: 100%;
}
.site-branding {
  text-align: center;
  flex: 0 0 auto;
  padding: 0 4rem;
}
.site-branding img {
  height: 52px;
  width: auto;
  display: block;
}
.site-branding .mobile-logo {
  display: none;
}
.menu-item-has-children {
  position: relative;
}
.mega-menu-wrapper {
  position: absolute;
  top: calc(100% + 5px);
  left: 50%;
  width: 260px;
  transform: translateX(-50%) translateY(-10px) scale(0.98);
  background-color: #1f2a45;
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform-origin: top center;
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0s 0.3s;
}
.menu-item-has-children:hover > .mega-menu-wrapper,
.menu-item-has-children:focus-within > .mega-menu-wrapper {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0) scale(1);
  transition-delay: 0s;
}
.mega-menu-pointer {
  position: absolute;
  top: -5px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 10px;
  height: 10px;
  background-color: #1f2a45;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.mega-menu-content {
  padding: 1.5rem;
}
.services-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}
.core-pillar-item {
  position: relative;
}
.services-grid li a {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.8rem;
  padding: 1rem 1.4rem 1rem 1rem;
  border-radius: 8px;
  font-size: 1.4rem;
  text-align: left;
  text-transform: none;
  font-weight: 500;
  color: var(--text-color);
  transition: background-color 0.2s ease, color 0.2s ease;
  background: none;
}
.services-grid li a:hover,
.services-grid li a:focus {
  background-color: rgba(245, 197, 24, 0.06);
  color: var(--accent-color);
}
.services-grid li i {
  font-size: 1.6rem;
  width: 22px;
  min-width: 22px;
  text-align: center;
  color: var(--primary-color);
  transition: color 0.2s ease;
}
.services-grid li a:hover i,
.services-grid li a:focus i {
  color: var(--accent-color);
}

/* --- Bucketed Services (left-panel) --- */
.bucketed-services-panel {
  display: none;
  position: absolute;
  top: 0;
  right: 100%;
  width: 240px;
  min-width: 210px;
  z-index: 2;
  background: #232d47;
  border-radius: 10px 0 0 10px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.18);
  padding: 1.2rem 1rem;
  transition: opacity 0.3s;
}
.core-pillar-item:hover > .bucketed-services-panel,
.core-pillar-item:focus-within > .bucketed-services-panel {
  display: block;
}
.bucketed-services-panel ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.bucketed-services-panel li a {
  display: block;
  padding: 0.85rem 0.5rem;
  color: #f1f1f1;
  text-decoration: none;
  font-weight: 500;
  border-radius: 6px;
  text-align: left;
  font-size: 1.4rem;
  transition: background 0.2s, color 0.2s;
}
.bucketed-services-panel li a:hover,
.bucketed-services-panel li a:focus {
  color: var(--accent-color);
  background: rgba(245, 197, 24, 0.04);
}

/* ==========================================================================
                      Mobile Element Base Styles (Hidden on Desktop)
                      ========================================================================== */
.mobile-controls,
#mobile-menu-overlay,
.back-button {
  display: none;
}

/* ==========================================================================
                      Responsive Styles for Mobile
                      ========================================================================== */
@media (max-width: 1024px) {
  .main-navigation,
  .site-branding .desktop-logo {
    display: none;
  }
  .site-branding .mobile-logo {
    display: block;
  }
  .site-header .header-inner {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    padding: 0 1rem;
  }
  .header-col.nav-left {
    justify-content: flex-start;
  }
  .header-col.nav-right {
    justify-content: flex-end;
  }
  .site-branding {
    padding: 0;
  }
	.site-branding img {
	  height: 40px;
	}
  .mobile-controls {
    display: flex;
  }
  .mobile-controls button {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 2.2rem;
    padding: 1rem;
    line-height: 1;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  #mobile-menu-close {
    display: none;
  }
  html.mobile-menu-open #mobile-menu-toggle {
    display: none;
  }
  html.mobile-menu-open #mobile-menu-close {
    display: flex;
  }

  /* --- Mobile Overlay Header --- */
  .mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 62px;
    z-index: 1100;
    background: var(--secondary-color);
    padding: 0 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  }
  .mobile-controls button,
  .back-button {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 2.2rem;
    padding: 1rem;
    line-height: 1;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .back-button {
    display: flex;
    visibility: hidden;
  }
  html.show-submenu .back-button {
    visibility: visible;
  }
  .mobile-logo-link {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* --- MOBILE OVERLAY --- */
  html.mobile-menu-open {
    overflow: hidden;
  }
  #mobile-menu-overlay {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: var(--secondary-color);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0s 0.3s;
  }
  html.mobile-menu-open #mobile-menu-overlay {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition-delay: 0s;
  }
  .mobile-menu-panels-container {
    position: relative;
    width: 100%;
    height: 100%;
  }
  .mobile-menu-panel {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--secondary-color);
    z-index: 1;
    padding-top: 62px;
    overflow-y: auto;
    transition: left 0.3s;
  }
  .mobile-menu-panel.active {
    display: block;
    z-index: 2;
  }
  .has-submenu a .fa-chevron-right {
    margin-left: auto;
    font-size: 1.4rem;
    opacity: 0.5;
    transition: color 0.2s ease;
  }

  /* --- Mobile Menu Layers --- */
  .main-menu-list {
    list-style: none;
    margin: 0;
    padding: 0 2rem 3rem;
  }
  .core-pillar-list {
    list-style: none;
    margin: 0;
    padding: 0 2rem 3rem;
  }
  .bucketed-services-list {
    list-style: none;
    margin: 0;
    padding: 0 2rem 3rem;
    display: none;
    background: transparent;
  }

  /* Shared styles for all three layers */
  .main-menu-list li a,
  .core-pillar-list li a,
  .bucketed-services-list li a {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    padding: 1.4rem 0;
    font-size: 1.7rem;
    font-weight: 600;
    color: var(--text-color);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    width: 100%;
    text-transform: none;
    background: none;
    transition: color 0.2s;
  }
  .main-menu-list li a i,
  .core-pillar-list li a i,
  .bucketed-services-list li a i {
    font-size: 1.7rem;
    width: 24px;
    min-width: 24px;
    text-align: center;
    color: var(--primary-color);
    transition: color 0.2s;
  }
  .main-menu-list li a:hover,
  .core-pillar-list li a:hover,
  .bucketed-services-list li a:hover {
    color: var(--accent-color);
  }
  .main-menu-list li a:hover i,
  .core-pillar-list li a:hover i,
  .bucketed-services-list li a:hover i {
    color: var(--accent-color);
  }
  
  /* ================================================= */
  /* == START: UPDATED AND NEW STYLES FOR MOBILE MENU == */
  /* ================================================= */

  /* The <li> becomes the flex container and gets the bottom border */
  .core-pillar-list li.has-submenu {
      display: flex;
      align-items: center;
      justify-content: space-between;
      border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  /* The <a> tag inside no longer needs its own border */
  .core-pillar-list li.has-submenu > a {
      flex-grow: 1; /* Allows the link to take up the available space */
      border-bottom: none;
      padding-right: 1rem; /* Add some space between text and button */
  }

  /* This styles the new <button> that triggers the submenu */
  .core-pillar-list li.has-submenu button.open-bucketed-services {
      background: transparent;
      border: none;
      color: inherit;
      cursor: pointer;
      padding: 1.4rem 1rem;
      margin-right: -1rem; /* Aligns arrow nicely to the right edge */
      line-height: 1;
  }

  /* This styles the chevron icon inside the new button */
  .core-pillar-list li.has-submenu button.open-bucketed-services .fa-chevron-right {
      font-size: 1.4rem;
      opacity: 0.5;
      color: var(--text-color);
      transition: color 0.2s ease;
  }

  .core-pillar-list li.has-submenu button.open-bucketed-services:hover .fa-chevron-right {
      color: var(--accent-color);
  }

  /* We override the generic border rule for the main-menu list items that are NOT submenus */
  .main-menu-list > li:not(.has-submenu) > a {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }
}