/**
 * Sticky Astra header.
 *
 * Keeps Astra's outer header fixed while JS updates --ib-header-height
 * to the measured header height for accurate content and anchor offsets.
 */

:root {
  --ib-header-height: 72px;
  --ib-header-top-offset: 0px;
  --ib-header-bg: rgba(255, 255, 255, 0.92);
}

html {
  scroll-padding-top: calc(var(--ib-header-height, 80px) + var(--ib-header-top-offset, 0px));
}

:target {
  scroll-margin-top: calc(var(--ib-header-height, 80px) + var(--ib-header-top-offset, 0px));
}

body {
  padding-top: var(--ib-header-height, 80px);
}

body.admin-bar {
  --ib-header-top-offset: 32px;
}

#masthead.site-header {
  position: fixed;
  top: var(--ib-header-top-offset, 0px);
  left: 0;
  right: 0;
  z-index: 999;
  width: 100%;
  background: var(--ib-header-bg);
  border-bottom: 1px solid rgba(13, 28, 50, 0.08);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 1px 2px rgba(13, 28, 50, 0.03);
  transition: box-shadow 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
}

.ast-theme-transparent-header #masthead.site-header {
  background: var(--ib-header-bg);
}

#masthead.site-header.is-scrolled {
  box-shadow: 0 10px 30px rgba(13, 28, 50, 0.08);
}

#masthead.site-header .ast-primary-header-bar,
#masthead.site-header .main-header-bar {
  min-height: 72px;
  transition: min-height 0.3s ease, padding-top 0.3s ease, padding-bottom 0.3s ease;
}

#masthead.site-header.is-scrolled .ast-primary-header-bar,
#masthead.site-header.is-scrolled .main-header-bar {
  min-height: 64px;
}

.ast-header-break-point #masthead.site-header .ast-mobile-header-content,
.ast-header-break-point #masthead.site-header .ast-desktop-header-content {
  max-height: calc(100vh - var(--ib-header-height, 80px) - var(--ib-header-top-offset, 0px));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 921px) {
  :root {
    --ib-header-height: 64px;
  }

  #masthead.site-header .ast-primary-header-bar,
  #masthead.site-header .main-header-bar {
    min-height: 64px;
  }

  #masthead.site-header.is-scrolled .ast-primary-header-bar,
  #masthead.site-header.is-scrolled .main-header-bar {
    min-height: 58px;
  }
}

@media (max-width: 782px) {
  body.admin-bar {
    --ib-header-top-offset: 46px;
  }
}
