/* The public banner remains in document flow and stays above section content. */
html:has([data-nexa-sticky-header]){
  scroll-padding-top:calc(var(--nexa-public-header-height, 230px) + 8px);
}
[data-nexa-sticky-header]{
  position:sticky;
  top:0;
  z-index:60;
}
[data-nexa-sticky-header].site-header,
#nexa-referral [data-nexa-sticky-header]>.site-header{
  background:#fff;
}
.nexa-public>.skip:focus,
[data-agent-profile]>.skip-link:focus,
#nexa-referral>.skip-link:focus{
  position:fixed;
}
.nexa-public .layout>.sidebar,
.nexa-story-page .nexa-story__nav{
  top:calc(var(--nexa-public-header-height, 230px) + 22px);
}

/* Keep the existing mobile menus usable without covering the whole viewport. */
#nexa-referral [data-nexa-sticky-header] .mobile-nav:not([hidden]){
  position:absolute;
  inset:100% 0 auto;
  max-height:calc(100vh - var(--nexa-public-header-height, 180px));
  max-height:calc(100dvh - var(--nexa-public-header-height, 180px));
  overflow-y:auto;
  overscroll-behavior-y:contain;
  box-shadow:0 8px 18px #132d4026;
}
[data-agent-profile] [data-nexa-sticky-header] .mobile-menu nav{
  max-height:calc(100vh - var(--nexa-public-header-height, 160px));
  max-height:calc(100dvh - var(--nexa-public-header-height, 160px));
  overflow-y:auto;
  overscroll-behavior-y:contain;
}

/* Make room for the guide links on phones and for content on short screens. */
@media(max-width:760px), (max-height:580px){
  body.nexa-public [data-nexa-sticky-header].site-header,
  body.nexa-public #nexa-referral [data-nexa-sticky-header] .site-header,
  body[data-agent-profile] [data-nexa-sticky-header].site-header{
    --nexa-sticky-logo-width:106px;
  }
  body.nexa-public [data-nexa-sticky-header].site-header .brand,
  body.nexa-public #nexa-referral [data-nexa-sticky-header] .site-header .brand,
  body[data-agent-profile] [data-nexa-sticky-header].site-header .brand{
    width:var(--nexa-sticky-logo-width);
    height:65px;
  }
  body.nexa-public [data-nexa-sticky-header].site-header .brand img,
  body.nexa-public #nexa-referral [data-nexa-sticky-header] .site-header .brand img,
  body[data-agent-profile] [data-nexa-sticky-header].site-header .brand img{
    width:var(--nexa-sticky-logo-width);
    height:auto;
  }
  body.nexa-public [data-nexa-sticky-header].site-header .header-inner,
  body.nexa-public #nexa-referral [data-nexa-sticky-header] .site-header .header-inner,
  body[data-agent-profile] [data-nexa-sticky-header].site-header .header-inner{
    min-height:0;
  }
  /* The guide index and articles use a multi-row nav rather than a menu. */
  body.nexa-public>[data-nexa-sticky-header].site-header{
    max-height:62vh;
    max-height:62dvh;
    overflow-y:auto;
  }
}
@media(max-width:350px){
  body.nexa-public #nexa-referral [data-nexa-sticky-header] .site-header{
    --nexa-sticky-logo-width:88px;
  }
}
@media(prefers-reduced-motion:reduce){
  html:has([data-nexa-sticky-header]){scroll-behavior:auto}
}
