/* ==========================================
   G-FORCE HEADER
   File: components/header/header.css
========================================== */

/* ==========================================
   HEADER WRAPPER
========================================== */

#site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: 76px;
}

@media (min-width: 768px) {
  #site-header {
    top: -34px;
    min-height: 112px;
  }
}

/* ==========================================
   TOPBAR
========================================== */

.topbar {
  background: #e8f1fc;
  height: 34px;
}

/* ==========================================
   MAIN NAVIGATION CONTAINER
========================================== */

.nav-pill {
  position: relative;
  background: rgba(255, 255, 255, 0.97);
  border-radius: 999px;
  padding: 8px 12px 8px 20px;
  box-shadow: 0 10px 30px rgba(11, 42, 85, 0.14);
}

/* ==========================================
   BRAND / LOGO
========================================== */

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.brand-name {
  display: block;
  font: italic 800 1.6rem/1 Montserrat, sans-serif;
  color: #0b3a7a;
}

.brand-tag {
  display: block;
  font: 700 0.47rem/1.6 Inter, sans-serif;
  letter-spacing: 0.05em;
  color: #0b2a55;
  border-top: 1px solid #1766c2;
  white-space: nowrap;
}

@media (max-width: 360px) {
  .brand-tag {
    display: none;
  }
}

/* ==========================================
   NAVIGATION LINKS
========================================== */

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-list > li {
  list-style: none;
}

/* Compact navigation links */
.nav-link {
  display: block;
  padding: 5px 11px;
  font-weight: 600;
  font-size: 0.85rem;
  color: #0b2a55;
  border: 1px solid transparent;
  border-radius: 8px;

  transition:
    color 0.25s ease,
    background-color 0.25s ease,
    border-color 0.25s ease;
}

/* Hover state */
.nav-link:hover {
  color: #1766c2;
  background: #e8f1fc;
}

/* Active state */
.nav-link.active {
  color: #1766c2;
  background: #e8f1fc;
  border-color: rgba(23, 102, 194, 0.18);
  box-shadow: inset 0 -2px 0 #1766c2;
}

/* ==========================================
   SERVICES DROPDOWN BUTTON
========================================== */

.has-dropdown {
  position: relative;
}

.has-dropdown > div {
  display: flex;
  align-items: center;
  gap: 2px;
}

.drop-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 42px;
  flex-shrink: 0;
  padding: 10px;
  color: #0b2a55;
  border-radius: 8px;

  transition:
    color 0.25s ease,
    background-color 0.25s ease;
}

.drop-toggle:hover {
  color: #1766c2;
  background: #e8f1fc;
}

.drop-toggle i {
  transition: transform 0.3s ease;
}

.has-dropdown.open .drop-toggle i {
  transform: rotate(180deg);
}

/* ==========================================
   SERVICES DROPDOWN MENU
========================================== */

.dropdown {
  display: grid;
  gap: 4px;
  list-style: none;

  margin: 0;
  padding: 0 8px;

  max-height: 0;
  overflow: hidden;

  opacity: 0;
  visibility: hidden;
  pointer-events: none;

  transform: translateY(-6px);

  transition:
    max-height 0.35s ease,
    opacity 0.25s ease,
    transform 0.25s ease,
    visibility 0.25s ease,
    padding 0.25s ease;
}

/* Individual dropdown links */

.dropdown a {
  display: flex;
  align-items: center;
  gap: 10px;

  padding: 10px 6px;

  font-size: 0.85rem;
  font-weight: 500;
  line-height: 1.4;

  border-radius: 10px;
  color: #0b2a55;

  transition:
    color 0.2s ease,
    background-color 0.2s ease,
    padding-left 0.2s ease;
}

.dropdown a:hover {
  background: #e8f1fc;
  color: #1766c2;
  padding-left: 18px;
}

.dropdown a.active {
  background: #e8f1fc;
  color: #1766c2;
  font-weight: 700;
}

.dropdown i {
  width: 18px;
  flex-shrink: 0;
  color: #1766c2;
}

/* ==========================================
   MOBILE AND TABLET NAVIGATION
========================================== */

.nav-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);

  background: #ffffff;
  border-radius: 22px;
  padding: 16px 20px;

  box-shadow: 0 20px 40px rgba(11, 42, 85, 0.2);

  max-height: calc(100vh - 100px);
  overflow-y: auto;

  opacity: 0;
  visibility: hidden;
  pointer-events: none;

  transform: translateY(-10px);

  transition:
    opacity 0.25s ease,
    transform 0.25s ease,
    visibility 0.25s ease;
}

/* Mobile menu open */

.nav-menu.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

/* Mobile dropdown open */

.has-dropdown.open .dropdown {
  max-height: 400px;
  padding: 8px;

  opacity: 1;
  visibility: visible;
  pointer-events: auto;

  transform: translateY(0);
}

/* ==========================================
   DESKTOP NAVIGATION
========================================== */

@media (min-width: 1280px) {

  /* Main navigation layout */

  .nav-menu {
    position: static;

    display: flex;
    flex: 1;
    align-items: center;
    justify-content: space-between;
    gap: 24px;

    background: none;
    box-shadow: none;

    padding: 0;

    max-height: none;
    overflow: visible;

    opacity: 1;
    visibility: visible;
    pointer-events: auto;

    transform: none;
    transition: none;
  }

  /* Horizontal navigation links */

  .nav-list {
    flex-direction: row;
    align-items: center;
    gap: 20px;
    margin: 0 auto;
  }

  .nav-list > li {
    position: relative;
  }

  .nav-link {
    padding: 10px 8px;
    white-space: nowrap;
  }

  /* Services dropdown positioning */

  .has-dropdown {
    position: relative;
  }

  .has-dropdown > div {
    gap: 0;
  }

  .drop-toggle {
    width: 28px;
    padding: 6px 2px 6px 5px;
  }

  /* Invisible hover bridge
     Prevents dropdown from closing while
     moving the cursor from Services to menu */

  .has-dropdown::after {
    content: "";
    position: absolute;

    top: 100%;
    left: -12px;
    right: -12px;

    height: 12px;
  }

  /* Desktop dropdown */

  .dropdown,
  .has-dropdown.open .dropdown {
    position: absolute;

    top: calc(100% + 10px);
    left: -12px;

    width: 320px;
    max-height: none;

    display: grid;
    gap: 4px;

    margin: 0;
    padding: 10px;

    background: #ffffff;
    border: 1px solid rgba(23, 102, 194, 0.1);
    border-radius: 16px;

    box-shadow: 0 20px 40px rgba(11, 42, 85, 0.18);

    overflow: visible;

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transform: translateY(8px);

    transition:
      opacity 0.25s ease,
      transform 0.25s ease,
      visibility 0.25s ease;
  }

  /* Desktop dropdown visible states */

  .has-dropdown:hover .dropdown,
  .has-dropdown:focus-within .dropdown,
  .has-dropdown.open .dropdown {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
  }

  /* Active services dropdown link */

  .dropdown a.active {
    background: #e8f1fc;
    color: #1766c2;
  }
}

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

.nav-link:focus-visible,
.drop-toggle:focus-visible,
.dropdown a:focus-visible {
  outline: 2px solid #1766c2;
  outline-offset: 3px;
}

/* Respect reduced-motion preferences */

@media (prefers-reduced-motion: reduce) {
  .nav-link,
  .drop-toggle,
  .drop-toggle i,
  .dropdown,
  .dropdown a,
  .nav-menu {
    transition: none !important;
  }
}