/* ============================================
   JaoTech Gworld | navbar.css
   Navigation Stylesheet
   Innovation for a Digital Africa
   ============================================ */


/* ============ 1. NAVBAR BASE ============ */
.navbar {
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 9999;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 5%;
  transition: box-shadow 0.3s ease, background 0.3s ease;
}

/* Shadow appears when user scrolls down */
.navbar.scrolled {
  box-shadow: 0 4px 28px rgba(13, 27, 62, 0.10);
  background: rgba(255, 255, 255, 0.99);
}


/* ============ 2. LOGO ============ */
.logo {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  flex-shrink: 0;
}

.logo-img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 6px;
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.logo-name {
  font-family: var(--font-heading);
  font-size: 1.08rem;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -0.01em;
}

.logo-tagline {
  font-size: 0.68rem;
  color: var(--text-light);
  letter-spacing: 0.04em;
  font-weight: 400;
}


/* ============ 3. DESKTOP NAV LINKS ============ */
.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links li a {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-dark);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  position: relative;
  transition: color 0.22s ease, background 0.22s ease;
  letter-spacing: 0.01em;
}

/* Underline animation on hover */
.nav-links li a::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 14px;
  width: 0;
  height: 2px;
  background: var(--blue);
  border-radius: 2px;
  transition: width 0.25s ease;
}

.nav-links li a:hover {
  color: var(--blue);
  background: var(--blue-pale);
}

.nav-links li a:hover::after {
  width: calc(100% - 28px);
}

/* Active page link */
.nav-links li a.active {
  color: var(--blue);
  font-weight: 600;
}

.nav-links li a.active::after {
  width: calc(100% - 28px);
}


/* ============ 4. CTA BUTTON IN NAV ============ */
.nav-links li a.nav-cta {
  background: var(--blue);
  color: var(--white);
  padding: 9px 20px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.86rem;
  border: 2px solid var(--blue);
  transition: background 0.25s ease,
              border-color 0.25s ease,
              transform 0.2s ease,
              box-shadow 0.2s ease;
}

/* Remove underline from CTA button */
.nav-links li a.nav-cta::after {
  display: none;
}

.nav-links li a.nav-cta:hover {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--white);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(13, 27, 62, 0.22);
}


/* ============ 5. HAMBURGER BUTTON (Mobile) ============ */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 0;
  transition: border-color 0.2s ease, background 0.2s ease;
  flex-shrink: 0;
}

.hamburger:hover {
  border-color: var(--blue);
  background: var(--blue-pale);
}

/* The three lines of the hamburger */
.hamburger span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--navy);
  border-radius: 2px;
  transition: transform 0.35s ease,
              opacity 0.25s ease,
              width 0.25s ease;
  transform-origin: center;
}

/* Hamburger OPEN state — animates into X */
.hamburger.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger.open span:nth-child(2) {
  opacity: 0;
  width: 0;
}

.hamburger.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}


/* ============ 6. MOBILE MENU ============ */
.mobile-menu {
  display: none;
  position: fixed;
  top: 70px;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--white);
  z-index: 9998;
  padding: 24px 5% 40px;
  flex-direction: column;
  overflow-y: auto;

  /* Slide down animation */
  transform: translateY(-10px);
  opacity: 0;
  transition: transform 0.35s ease, opacity 0.3s ease;
}

/* When open */
.mobile-menu.open {
  display: flex;
  transform: translateY(0);
  opacity: 1;
}

/* Mobile menu links */
.mobile-menu a {
  display: block;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--navy);
  transition: color 0.2s ease, padding-left 0.2s ease;
}

.mobile-menu a:hover {
  color: var(--blue);
  padding-left: 8px;
}

.mobile-menu a.active {
  color: var(--blue);
}

/* CTA button inside mobile menu */
.mobile-menu .nav-cta {
  display: block;
  margin-top: 24px;
  background: var(--blue);
  color: var(--white);
  text-align: center;
  padding: 15px 20px;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  border-bottom: none;
  transition: background 0.25s ease;
}

.mobile-menu .nav-cta:hover {
  background: var(--navy);
  color: var(--white);
  padding-left: 20px;
}

/* Mobile menu contact info at bottom */
.mobile-menu-footer {
  margin-top: auto;
  padding-top: 28px;
  border-top: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--text-light);
}

.mobile-menu-footer a {
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--text-light);
  border-bottom: none;
  padding: 4px 0;
}

.mobile-menu-footer a:hover {
  color: var(--blue);
  padding-left: 0;
}


/* ============ 7. SHOW/HIDE ON SCREEN SIZES ============ */

/* On screens wider than 900px - show desktop nav, hide hamburger */
@media (min-width: 901px) {
  .hamburger {
    display: none !important;
  }
  .mobile-menu {
    display: none !important;
  }
  .nav-links {
    display: flex !important;
  }
}

/* On screens 900px and below - show hamburger, hide desktop nav */
@media (max-width: 900px) {
  .nav-links {
    display: none !important;
  }
  .hamburger {
    display: flex !important;
  }
}