/* AZ Design System — header chrome.
   Source of truth: the DS export's templates/website/Chrome.jsx and the
   readme "Transparency & blur" rule: the sticky header is the one place
   the system uses a semi-opaque white with a subtle backdrop blur. One
   76px row — logo mark + tracked wordmark left, nav right — closed by a
   full-width 1px hairline. Overrides az-site.css; loaded after it. */

.az-site-header {
  position: sticky;
  top: var(--wp-admin--admin-bar--height, 0px);
  z-index: 40;
  padding: 0;
  background: color-mix(in srgb, var(--az-color-surface) 86%, transparent);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--az-color-border);
  color: var(--az-color-text);
}

.az-site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 76px;
}

.az-site-header__logo {
  position: static;
  height: auto;
}

.az-site-header__logo a {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--az-color-text);
  text-decoration: none;
}

.az-site-header__logo img {
  position: static;
  height: 26px !important;
  width: auto;
  transform: none;
  filter: none;
}

.az-site-header__wordmark {
  font-family: var(--az-font-h6-family);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: var(--az-tracking-label-strong);
  text-transform: uppercase;
  white-space: nowrap;
}

/* Nav sits on the same row as the logo; the hairline lives on the band. */
.az-site-header__nav-row {
  position: static;
  flex: 1 1 auto;
  width: auto;
  align-items: center;
  justify-content: flex-end;
  padding: 0;
  background: none;
  border-bottom: 0;
  box-shadow: none;
}

.az-site-header__nav--primary {
  flex: 0 1 auto;
}

.az-site-header__nav--utility {
  flex: 0 0 auto;
  margin-inline-start: 0;
}

.az-site-header__nav {
  row-gap: 0.25rem;
  column-gap: 0.25rem;
}

.az-site-header__nav .wp-block-navigation-item__content {
  padding: 0.5rem 0.85rem;
  font-family: var(--az-font-body-family);
  font-size: 0.82rem;
  letter-spacing: 0.01em;
  border-bottom: 1px solid transparent;
}

/* Active route: cobalt with a 1px accent rule, not a text underline. */
.az-site-header__nav .wp-block-navigation-item.current-menu-item > .wp-block-navigation-item__content,
.az-site-header__nav .wp-block-navigation-item.current_page_item > .wp-block-navigation-item__content,
.az-site-header__nav .wp-block-navigation-item.current-menu-ancestor > .wp-block-navigation-item__content,
.az-site-header__nav .wp-block-navigation-item__content[aria-current="page"] {
  color: var(--az-color-accent);
  font-weight: 500;
  text-decoration: none;
  border-bottom-color: var(--az-color-accent);
}

/* Icon-only toggle (no "Menu" label) */
.az-site-header__menu-toggle {
  width: 2.75rem;
  min-height: 2.75rem;
  padding: 0;
  justify-content: center;
  border: 1px solid var(--az-color-border);
  background: color-mix(in srgb, var(--az-color-text) 4%, var(--az-color-surface) 96%);
  color: var(--az-color-text);
}

.az-site-header__menu-toggle:hover {
  background: color-mix(in srgb, var(--az-color-text) 8%, var(--az-color-surface) 92%);
}

/* Mobile layout: burger on the left, logo centered, single row */
@media (max-width: 781px) {
  .az-site-header__inner {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 0;
  }

  .az-site-header__logo {
    grid-column: 2;
    justify-self: center;
  }

  .az-site-header__nav-row {
    grid-column: 1;
    grid-row: 1;
    display: flex;
    align-items: center;
    position: static;
    width: auto;
    padding: 0;
    border-bottom: 0;
    background: none;
  }

  .az-site-header__mobile-nav {
    width: auto;
  }
}

/* Slide-in drawer (from the left), with a click-to-close backdrop */
.az-site-header__mobile-backdrop {
  position: fixed;
  inset: 0;
  z-index: 205;
  background: color-mix(in srgb, var(--az-color-inverse) 55%, transparent);
  opacity: 0;
  pointer-events: none;
  transition: opacity 240ms ease;
}

.az-site-header__mobile-nav[data-state="open"] .az-site-header__mobile-backdrop {
  opacity: 1;
  pointer-events: auto;
}

.az-site-header__mobile-menu {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 210;
  width: min(84vw, 22rem);
  height: 100vh;
  height: 100dvh;
  margin: 0;
  display: flex;
  flex-direction: column;
  border: 0;
  border-right: 1px solid var(--az-color-border);
  background: var(--az-color-surface);
  box-shadow: 4px 0 28px color-mix(in srgb, var(--az-color-inverse) 22%, transparent);
  transform: translateX(-100%);
  visibility: hidden;
  transition: transform 260ms ease, visibility 0s linear 260ms;
}

.az-site-header__mobile-nav[data-state="open"] .az-site-header__mobile-menu {
  transform: translateX(0);
  visibility: visible;
  transition: transform 260ms ease, visibility 0s linear 0s;
}

.az-site-header__mobile-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.1rem;
  border-bottom: 1px solid var(--az-color-border);
}

.az-site-header__mobile-menu-label {
  margin: 0;
  font-family: var(--az-font-h6-family);
  font-size: var(--az-type-small);
  font-weight: 600;
  letter-spacing: var(--az-tracking-label-strong);
  text-transform: uppercase;
  color: var(--az-color-muted);
}

.az-site-header__mobile-menu-close {
  width: 2.25rem;
  height: 2.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--az-color-border);
  background: none;
  color: var(--az-color-text);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
}

.az-site-header__mobile-menu-close:hover {
  background: color-mix(in srgb, var(--az-color-text) 6%, var(--az-color-neutral-soft) 94%);
}

.az-site-header__mobile-menu-list {
  overflow-y: auto;
}

.az-site-header__mobile-menu-entry + .az-site-header__mobile-menu-entry {
  border-top: 1px solid var(--az-color-border);
}

.az-site-header__mobile-menu-link {
  color: var(--az-color-text);
}

.az-site-header__mobile-menu-link:hover {
  background: color-mix(in srgb, var(--az-color-text) 6%, var(--az-color-neutral-soft) 94%);
}

html.az-no-scroll {
  overflow: hidden;
}

/* ------------------------------------------------------------------ */
/* Sticky header on all devices.                                       */
/* position:sticky on .az-site-header alone cannot work: it sits in    */
/* the template-part wrapper, which is exactly its own height, so it   */
/* has no room to stick. The wrapper itself must be the sticky box —   */
/* it spans the full page scroll inside .wp-site-blocks.               */
/* ------------------------------------------------------------------ */
.wp-site-blocks > header.wp-block-template-part {
  position: sticky;
  top: var(--wp-admin--admin-bar--height, 0px);
  z-index: 40;
}

/* On small screens WP's admin bar is absolute (it scrolls away), so
   the header pins to the very top. Guests are unaffected either way. */
@media (max-width: 600px) {
  .wp-site-blocks > header.wp-block-template-part {
    top: 0;
  }
}
