/* components/header/header.css */
/* Header */
.header {
  position: sticky;
  top: 0;
  background: var(--dark-blue);
  height: 60px;
  z-index: 1000;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header-content {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
}

.logo a:focus-visible {
  outline: 3px solid white;
  outline-offset: 3px;
  border-radius: 2px;
}

.logo img {
  display: block;
  width: auto;
  height: 50px;
  position: relative;
  left: -7px;
}

.mobile-menu-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  gap: 6px;
  border-radius: 4px;
  -webkit-tap-highlight-color: transparent;
  appearance: none;
}

.mobile-menu-toggle:active {
  background: transparent;
}

.mobile-menu-toggle:focus-visible {
  outline: 3px solid white;
  outline-offset: 2px;
}

.hamburger-line {
  width: 24px;
  height: 2px;
  background: white;
  transition: all 0.3s ease;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

.site-nav {
  position: fixed;
  top: 60px;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--dark-blue);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
  z-index: 999;
}

.site-nav.active {
  transform: translateX(0);
}

.nav-list {
  list-style: none;
  margin: 0;
  padding: 20px 0;
}

.nav-item-wrapper {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding: 16px 20px;
  font-size: clamp(1.0625rem, 1rem + 0.2vw, 1.1875rem);
  font-weight: 600;
  color: white;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.nav-item:hover {
  text-decoration: none;
}

.nav-item:active {
  background: transparent;
}

.nav-item:focus-visible {
  outline: 3px solid white;
  outline-offset: -3px;
}

.mobile-nav-chevron {
  flex: 0 0 auto;
  margin-right: 6px;
  transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-item-wrapper.open .mobile-nav-chevron {
  transform: rotate(180deg);
}

.dropdown-menu {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition:
    grid-template-rows 0.26s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.18s ease;
}

.nav-item-wrapper.open .dropdown-menu {
  grid-template-rows: 1fr;
  opacity: 1;
}

.dropdown-menu-inner {
  list-style: none;
  margin: 0;
  min-height: 0;
  overflow: hidden;
  padding: 0;
}

.dropdown-menu-inner > li {
  margin: 0;
  padding: 0;
}

.nav-item-wrapper.open .dropdown-menu-inner {
  padding: 0 0 8px;
}

.dropdown-item {
  display: block;
  padding: 12px 40px;
  font-size: clamp(1rem, 0.95rem + 0.15vw, 1.0625rem);
  color: white;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.dropdown-menu-inner > li:first-child .dropdown-item {
  padding-top: 6px;
}

.dropdown-item:hover {
  text-decoration: none;
}

.dropdown-item:active {
  background: transparent;
}

.header .dropdown-item:focus-visible {
  outline: 3px solid white;
  outline-offset: -3px;
}

@media (min-width: 1024px) {
  .header {
    height: 80px;
  }

  .header-content {
    position: relative;
  }

  .logo img {
    height: 64px;
    left: -10px;
  }

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

  .site-nav {
    position: static;
    display: flex;
    align-items: center;
    background: transparent;
    transform: none;
    transition: none;
    overflow: visible;
    z-index: auto;
  }

  .nav-list {
    display: flex;
    align-items: center;
    padding: 0;
  }

  .nav-item-wrapper {
    position: relative;
    border-bottom: 0;
  }

  .nav-item {
    display: inline-block;
    width: auto;
    padding: 10px 20px;
    font-size: clamp(1rem, 0.96rem + 0.12vw, 1.0625rem);
    font-weight: 700;
    text-decoration: underline transparent;
    transition: text-decoration 0.3s;
  }

  .nav-item:hover {
    text-decoration-line: underline;
    text-decoration-color: white;
    border-radius: 4px;
  }

  .nav-item:focus-visible {
    outline: 3px solid white;
    outline-offset: 2px;
    border-radius: 4px;
  }

  .mobile-nav-chevron {
    display: none;
  }

  .dropdown-menu {
    position: absolute;
    left: 20px;
    top: 100%;
    margin-top: 0;
    width: max-content;
    min-width: 240px;
    max-width: min(360px, calc(100vw - 40px));
    padding: 20px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: saturate(180%) blur(18px);
    -webkit-backdrop-filter: saturate(180%) blur(18px);
    box-shadow: 0 12px 28px rgba(20, 52, 120, 0.16);
    border-radius: 8px;
    z-index: 50;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    display: block;
    transition:
      opacity 0.18s ease-out 0.05s,
      visibility 0s linear 0.23s;
  }

  .nav-item-wrapper.open .dropdown-menu,
  .nav-item-wrapper:focus-within .dropdown-menu {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transition:
      opacity 0.01s linear,
      visibility 0s linear 0s;
  }

  .nav-item-wrapper:nth-last-child(-n+2) .dropdown-menu {
    left: auto;
    right: 20px;
  }

  .dropdown-menu-inner {
    overflow: visible;
    padding: 0;
  }

  .nav-item-wrapper.open .dropdown-menu-inner {
    padding: 0;
  }

  .mobile-overview-item {
    display: none;
  }

  .dropdown-item {
    padding: 10px 0;
    color: var(--mid-blue);
    font-size: clamp(0.875rem, 0.84rem + 0.12vw, 0.9375rem);
    line-height: 1.4;
    font-weight: 400;
    text-decoration: underline transparent;
    opacity: 0;
    transform: translateY(-6px);
    transition:
      color 0.3s,
      text-decoration-color 0.2s,
      opacity 0.16s ease,
      transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .dropdown-menu-inner > li:first-child .dropdown-item {
    padding-top: 10px;
  }

  .nav-item-wrapper.open .dropdown-item,
  .nav-item-wrapper:focus-within .dropdown-item {
    opacity: 1;
    transform: translateY(0);
    transition:
      color 0.3s,
      text-decoration-color 0.2s,
      opacity 0.2s ease 0.05s,
      transform 0.24s cubic-bezier(0.16, 1, 0.3, 1) 0.05s;
  }

  .nav-item-wrapper.open .dropdown-menu-inner > li:nth-child(3) .dropdown-item,
  .nav-item-wrapper:focus-within .dropdown-menu-inner > li:nth-child(3) .dropdown-item {
    transition-delay: 0s, 0s, 0.09s, 0.09s;
  }

  .nav-item-wrapper.open .dropdown-menu-inner > li:nth-child(4) .dropdown-item,
  .nav-item-wrapper:focus-within .dropdown-menu-inner > li:nth-child(4) .dropdown-item {
    transition-delay: 0s, 0s, 0.13s, 0.13s;
  }

  .dropdown-item:hover {
    color: var(--mid-blue);
    text-decoration-line: underline;
    text-decoration-style: solid;
    text-decoration-color: var(--mid-blue);
  }

  .header .dropdown-item:focus-visible {
    outline: 3px solid var(--dark-blue);
    outline-offset: 2px;
    text-decoration: underline;
    text-decoration-color: var(--mid-blue);
    border-radius: 2px;
  }
}

@media (min-width: 1500px) {
  .nav-item-wrapper:nth-last-child(-n+2) .dropdown-menu {
    right: auto;
    left: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dropdown-menu,
  .dropdown-item,
  .hamburger-line,
  .site-nav,
  .mobile-nav-chevron {
    transition: none;
  }

  .dropdown-item {
    transform: none;
  }
}
