/* ==========================================================================
   Header — sticky black bar; desktop dropdowns, mobile fullscreen menu
   (Figma: desktop header scrollBehavior FIXED, mobile STICKY -> sticky)
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--c-black);
  height: clamp(107px, calc(136px - 29 * (100vw - 390px) / 1290), 136px);
  display: flex;
  align-items: flex-end;
  padding: 0 14px 20px;
}

.header__row {
  width: 100%;
  height: 53px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header__logo {
  display: block;
  flex-shrink: 0;
}
.header__logo img {
  width: clamp(145px, calc(145px + 35 * (100vw - 390px) / 1290), 180px);
  height: auto;
}

/* --- Hamburger / close button (mobile) --- */
.header__burger {
  position: relative;
  width: 61px;
  height: 53px;
  padding: 0;
}
.header__burger-line {
  position: absolute;
  left: 0;
  width: 61px;
  height: 1px;
  background: var(--c-white);
  transition: transform 0.3s ease-out;
}
.header__burger-line:nth-child(1) { top: 14px; }
.header__burger-line:nth-child(2) { top: 35px; }
body.menu-open .header__burger-line:nth-child(1) { transform: translateY(10.5px) rotate(45deg); }
body.menu-open .header__burger-line:nth-child(2) { transform: translateY(-10.5px) rotate(-45deg); }

/* --- Mobile nav: fullscreen overlay --- */
.header__nav {
  position: fixed;
  inset: 0;
  z-index: -1; /* under the header bar row so logo/burger stay on top */
  background: var(--c-black);
  height: 100dvh;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease-out, visibility 0s linear 0.3s;
  padding: 140px 14px 20px;
}
body.menu-open .header__nav {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.3s ease-out;
}

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

.header__item { display: contents; } /* mobile: flat list, subs expanded */

.header__link,
.header__sublink {
  display: flex;
  align-items: center;
  height: 35px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 17px;
  line-height: 24px;
  color: var(--c-white);
  transition: color 0.2s ease-out;
}
.header__link:hover,
.header__link:focus-visible,
.header__sublink:hover,
.header__sublink:focus-visible { color: var(--c-pink); }

.header__chev {
  margin-left: 8px;
  flex-shrink: 0;
}

.header__disclosure { display: none; }

.header__sub {
  display: contents;
}
.header__sub .header__sublink { padding-left: 27px; }
.header__sub li { display: contents; }

/* ================= Desktop (>=900px) ================= */
@media (min-width: 900px) {
  .site-header {
    align-items: stretch;
    padding: 0 max(24px, calc((100vw - 1200px) / 2));
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
  }

  .header__row {
    height: auto;
    max-width: 1200px;
    margin-inline: auto;
    align-items: stretch;
  }

  .header__logo { align-self: center; }

  .header__burger { display: none; }

  .header__nav {
    position: static;
    z-index: auto;
    height: auto;
    background: none;
    overflow: visible;
    opacity: 1;
    visibility: visible;
    transition: none;
    padding: 0;
    margin-left: auto;
    display: flex;
  }

  .header__menu {
    flex-direction: row;
    gap: 39px;
    align-items: stretch;
  }

  .header__item {
    display: flex;
    align-items: center;
    position: relative;
  }

  .header__link,
  .header__sublink { height: auto; }

  .header__chev--mobile { display: none; }

  .header__disclosure {
    display: inline-flex;
    align-items: center;
    padding: 0;
    margin-left: 8px;
    color: var(--c-white);
    transition: color 0.2s ease-out;
  }
  .header__disclosure:hover,
  .header__disclosure:focus-visible { color: var(--c-pink); }
  .header__disclosure .header__chev {
    margin: 0;
    transition: transform 0.2s ease-out;
  }
  .header__item.is-open .header__disclosure .header__chev { transform: rotate(180deg); }

  /* Dropdown panel */
  .header__sub {
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: absolute;
    top: 100%;
    left: -24px;
    min-width: 220px;
    width: max-content;
    background: var(--c-black);
    padding: 20px 24px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-top: none;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transform: translateY(-8px);
    visibility: hidden;
    transition: opacity 0.2s ease-out, transform 0.2s ease-out, visibility 0s linear 0.2s;
  }
  .header__sub li { display: block; }
  .header__sub .header__sublink {
    height: 35px;
    padding-left: 0;
    white-space: nowrap;
  }
  /* Right-most dropdown (Locations) anchors right so its max-content panel
     never widens the page at mid viewports */
  .header__item:last-child .header__sub {
    left: auto;
    right: -24px;
  }
  .header__item.is-open .header__sub {
    opacity: 1;
    transform: none;
    visibility: visible;
    transition: opacity 0.2s ease-out, transform 0.2s ease-out;
  }

  /* Current-page/section nav link (template pages set aria-current) */
  .header__link[aria-current],
  .header__sublink[aria-current] { color: var(--c-pink); }
}
