/* ─────────────── HEADER BASE ─────────────── */
#site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255);
  /*backdrop-filter: blur(8px);*/
  overflow: visible; /* IMPORTANT: allow dropdowns to show */
}

/* ─────────────── NAV BAR ─────────────── */
.nav {
  max-width: 1280px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 24px;
  justify-content: flex-start;
  overflow: visible; /* IMPORTANT: allow dropdowns to show */
}

.nav__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.nav__brand img {
  content: url("/images/logo-320.webp");
  height: 28px;
  width: auto;
  display: block;
}

.nav__brand span {
  font-family: "Gothic One", sans-serif;
  font-size: 20px;
  letter-spacing: 0.4px;
  color: var(--brand-indigo);
}

.nav__brand .accent { color: var(--brand-cyan); }

/* ─────────────── MENU LIST ─────────────── */
.nav__menu { flex: 1; }
.nav__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 28px;
}
.nav__list > li { position: relative; }

.nav__link {
  text-decoration: none;
  color: #222;
  font-weight: 500;
  position: relative;
  padding: 6px 2px;
  display: inline-block;
}

/* ─────────────── SEARCH (MINIMAL UNDERLINE + TYPEAHEAD) ─────────────── */
.nav__searchWrap{
  margin-left: auto;
  position: relative;
}

.nav__search{
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav__searchInput{
  width: clamp(160px, 16vw, 260px);
  padding: 8px 0;
  border: 0;
  border-bottom: 1px solid rgba(0,0,0,0.22);
  background: transparent;
  color: #111;
  outline: none;
}

.nav__searchInput::placeholder{
  color: rgba(17,17,17,0.55);
}

.nav__searchInput:focus{
  border-bottom-color: rgba(0,0,0,0.55);
}

.nav__searchBtn{
  border: 0;
  background: transparent;
  padding: 6px;
  cursor: pointer;
  color: rgba(0,0,0,0.65);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav__searchBtn svg{
  fill: currentColor;
}

.nav__searchBtn:hover{
  color: rgba(0,0,0,0.9);
}

/* dropdown */
.nav__searchDrop{
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(460px, calc(100vw - 40px));
  background: #fff;
  border: 1px solid rgba(0,0,0,0.10);
  border-radius: 14px;
  box-shadow: 0 14px 40px rgba(12, 17, 29, 0.14);
  padding: 8px;
  display: none;
  z-index: 999; /* ensure above nav/menu */
}

.nav__searchDrop.is-open{ display: block; }

.nav__searchItem{
  display: block;
  text-decoration: none;
  color: #111;
  padding: 10px 10px;
  border-radius: 12px;
}

.nav__searchItem:hover{
  background: rgba(79, 70, 229, 0.07);
}

.nav__searchTitleRow{
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.nav__searchTitle{
  font-weight: 600;
}

.nav__searchMeta{
  font-size: 12px;
  opacity: .65;
}

.nav__searchSnippet{
  margin-top: 4px;
  font-size: 13px;
  opacity: .75;
  line-height: 1.35;
}

/* ─────────────── DROPDOWNS (DESKTOP) ─────────────── */
.dropdown {
  list-style: none;
  margin: 0;
  padding: 10px 12px 10px 8px;
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 280px;
  background: #fff;
  border: 1px solid #eee;
  box-shadow: var(--shadow);
  border-radius: 12px;
  z-index: 200;
  overflow: visible;
}

.dropdown > li {
  position: relative;
  padding: 0;
}

.dropdown a {
  display: block;
  padding: 9px 12px;
  border-radius: 8px;
  color: #222;
  text-decoration: none;
  white-space: nowrap;
}

.dropdown a:hover { background: #f6f7ff; }

.dropdown .dropdown {
  top: 0;
  left: calc(100% - 8px);
  margin-left: 0;
  border-radius: 10px;
}

.dropdown > li.has-sub::after {
  content: "";
  position: absolute;
  top: 0;
  right: -12px;
  width: 16px;
  height: 100%;
  background: transparent;
  pointer-events: auto;
}

.has-sub:where(:hover, :focus-within) > .dropdown { display: block; }
.dropdown > li.has-sub:hover > .dropdown,
.dropdown > li.has-sub:focus-within > .dropdown {
  display: block;
  z-index: 210;
}

/* ─────────────── HAMBURGER TOGGLE ─────────────── */
.nav__toggle {
  display: none;
  margin-left: 12px;
  width: 40px;
  height: 34px;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.nav__toggle span {
  display: block;
  height: 2px;
  margin: 6px 0;
  background: #222;
  border-radius: 1px;
}

/* ─────────────── RESPONSIVE (MOBILE ≤900px) ─────────────── */
@media (max-width: 900px) {
  .nav {
    gap: 12px;
    justify-content: space-between;
  }

  /* IMPORTANT: DO NOT HIDE SEARCH ON MOBILE */
  .nav__searchWrap { display: block; }

  /* make dropdown full-width under the field on mobile */
  .nav__searchDrop{
    right: auto;
    left: 0;
    width: min(560px, calc(100vw - 28px));
  }

  .nav__menu {
    position: absolute;
    inset: 64px 0 auto 0;
    background: #fff;
    border-top: 1px solid #eee;
    box-shadow: var(--shadow);
    display: none;
  }
  .nav__menu.is-open { display: block; }

  .nav__list {
    flex-direction: column;
    align-items: stretch;
    padding: 10px 14px;
    gap: 0;
  }
  .nav__list > li { padding: 4px 0; }
  .nav__link { padding: 12px 6px; }

  .dropdown {
    position: static;
    display: none;
    box-shadow: none;
    border: 0;
    border-left: 3px solid #eef;
    list-style: none;
    padding: 6px 0 6px 10px;
    margin: 4px 0 8px 12px;
    border-radius: 0;
    overflow: visible;
  }
  .dropdown.is-open { display: block; }

  .dropdown .dropdown {
    left: 0;
    margin-left: 10px;
    border-left: 3px solid #eef;
  }

  .dropdown > li.has-sub::after { display: none; }

  .nav__toggle { display: block; }
}
