/* Header part styles scoped to the shared header structure. */
.temba-site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(8px);
  background: color-mix(
    in srgb,
    var(--wp--preset--color--background) 86%,
    transparent
  );
  border-bottom: 1px solid
    color-mix(in srgb, var(--wp--preset--color--border) 20%, transparent);
}

.temba-site-header .temba-site-header__inner {
  min-height: 64px;
}

.temba-site-header .temba-site-header__brand {
  gap: 0.5rem;
}

/* Override Gutenberg's .is-default-size 120px width in header only. */
.temba-site-header .wp-block-site-logo img,
.temba-site-header .wp-block-site-logo.is-default-size img {
  width: auto;
  height: auto;
  max-height: 56px;
  display: block;
}

@media (max-width: 781px) {
  .temba-site-header .temba-site-header__inner {
    min-height: 58px;
  }

  .temba-site-header .wp-block-site-logo img,
  .temba-site-header .wp-block-site-logo.is-default-size img {
    max-height: 44px;
  }
}

/* Front-page-only header variation with progressive scroll state. */
.temba-site-header-frontpage {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  width: 100%;
  backdrop-filter: blur(var(--temba-header-blur, 0px));
  border-bottom: 1px solid;
  border-bottom-color: color-mix(
    in srgb,
    var(--wp--preset--color--border) var(--temba-header-border-pct, 0%),
    transparent
  );
  background: transparent;
  background-color: color-mix(
    in srgb,
    var(--wp--preset--color--background) var(--temba-header-solid-pct, 0%),
    transparent
  );
  transition:
    background-color 220ms ease,
    border-color 220ms ease,
    backdrop-filter 220ms ease;
}

.temba-site-header-frontpage .temba-site-header__inner {
  min-height: clamp(72px, 9vw, 110px);
}

.temba-site-header-frontpage .wp-block-navigation-item__content,
.temba-site-header-frontpage .wp-block-navigation__responsive-container-open,
.temba-site-header-frontpage .wp-block-navigation-submenu__toggle,
.temba-site-header-frontpage .wp-block-site-logo + .wp-block-site-title a,
.temba-site-header-frontpage .wp-block-site-title a {
  color: var(--wp--preset--color--background);
}

/* Keep hero flush to the viewport top under the fixed front-page header. */
.wp-site-blocks > .temba-frontpage-header-part + main {
  margin-block-start: 0 !important;
}

.temba-site-header-frontpage.is-scrolled {
  backdrop-filter: blur(var(--temba-header-blur, 8px));
}

.temba-site-header-frontpage.is-scrolled .wp-block-navigation-item__content,
.temba-site-header-frontpage.is-scrolled
  .wp-block-navigation__responsive-container-open,
.temba-site-header-frontpage.is-scrolled .wp-block-navigation-submenu__toggle,
.temba-site-header-frontpage.is-scrolled
  .wp-block-site-logo
  + .wp-block-site-title
  a,
.temba-site-header-frontpage.is-scrolled .wp-block-site-title a {
  color: var(--wp--preset--color--primary-text);
}

@media (prefers-reduced-motion: reduce) {
  .temba-site-header-frontpage {
    transition: none;
  }
}

@media (max-width: 781px) {
  .temba-site-header-frontpage .temba-site-header__inner {
    min-height: 66px;
  }
}
