/* ============================================================
   NexusSEO Mega Menu Navigation CSS
   All selectors scoped under #site-header to override conflicts
   ============================================================ */

/* === HEADER BASE === */
#site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid #e5e7eb;
  z-index: 1000 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

#site-header nav {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4rem;
  padding: 0 1.5rem;
  max-width: 100%;
  margin: 0 auto;
}

#site-header .logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: #0d1117;
  text-decoration: none;
  display: flex;
  align-items: center;
}

#site-header .logo span {
  color: #d97706;
}

/* === NAV LINKS === */
#site-header .nav-links {
  display: flex !important;
  align-items: center;
  gap: 2rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

#site-header .nav-links > li > a {
  color: #0d1117 !important;
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s;
}

#site-header .nav-links > li > a:hover {
  color: #0f766e;
}

/* === DROPDOWNS (About) === */
#site-header .nav-dropdown {
  position: relative;
  display: flex;
  align-items: center;
}

/* Fix About dropdown: blog-post.css forces all header ul to flex (horizontal).
   The dropdown-menu must be block (vertical list). */
#site-header .dropdown-menu {
  display: block !important;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  list-style: none;
  padding: 0.5rem 0;
  margin-top: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s;
  z-index: 1000;
}

#site-header .nav-dropdown:hover .dropdown-menu,
#site-header .nav-dropdown.is-open .dropdown-menu {
  display: block !important;
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

#site-header .dropdown-menu li a {
  display: block;
  padding: 0.75rem 1.25rem;
  color: #0d1117;
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: all 0.2s;
}

#site-header .dropdown-menu li a:hover {
  background: #f8f9fa;
  border-left-color: #0f766e;
  color: #0f766e;
  font-weight: 600;
}

/* === MEGA PANELS === */
#site-header .nav-mega {
  position: static;
}

/* Kill chevron arrows from styles.css */
#site-header .nav-dropdown > a::after {
  display: none !important;
}

/* Hover bridge: use ::before instead of ::after (::after killed above) */
#site-header .nav-dropdown > a {
  position: relative;
  padding: 1.25rem 0;
}

#site-header .nav-dropdown > a::before {
  content: '';
  position: absolute;
  left: -0.5rem;
  right: -0.5rem;
  top: 0;
  height: 4rem;
  z-index: 1;
}

#site-header .mega-panel {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  background: #ffffff;
  border-top: 2px solid #0f766e;
  border-bottom: 1px solid #e5e7eb;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.12);
  padding: 2rem 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  z-index: 999;
  pointer-events: none;
}

#site-header .nav-mega:hover .mega-panel,
#site-header .nav-mega.is-open .mega-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

/* === CONTAINER OVERRIDE === */
#site-header .mega-panel .container {
  max-width: 74rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* === MEGA GRID === */
#site-header .mega-grid {
  display: grid;
  gap: 2rem;
}

#site-header .mega-grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

#site-header .mega-grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

#site-header .mega-grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

/* === MEGA COLUMNS === */
#site-header .mega-col {
  display: flex;
  flex-direction: column;
}

#site-header .mega-col-header {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #0f766e;
  font-weight: 700;
  margin-bottom: 0.75rem;
  margin-top: 0;
  padding: 0;
}

/* === MEGA LINKS (Services) === */
#site-header .mega-link {
  display: flex;
  flex-direction: column;
  padding: 0.75rem 0.75rem;
  margin-bottom: 0.25rem;
  color: #0d1117;
  text-decoration: none;
  border-radius: 0.375rem;
  border-left: 3px solid transparent;
  transition: all 0.2s;
}

#site-header .mega-link strong {
  font-weight: 600;
  color: #0d1117;
  font-size: 0.9375rem;
}

#site-header .mega-desc {
  font-size: 0.8125rem;
  color: #4b5563;
  font-weight: 400;
  margin-top: 0.15rem;
  line-height: 1.4;
}

#site-header .mega-link:hover {
  background: #f0fdfa;
  border-left-color: #0f766e;
}

#site-header .mega-link:hover strong {
  color: #0f766e;
}

/* === LOCATION LINKS === */
#site-header .mega-col > a:not(.mega-link) {
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  color: #4b5563;
  text-decoration: none;
  border-radius: 0.375rem;
  transition: all 0.2s;
}

#site-header .mega-col > a:not(.mega-link):hover {
  color: #0f766e;
  background: #f0fdfa;
}

/* === MEGA ARTICLES === */
#site-header .mega-article {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  margin-bottom: 0.75rem;
  background: #f9fafb;
  border-radius: 0.5rem;
  text-decoration: none;
  transition: all 0.2s;
}

#site-header .mega-article:hover {
  background: #f0fdfa;
}

#site-header .mega-article strong {
  color: #0d1117;
  font-weight: 600;
  font-size: 0.9375rem;
}

#site-header .mega-article-tag {
  font-size: 0.6875rem;
  background: #f0fdfa;
  color: #0f766e;
  padding: 0.125rem 0.5rem;
  border-radius: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  align-self: flex-start;
}

/* === MEGA FOOTER === */
#site-header .mega-footer {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid #e5e7eb;
}

#site-header .mega-footer a {
  display: block;
  padding: 0.75rem;
  color: #0f766e;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.875rem;
  text-align: center;
  transition: all 0.2s;
}

#site-header .mega-footer a:hover {
  color: #115e59;
}

/* === MEGA CTA === */
#site-header .mega-cta {
  margin-top: 1rem;
}

#site-header .mega-cta .btn {
  width: 100%;
  text-align: center;
}

