/* ==========================================================================
   Site Header — single source of truth for header/nav styling.
   (Previously duplicated in site.css and an inline <style> in the partial.)
   ========================================================================== */

:root {
  --header-height: 76px;
  --header-height-mobile: 64px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid rgba(15, 23, 42, 0.07);
}

.header-container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 32px;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: var(--header-height);
}

/* ----- Brand ----- */
.header-brand {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  transition: opacity 0.2s ease;
}

.brand-link:hover {
  opacity: 0.8;
}

.brand-logo {
  height: 38px;
  width: auto;
  max-width: 220px;
  display: block;
}

/* ----- Desktop navigation ----- */
.main-navigation {
  display: flex;
  align-items: center;
  margin-left: auto;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-item {
  position: relative;
}

/* Clean text links — no boxes, no fills. Underline grows on hover/active. */
.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 14px;
  color: #475569;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.01em;
  white-space: nowrap;
  text-decoration: none;
  background: transparent;
  border: none;
  border-radius: 6px;
  transition: color 0.2s ease;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 2px;
  height: 2px;
  border-radius: 2px;
  background: #2563eb;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.25s ease;
}

.nav-link:hover,
.nav-link:focus-visible {
  color: #1e293b;
}

.nav-link:hover::after,
.nav-link:focus-visible::after {
  transform: scaleX(1);
}

.nav-link--active {
  color: #2563eb;
  font-weight: 600;
}

.nav-link--active::after {
  transform: scaleX(1);
}


/* ----- CTA button ----- */
.header-cta {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.cta-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.cta-button:hover,
.cta-button:focus-visible {
  color: #ffffff;
  text-decoration: none;
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
  transform: translateY(-1px);
}

.cta-text {
  white-space: nowrap;
}

.cta-icon {
  transition: transform 0.2s ease;
}

.cta-button:hover .cta-icon {
  transform: translateX(2px);
}

/* ----- Mobile toggle (hamburger) ----- */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.mobile-menu-toggle:hover {
  background: rgba(37, 99, 235, 0.06);
}

.hamburger-line {
  width: 22px;
  height: 2px;
  background: #334155;
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.2s ease;
}

.mobile-menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.mobile-menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ----- Mobile navigation panel ----- */
.mobile-navigation {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #ffffff;
  border-top: 1px solid rgba(15, 23, 42, 0.07);
  box-shadow: 0 12px 24px -8px rgba(15, 23, 42, 0.18);
}

.mobile-navigation--open {
  display: block;
}

.mobile-nav-menu {
  list-style: none;
  margin: 0;
  padding: 12px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mobile-nav-item {
  border: none;
}

.mobile-nav-link {
  display: block;
  padding: 14px 12px;
  color: #334155;
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
  border-radius: 8px;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.mobile-nav-link:hover,
.mobile-nav-link:focus-visible {
  color: #2563eb;
  background: rgba(37, 99, 235, 0.06);
  text-decoration: none;
}

.mobile-nav-link--active {
  color: #2563eb;
  font-weight: 600;
}

.mobile-nav-cta {
  margin-top: 12px;
  padding-top: 16px;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.mobile-cta-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 20px;
  color: #ffffff;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.mobile-cta-button:hover,
.mobile-cta-button:focus-visible {
  color: #ffffff;
  text-decoration: none;
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.35);
}

/* Lock body scroll while the mobile menu is open */
.mobile-menu-open {
  overflow: hidden;
}

/* ----- Responsive ----- */

/* Narrow laptops / tablets: compress the six-item horizontal nav so the full
   menu (incl. "Thought Leadership") fits without wrapping or overflowing. */
@media (max-width: 1180px) {
  .header-container {
    padding: 0 20px;
  }

  .header-content {
    gap: 10px;
  }

  .brand-logo {
    height: 34px;
    max-width: 180px;
  }

  .nav-menu {
    gap: 0;
  }

  .nav-link {
    padding: 8px 9px;
    font-size: 14px;
  }

  .nav-link::after {
    left: 9px;
    right: 9px;
  }

  .cta-button {
    padding: 10px 15px;
    font-size: 13px;
  }
}

/* Below this the six-item row can no longer fit comfortably — switch to the
   hamburger. (More menu items than before, so this kicks in earlier.) */
@media (max-width: 980px) {
  .header-content {
    height: var(--header-height-mobile);
  }

  .main-navigation,
  .header-cta {
    display: none;
  }

  .mobile-menu-toggle {
    display: flex;
  }
}

@media (max-width: 480px) {
  .header-container {
    padding: 0 16px;
  }

  .brand-logo {
    height: 32px;
    max-width: 180px;
  }
}

/* ----- Accessibility ----- */
@media (prefers-reduced-motion: reduce) {
  .nav-link,
  .nav-link::after,
  .cta-button,
  .cta-icon,
  .hamburger-line,
  .mobile-nav-link,
  .mobile-cta-button {
    transition: none;
  }
}

.nav-link:focus-visible,
.cta-button:focus-visible,
.mobile-nav-link:focus-visible,
.mobile-cta-button:focus-visible,
.mobile-menu-toggle:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}
