/* Navigation Styles - We Move Together */

/* Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--color-white);
  border-bottom: 1px solid var(--color-gray-300);
  height: var(--nav-height);
  z-index: 1000;
  transition: all var(--transition-fast);
  overflow: hidden;
  max-width: 100%;
}

.site-header.sticky {
  box-shadow: var(--shadow-sticky);
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: 12px; /* Ensure spacing between logo, button, and hamburger */
  max-width: 100%;
  overflow: hidden;
}

/* Mobile: Optimize spacing for logo, Free signup, and hamburger */
@media (max-width: 809px) {
  .header-container {
    gap: 8px; /* Tighter but sufficient spacing on mobile */
    padding: 0 16px; /* Add horizontal padding for breathing room */
  }
}

/* Very small screens: Minimal but adequate spacing */
@media (max-width: 389px) {
  .header-container {
    gap: 6px;
    padding: 0 12px;
  }
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.logo img {
  height: 40px;
  width: auto;
}

/* Mobile: Increase logo size significantly for better visibility */
@media (max-width: 809px) {
  .logo img {
    height: 56px; /* Increased for better mobile visibility - gives ~100px width */
  }
}

/* Very small screens: Slightly smaller but still prominent */
@media (max-width: 389px) {
  .logo img {
    height: 44px; /* Still much larger than old 32px */
  }
}

/* Desktop Navigation - Hidden on mobile, shown on desktop */
.main-nav {
  display: none !important;
  overflow: hidden;
}

@media (max-width: 767px) {
  .main-nav {
    display: none !important;
    visibility: hidden;
    width: 0;
    height: 0;
    overflow: hidden;
  }
  .site-header .header-container {
    overflow: hidden;
    max-width: 100vw;
  }
}

@media (min-width: 768px) {
  .main-nav {
    display: flex !important;
    align-items: center;
    overflow: hidden;
    visibility: visible;
    width: auto;
    height: auto;
  }
}

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

.nav-link {
  font-size: 14px;
  font-weight: var(--font-weight-medium);
  color: var(--color-navy);
  text-decoration: none;
  transition: all var(--transition-fast);
  padding: 12px 4px;
  min-height: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  border-bottom: 3px solid transparent;
  box-sizing: border-box;
  white-space: nowrap;
}

/* Tighter nav at medium screens */
@media (min-width: 768px) and (max-width: 1100px) {
  .nav-link {
    font-size: 12px;
    padding: 12px 2px;
  }
  .nav-list {
    gap: 6px;
  }
}

/* Comfortable spacing on large screens */
@media (min-width: 1101px) {
  .nav-list {
    gap: 16px;
  }
  .nav-link {
    font-size: 15px;
    padding: 12px 6px;
  }
}

.nav-link:hover {
  color: var(--color-teal);
}

.nav-link.active {
  color: var(--color-teal);
  border-bottom-color: var(--color-teal);
}

.nav-link:focus {
  outline: 2px solid var(--color-teal);
  outline-offset: 2px;
  border-radius: 4px;
}

.nav-cta {
  margin-left: var(--space-4);
}

/* Mobile: Optimize "Free signup" button for mobile header */
@media (max-width: 809px) {
  .nav-cta {
    margin-left: 0; /* Remove left margin on mobile */
    padding: 10px 16px; /* Compact but tappable */
    font-size: 14px; /* Slightly smaller text on mobile */
    white-space: nowrap; /* Prevent text wrapping */
    min-height: 44px; /* Ensure minimum touch target */
    display: flex;
    align-items: center;
    gap: 6px; /* Space between text and icon */
  }
  
  /* Make icon slightly smaller on mobile */
  .nav-cta .btn-icon {
    width: 16px;
    height: 16px;
  }
}

/* Very small screens: Further optimization */
@media (max-width: 389px) {
  .nav-cta {
    padding: 8px 12px;
    font-size: 13px;
  }
}

/* Hamburger Menu - Enhanced for mobile visibility */
.hamburger {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  background: rgba(26, 54, 93, 0.1); /* More visible navy background */
  border: 2px solid rgba(26, 54, 93, 0.2); /* More prominent border */
  border-radius: 8px;
  cursor: pointer;
  padding: 0;
  transition: all var(--transition-fast);
}

.hamburger:hover {
  background: rgba(26, 54, 93, 0.1);
  border-color: rgba(26, 54, 93, 0.25);
  transform: scale(1.05);
}

.hamburger:active {
  transform: scale(0.98);
}

@media (min-width: 768px) {
  .hamburger {
    display: none;
  }
  /* Hide mobile nav menu at desktop widths */
  .mobile-nav-menu {
    display: none;
  }
}

/* Larger, more prominent hamburger icon */
.hamburger-icon {
  width: 36px; /* Increased for better mobile visibility */
  height: 4px; /* Increased for better visibility */
  background: var(--color-navy);
  position: relative;
  transition: all var(--transition-fast);
}

.hamburger-icon::before,
.hamburger-icon::after {
  content: '';
  position: absolute;
  width: 36px; /* Increased for better mobile visibility */
  height: 4px; /* Increased for better visibility */
  background: var(--color-navy);
  transition: all var(--transition-fast);
}

.hamburger-icon::before {
  top: -10px; /* Increased spacing from -8px */
}

.hamburger-icon::after {
  bottom: -10px; /* Increased spacing from -8px */
}

.hamburger[aria-expanded="true"] .hamburger-icon {
  background: transparent;
}

.hamburger[aria-expanded="true"] .hamburger-icon::before {
  transform: rotate(45deg);
  top: 0;
}

.hamburger[aria-expanded="true"] .hamburger-icon::after {
  transform: rotate(-45deg);
  bottom: 0;
}

/* Mobile Menu */
.mobile-menu {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(26, 54, 93, 0.98);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-base);
  opacity: 0;
  pointer-events: none;
}