/* === CTA BUTTON === */
#site-header .header-cta {
  display: inline-flex !important;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1.75rem;
  background: #d97706;
  color: #fff !important;
  border-radius: 0.5rem;
  font-weight: 700;
  font-size: 0.9375rem;
  text-decoration: none;
  transition: background 0.2s;
}

#site-header .header-cta:hover {
  background: #b45309;
}

/* === MOBILE MENU BUTTON === */
#site-header .mobile-menu-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 2rem;
  height: 2rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  gap: 0.375rem;
}

#site-header .mobile-menu-btn span {
  width: 1.5rem;
  height: 2px;
  background: #0d1117;
  transition: all 0.3s;
}

#site-header .mobile-menu-btn.open span:nth-child(1) {
  transform: rotate(45deg) translateY(10px);
}

#site-header .mobile-menu-btn.open span:nth-child(2) {
  opacity: 0;
}

#site-header .mobile-menu-btn.open span:nth-child(3) {
  transform: rotate(-45deg) translateY(-10px);
}

/* ============================================================
   BLOG-POST.CSS CONFLICT OVERRIDES
   ============================================================ */

/* Override: blog-post.css "header ul { display: none }" */
#site-header .nav-links {
  display: flex !important;
  align-items: center;
  gap: 2rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

@media (max-width: 899px) {
  #site-header .nav-links {
    display: none !important;
  }
}

@media (min-width: 900px) {
  #site-header .nav-links {
    display: flex !important;
  }
  #site-header .mobile-menu-btn {
    display: none !important;
  }
}

/* Override: blog-post.css "header { z-index: 50 }" */
#site-header {
  z-index: 1000 !important;
}

/* Override: blog-post.css ".btn { display: inline-block }" breaks flex CTA */
#site-header .header-cta {
  display: inline-flex !important;
  align-items: center;
}

@media (max-width: 899px) {
  #site-header .header-cta {
    display: none !important;
  }
}

/* ============================================================
   MOBILE NAVIGATION
   ============================================================ */

#mobile-nav {
  display: none;
  position: fixed;
  top: 4rem;
  left: 0;
  right: 0;
  bottom: 0;
  background: #fff;
  z-index: 998;
  overflow-y: auto;
  padding: 1rem 1.5rem 2rem;
}

#mobile-nav.open {
  display: block;
}

#mobile-nav .mobile-accordion {
  margin-bottom: 1rem;
}

#mobile-nav .mobile-accordion-item {
  border-bottom: 1px solid #e5e7eb;
}

#mobile-nav .mobile-accordion-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 0.875rem 0;
  border: none;
  background: none;
  font-size: 1rem;
  font-weight: 600;
  color: #0d1117;
  cursor: pointer;
  transition: color 0.2s;
}

#mobile-nav .mobile-accordion-header:hover {
  color: #0f766e;
}

#mobile-nav .mobile-accordion-header::after {
  content: '▼';
  font-size: 0.6rem;
  transition: transform 0.3s;
  color: #0f766e;
}

#mobile-nav .mobile-accordion-header.active::after {
  transform: rotate(-180deg);
}

#mobile-nav .mobile-accordion-body {
  display: none;
  padding: 0.5rem 0 1rem 0.5rem;
  animation: slideDown 0.3s ease;
}

#mobile-nav .mobile-accordion-body.active {
  display: block;
}

#mobile-nav .mobile-accordion-body a {
  display: block;
  padding: 0.5rem 0;
  color: #4b5563;
  text-decoration: none;
  font-size: 0.9375rem;
  transition: color 0.2s;
}

#mobile-nav .mobile-accordion-body a:hover {
  color: #0f766e;
  font-weight: 500;
}

#mobile-nav .mobile-group-label {
  display: block;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #0f766e;
  font-weight: 700;
  margin-top: 0.75rem;
  margin-bottom: 0.25rem;
}

#mobile-nav .mobile-group-label:first-child {
  margin-top: 0;
}

#mobile-nav .mobile-view-all {
  font-weight: 600;
  color: #0f766e !important;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid #e5e7eb;
}

#mobile-nav .mobile-cta {
  display: block;
  text-align: center;
  margin-top: 1.5rem;
  padding: 0.875rem 1.75rem;
  background: #d97706;
  color: white;
  text-decoration: none;
  font-weight: 700;
  border-radius: 0.5rem;
  transition: background 0.2s;
}

#mobile-nav .mobile-cta:hover {
  background: #b45309;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================================
   MOBILE BREAKPOINTS
   ============================================================ */

@media (max-width: 899px) {
  #site-header nav {
    padding: 0 1rem;
  }

  #site-header .logo {
    font-size: 1.25rem;
  }

  #site-header .nav-links {
    display: none !important;
  }

  #site-header .header-cta {
    display: none !important;
  }

  #site-header .mobile-menu-btn {
    display: flex !important;
  }

  #site-header .mega-panel {
    position: fixed;
    top: 4rem;
    left: 0;
    right: 0;
    bottom: 0;
    border-top: none;
    border-bottom: none;
    box-shadow: none;
    padding: 0;
    background: #ffffff;
    opacity: 1;
    visibility: visible;
    transform: none;
    pointer-events: auto;
    z-index: 997;
  }
}

@media (min-width: 900px) {
  #site-header .mobile-menu-btn {
    display: none !important;
  }

  #mobile-nav {
    display: none !important;
  }
}

/* ============================================================
   ACCESSIBILITY
   ============================================================ */

#site-header a:focus,
#site-header button:focus {
  outline: 2px solid #0f766e;
  outline-offset: 2px;
}

#site-header .nav-links > li > a:focus {
  color: #0f766e;
}
