/* ================================================================
   NAVBAR v2 — borrowed & adapted from lasalletechnical.co.ke
   Exact pattern: sticky header, hover dropdowns, mobile drawer,
   crimson accent border, slide-indent hover on dropdown items.
   ================================================================ */

/* ── Utility / top bar ── */
.nav-topbar {
  background: var(--primary-mid);
  height: 40px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.nav-topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding-left: 20px;
  padding-right: 16px;
  height: 100%;
}
@media (min-width: 768px) { .nav-topbar__inner { padding-left: 32px; padding-right: 16px; } }
@media (max-width: 640px) { .nav-topbar { display: none; } }

.nav-topbar__left { display: flex; height: 100%; align-items: center; }

.nav-topbar__pill {
  height: 100%;
  display: flex;
  align-items: center;
  padding-inline: 22px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fff;
  transition: background 0.2s;
  white-space: nowrap;
}
.nav-topbar__pill--accent { background: var(--crimson); }
.nav-topbar__pill--plain  { border-right: 1px solid rgba(255,255,255,0.2); }
.nav-topbar__pill--plain:hover { background: rgba(255,255,255,0.08); }
.nav-topbar__pill--portal {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: rgba(255,255,255,0.75);
  padding: 0 12px;
  height: 100%;
  display: flex;
  align-items: center;
  border-right: 1px solid rgba(255,255,255,0.12);
  transition: color 0.2s, background 0.2s;
  text-decoration: none;
  white-space: nowrap;
}
.nav-topbar__pill--portal:hover { color: #fff; background: rgba(255,255,255,0.08); }
.nav-topbar__divider {
  width: 1px;
  height: 20px;
  background: rgba(255,255,255,0.3);
  margin: 0 4px;
  flex-shrink: 0;
}
@media (max-width: 768px) { .nav-topbar__pill--portal { display: none; } .nav-topbar__divider { display: none; } }

.nav-topbar__right { display: flex; align-items: center; height: 100%; }
.nav-topbar__icon {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  flex-shrink: 0;
  border-left: 1px solid rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.8);
  transition: color 0.2s;
}
.nav-topbar__icon:hover { color: #fff; }

/* ── Main header ── */
.site-nav {
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  transition: box-shadow 0.3s ease;
}
.site-nav.scrolled { box-shadow: 0 4px 24px rgba(1,21,80,0.14); }

.site-nav__inner {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  height: 72px;
  width: 100%;
  padding-left: 20px;
  padding-right: 16px;
}
@media (min-width: 768px) { .site-nav__inner { padding-left: 32px; padding-right: 16px; } }

/* Logo */
.site-nav__logo { display: flex; align-items: center; height: 100%; padding-block: 10px; flex-shrink: 0; }
.site-nav__logo img { height: 52px; width: auto; object-fit: contain; }

/* Nav wrapper — this is the direct flex child, so margin-left:auto works here */
.site-nav__inner > nav {
  margin-left: auto;
  height: 100%;
  display: none;
}
@media (min-width: 1024px) { .site-nav__inner > nav { display: flex; align-items: center; } }

/* ── Desktop nav links ── */
.main-nav { display: flex; align-items: center; gap: 0; height: 100%; }

.main-nav > li { position: relative; height: 100%; display: flex; align-items: center; }

.main-nav > li > a {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 12px;
  height: 100%;
  font-size: 13px;
  font-weight: 600;
  text-transform: capitalize;
  letter-spacing: 0.02em;
  color: var(--primary);
  white-space: nowrap;
  position: relative;
  transition: color 0.2s;
}
.main-nav > li > a::after {
  content: '';
  position: absolute;
  bottom: 12px;
  left: 12px;
  right: 12px;
  height: 3px;
  background: var(--crimson);
  border-radius: 2px;
  transform: scaleX(0);
  transition: transform 0.2s ease;
}
.main-nav > li > a:hover::after,
.main-nav > li > a.active::after {
  transform: scaleX(1);
}
/* Chevron icon */
.main-nav > li > a .nav-chevron {
  flex-shrink: 0;
  transition: transform 0.2s ease;
}
.main-nav > li:hover > a .nav-chevron { transform: rotate(180deg); }

/* ── Dropdown ── */
.dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff;
  min-width: 220px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.12);
  border-top: 3px solid var(--crimson);
  border-radius: 0 0 6px 6px;
  z-index: 999;
  padding: 4px 0;
}
.main-nav > li:hover > .dropdown { display: block; }

.dropdown li a {
  display: block;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 500;
  color: var(--primary);
  border-bottom: 1px solid #dee2e6;
  transition: background 0.15s, padding-left 0.15s, color 0.15s;
}
.dropdown li:last-child a { border-bottom: none; }
.dropdown li a:hover {
  background: #f4f6f9;
  color: var(--crimson);
  padding-left: 24px;
}

/* ── CTA buttons in nav ── */
.nav-ctas { display: none; align-items: center; gap: 8px; }
@media (min-width: 1024px) { .nav-ctas { display: flex; margin-left: 24px; } }

.nav-btn {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 700;
  border-radius: 6px;
  text-transform: capitalize;
  letter-spacing: 0.02em;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.nav-btn--primary { background: var(--crimson); color: #fff; }
.nav-btn--primary:hover { background: #7a1226; }
.nav-btn--outline { background: #fff; color: var(--primary); border: 2px solid var(--primary); }
.nav-btn--outline:hover { background: var(--primary); color: #fff; }

/* ── Hamburger toggle ── */
.nav-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  color: var(--primary);
  font-size: 26px;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.2s;
}
.nav-toggle:hover { background: #f4f6f9; }
@media (min-width: 1024px) { .nav-toggle { display: none; } }
@media (max-width: 1023px) { .nav-toggle { margin-left: auto; } }

/* ── Mobile nav panel ── */
.mobile-nav {
  display: none;
  position: absolute;
  top: 72px;
  left: 0;
  right: 0;
  background: var(--primary);
  z-index: 998;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 8px 30px rgba(0,0,0,0.18);
}
.mobile-nav.open { display: block; }

.mobile-nav > ul { display: flex; flex-direction: column; }

.mobile-nav > ul > li > a {
  display: block;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  text-transform: capitalize;
  letter-spacing: 0.01em;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  transition: background 0.2s;
}
.mobile-nav > ul > li > a:hover { background: rgba(255,255,255,0.08); }

/* Mobile dropdown */
.mobile-dropdown { display: none; background: rgba(0,0,0,0.2); }
.mobile-dropdown.open { display: block; }
.mobile-dropdown li a {
  display: block;
  padding: 10px 20px 10px 36px;
  font-size: 13px;
  color: rgba(255,255,255,0.8);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  transition: color 0.2s;
}
.mobile-dropdown li a:hover { color: #fff; }

/* Mobile CTA buttons */
.mobile-nav__ctas {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.15);
}

/* ── Font-display: block prevents layout shift while Material Symbols loads ──
   Icons stay invisible (not unstyled text) until the font is ready. ── */
@font-face {
  font-family: 'Material Symbols Outlined';
  font-style: normal;
  font-weight: 100 700;
  font-display: block;
  src: url(https://fonts.gstatic.com/s/materialsymbolsoutlined/v236/kJEhBvYX7BgnkSrUwT8OhrdQw4oELdPIeeII9v6oFsI.woff2) format('woff2');
  unicode-range: U+0020-00FF, U+E000-F8FF;
}
