/*
 * Header and Navigation
 * Eko DDD - Sticky header with dropdown menu
 */

.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 400; /* elevate above footer/back-to-top */
  backdrop-filter: saturate(160%) blur(10px);
  background: rgba(255, 255, 255, 0.85);
  border-bottom: 1px solid rgba(113, 28, 118, 0.08);
}

.header__top {
  height: var(--header-top-h);
  display: flex;
  align-items: center;
  width: var(--container);
  margin-inline: auto;
  justify-content: flex-end;
  gap: 0.6rem;
  color: #374151;
  font-size: 0.9rem;
}

.header__main {
  height: var(--header-main-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: var(--container);
  margin-inline: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.brand__logo {
  /* Slightly reduced width for better horizontal breathing room */
  width: 130px;
  display: block;
  background: none !important;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
}

.brand__logo img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}

.brand__text {
  font-family: Poppins, Inter, sans-serif;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

.nav__list {
  list-style: none;
  display: flex;
  gap: 0.6rem;
  padding: 0;
  margin: 0;
}

.nav__link {
  display: inline-flex;
  align-items: center;
  line-height: 1;
  padding: 0.55rem 0.8rem;
  border-radius: 10px;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.95rem;
  transition: background 0.18s ease, color 0.18s ease;
}

.nav__link svg {
  display: block; /* avoid baseline misalignment */
}

.nav__link:hover {
  background: #fff;
  color: var(--ink);
}

/* Dropdown */
.dropdown {
  position: relative;
}

.dropdown__toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.dropdown__menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  padding: 0.4rem;
  z-index: 90;
}

.dropdown__menu,
.dropdown__menu li {
  list-style: none;
  margin: 0;
  padding: 0;
}

.dropdown__menu .nav__link {
  display: block;
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
}

.dropdown:hover > .dropdown__menu {
  display: block;
}

.dropdown.is-open > .dropdown__menu {
  display: block;
}

.nav__link--accent {
  background: color-mix(in oklab, var(--brand-green) 8%, white);
  color: #134e1f;
  border: 1px solid color-mix(in oklab, var(--brand-green) 22%, white);
}

.nav__link--active {
  background: color-mix(in oklab, var(--brand-purple) 8%, white);
  color: var(--brand-purple);
  border: 1px solid color-mix(in oklab, var(--brand-purple) 28%, white);
}

.nav__link--active:focus-visible {
  outline: 2px solid var(--brand-purple);
  outline-offset: 2px;
}

.nav__contacts {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  color: var(--muted);
}

.nav__contacts a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0; /* slimmer, more elegant top bar */
  border-radius: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  font-weight: 600;
  color: #374151;
  font-size: 0.8rem;
}

.nav__contacts a:hover {
  color: var(--brand-purple);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.nav__contacts a + a {
  position: relative;
  padding-left: 0;
}

.nav__contacts a + a::before {
  display: none;
}

.nav__contacts svg {
  width: 14px;
  height: 14px;
  color: var(--brand-purple);
}

.nav__cta {
  margin-left: 0.4rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.hamburger {
  display: none;
  border: none;
  background: transparent;
  padding: 0.5rem;
  border-radius: 10px;
}

.hamburger svg {
  width: 26px;
  height: 26px;
}

@media (max-width: 900px) {
  .brand__logo {
    width: 100px; /* proportionally smaller on mobile */
  }
  .header__top {
    display: none;
  }

  .nav__list {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    top: var(--header-main-h);
    background: #fff;
    padding: 1rem;
    box-shadow: var(--shadow-md);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    max-height: calc(100vh - var(--header-main-h));
    overflow-y: auto;
  }

  .header.is-scrolled .nav__list {
    top: 64px;
    max-height: calc(100vh - 64px);
  }

  .nav__list.is-open {
    display: grid;
    gap: 0.2rem;
  }

  .nav__item {
    padding: 0.25rem 0.2rem;
  }

  .dropdown__menu {
    position: static;
    display: none;
    box-shadow: none;
    border: 1px dashed rgba(0, 0, 0, 0.08);
    margin: 0 0 0.4rem 0.5rem;
    padding: 0.4rem;
  }

  .dropdown.is-open > .dropdown__menu {
    display: block;
  }

  .hamburger {
    display: inline-grid;
    place-items: center;
  }

  .nav__cta {
    display: none;
  }

  .nav__contacts {
    display: none;
  }
}

/* Shrink header on scroll */
.header.is-scrolled {
  border-bottom-color: rgba(0, 0, 0, 0.06);
  background: rgba(255, 255, 255, 0.9);
}

.header.is-scrolled .header__main {
  height: 64px;
}
