/* Keep a constant layout slot while the inner bar becomes compact. */
html {
  --amaxa-header-height: 88px;
  scroll-padding-top: calc(
    var(--amaxa-header-height) + var(--amaxa-admin-offset, 0px) + 12px
  );
}
.site-header {
  position: sticky;
  top: var(--amaxa-admin-offset, 0px);
  z-index: 100;
  isolation: isolate;
  width: 100%;
  height: var(--amaxa-header-height);
  padding-block: 0;
  transition:
    background-color 0.3s ease,
    padding 0.3s ease,
    box-shadow 0.3s ease;
}
body.admin-bar .site-header {
  top: var(--amaxa-admin-offset, 32px);
}
/* The centered container holds content; the header owns the full-width surface. */
.site-header .header-inner {
  position: relative;
  background: transparent;
  padding-inline: 0;
  border: 0;
  border-radius: 0;
  transition: min-height 0.3s ease;
}
/* Blur only the decorative layer, preserving fixed mobile-menu positioning. */
.site-header::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  background: #f0f6fd;
  opacity: 0;
  pointer-events: none;
  content: "";
  transition: opacity 0.3s ease;
}
.site-header.is-scrolled::before {
  opacity: 1;
}
@supports (
  (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))
) {
  .site-header.is-scrolled::before {
    background: rgb(240 246 253 / 58%);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    backdrop-filter: blur(18px) saturate(160%);
  }
}
.site-header .brand img {
  transition: width 0.3s ease;
}
.site-header.is-scrolled {
  padding-block: 8px;
  background: transparent;
  box-shadow: 0 8px 28px #09235114;
}
.site-header.is-scrolled .header-inner {
  background: transparent;
  min-height: 72px;
  padding-inline: 0;
}
.site-header.is-scrolled .brand img {
  width: 132px;
}
/* The fullscreen panel must not inherit a transform, filter, or clipping ancestor. */
@media (max-width: 1023px) {
  html {
    --amaxa-header-height: 72px;
  }
  /* Keep the mobile header geometry identical at rest, on scroll and in the menu. */
  .site-header,
  .site-header.is-scrolled {
    padding-block: 0;
  }
  .site-header .header-inner,
  .site-header.is-scrolled .header-inner {
    min-height: var(--amaxa-header-height);
    padding-inline: 0;
    border-width: 0;
  }
  .site-header .brand img,
  .site-header.is-scrolled .brand img {
    width: 130px;
  }

  /* Full-width mobile frame matching desktop; retain the 72px slot to avoid layout jumps. */
  .site-header::before {
    border: 1px solid transparent;
    border-radius: 0;
    transition:
      opacity 0.3s ease,
      inset 0.3s ease,
      border-radius 0.3s ease,
      border-color 0.3s ease,
      box-shadow 0.3s ease;
  }

  .site-header.is-scrolled {
    box-shadow: none;
  }

  .site-header.is-scrolled::before {
    inset: 8px 0;
    border-color: rgb(255 255 255 / 65%);
    border-radius: 16px;
    box-shadow: 0 8px 28px #09235114;
  }
}
@media (max-width: 782px) {
  body.admin-bar .site-header {
    top: var(--amaxa-admin-offset, 46px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .site-header,
  .site-header .header-inner,
  .site-header::before,
  .site-header .brand img {
    transition: none !important;
  }
}
.site-header .brand .custom-logo {
  transition:
    width 0.3s ease,
    transform 0.35s ease,
    filter 0.35s ease;
}
@media (max-width: 1023px) {
  .has-menu-js .site-header .primary-navigation {
    top: var(--amaxa-admin-offset, 0px);
    height: calc(100vh - var(--amaxa-admin-offset, 0px));
    height: calc(100dvh - var(--amaxa-admin-offset, 0px));
  }
}
@media (prefers-reduced-motion: reduce) {
  .site-header .brand .custom-logo {
    transition: none !important;
  }
}

/* Desktop: the full-width frame appears only after scrolling. */
@media (min-width: 1024px) {
  .site-header {
    padding-block: 0;
    background: transparent;
    box-shadow: none;
  }

  .site-header .header-inner {
    min-height: 88px;
  }

  .site-header::before {
    inset: 0;
    border: 1px solid transparent;
    border-radius: 0;
    opacity: 1;
    background: #f0f6fd;
    transition:
      inset 0.3s ease,
      border-radius 0.3s ease,
      background-color 0.3s ease,
      border-color 0.3s ease,
      box-shadow 0.3s ease;
  }

  .site-header.is-scrolled {
    padding-block: 8px;
    box-shadow: none;
  }

  .site-header.is-scrolled .header-inner {
    min-height: 72px;
  }

  .site-header.is-scrolled::before {
    inset: 8px 0;
    border-color: rgb(255 255 255 / 65%);
    border-radius: 16px;
    box-shadow: 0 8px 28px #09235114;
  }

  .site-header--home {
    margin-bottom: calc(-1 * var(--amaxa-header-height));
  }

  .site-header--home:not(.is-scrolled)::before {
    background: transparent;
  }

  @supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
    .site-header.is-scrolled::before {
      background: rgb(240 246 253 / 58%);
    }
  }
}