.mobile-menu[aria-hidden="false"] {
  opacity: 1;
  pointer-events: all;
}

.mobile-menu-content {
  width: 100%;
  max-width: 400px;
  padding: var(--space-6);
  position: relative;
}

.mobile-menu-close {
  position: fixed;
  top: var(--space-4);
  right: var(--space-4);
  width: 48px;
  height: 48px;
  background: transparent;
  border: none;
  color: var(--color-white);
  font-size: 32px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: transform var(--transition-base);
}

.mobile-menu-close:hover {
  transform: scale(1.1);
}

.mobile-menu-close:active {
  transform: scale(0.95);
}

.btn-mobile-signup {
  width: 100%;
  margin-bottom: var(--space-4);
}

.mobile-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.mobile-nav-list a {
  display: block;
  font-size: 24px;
  font-weight: var(--font-weight-medium);
  color: var(--color-white);
  text-decoration: none;
  padding: var(--space-2) 0;
  text-align: center;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.mobile-nav-list a:hover {
  color: var(--color-teal-light);
}

/* Footer */
.site-footer {
  background: var(--color-navy);
  color: var(--color-white);
  padding: var(--space-8) 0 var(--space-4) 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-6);
  margin-bottom: var(--space-6);
}

@media (max-width: 809px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }
}

.footer-column h3 {
  font-size: var(--font-size-body);
  font-weight: var(--font-weight-bold);
  color: var(--color-white);
  margin: 0 0 var(--space-2) 0;
}

.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-links a {
  font-size: var(--font-size-small);
  color: var(--color-white);
  text-decoration: none;
  opacity: 0.8;
  transition: all var(--transition-fast);
}

.footer-links a:hover {
  opacity: 1;
  text-decoration: underline;
}

.footer-tagline {
  font-size: var(--font-size-body);
  color: var(--color-white);
  opacity: 0.9;
  margin: var(--space-2) 0;
}

.footer-social {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.footer-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-small);
  color: var(--color-white);
  transition: all var(--transition-fast);
}

.footer-social a:hover {
  background: rgba(255, 255, 255, 0.2);
}

.footer-divider {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  margin: var(--space-6) 0 var(--space-3) 0;
}

.footer-bottom {
  font-size: var(--font-size-tiny);
  color: rgba(255, 255, 255, 0.75); /* WCAG AA fix: use color opacity instead of element opacity */
  opacity: 1;
  text-align: center;
}

.footer-bottom p {
  margin: var(--space-1) 0;
}
