/* RIB360-PUBLIC-MENU-WARM-IVORY-AND-MOBILE-STICKY-CORRECTION-HR1-MENU1
   Global public-menu colour and reliable mobile sticky-header behaviour.
   Desktop remains sticky through the existing canonical shell rules.
   Mobile progressively upgrades to a measured fixed-header fallback when JavaScript is available. */

:root {
  --rib360-menu1-bg: #fffaf2;
  --rib360-menu1-bg-translucent: rgba(255, 250, 242, .975);
  --rib360-menu1-border: #eee2cf;
  --rib360-menu1-text: #1d2b42;
  --rib360-menu1-active: #9c5d00;
  --rib360-menu1-hover: #fff1d5;
  --rib360-mobile-header-height: 0px;
}

/* Global balancing colour. */
html body .rib360-public-header.rib360-public-discovery-header {
  background: var(--rib360-menu1-bg-translucent) !important;
  border-bottom: 1px solid var(--rib360-menu1-border) !important;
  box-shadow: 0 4px 16px rgba(16, 24, 40, .06) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
}

html body .rib360-public-header.rib360-public-discovery-header .rib360-public-discovery-shell,
html body .rib360-public-header.rib360-public-discovery-header .rib360-oei1-s3-action-directory-shell,
html body .rib360-public-header.rib360-public-discovery-header .rib360-public-category-nav {
  background: transparent !important;
}

html body .rib360-public-header.rib360-public-discovery-header .rib360-public-search-field {
  background: #fff !important;
}

html body .rib360-public-header.rib360-public-discovery-header .rib360-public-category-track a,
html body .rib360-public-header.rib360-public-discovery-header .rib360-oei1-s3-directory summary {
  color: var(--rib360-menu1-text) !important;
}

html body .rib360-public-header.rib360-public-discovery-header .rib360-public-category-track a:hover,
html body .rib360-public-header.rib360-public-discovery-header .rib360-public-category-track a:focus-visible,
html body .rib360-public-header.rib360-public-discovery-header .rib360-oei1-s3-directory summary:hover,
html body .rib360-public-header.rib360-public-discovery-header .rib360-oei1-s3-directory summary:focus-visible {
  background: var(--rib360-menu1-hover) !important;
  color: var(--rib360-menu1-active) !important;
}

html body .rib360-public-header.rib360-public-discovery-header .rib360-public-category-track a.is-active,
html body .rib360-public-header.rib360-public-discovery-header .rib360-public-category-track a[aria-current="page"] {
  color: var(--rib360-menu1-active) !important;
}

/* Created dynamically by the mobile sticky controller. Hidden outside mobile. */
.rib360-public-mobile-header-spacer {
  display: none;
  width: 100%;
  height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  pointer-events: none;
}

@media (max-width: 720px) {
  /* No-JS fallback remains position:sticky. */
  html body .rib360-public-header.rib360-public-discovery-header {
    position: -webkit-sticky !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 2140 !important;
    background: rgba(255, 250, 242, .992) !important;
    isolation: isolate;
  }

  /* Reliable iOS/Android fallback: fixed header plus a measured spacer. */
  html.rib360-mobile-menu-fixed body .rib360-public-header.rib360-public-discovery-header {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    left: 0 !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding-top: env(safe-area-inset-top, 0px) !important;
    z-index: 2140 !important;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
  }

  html.rib360-mobile-menu-fixed body .rib360-public-mobile-header-spacer {
    display: block;
    height: var(--rib360-mobile-header-height) !important;
    min-height: var(--rib360-mobile-header-height) !important;
    flex: 0 0 var(--rib360-mobile-header-height) !important;
  }

  /* Keep the menu visually opaque while page content scrolls below it. */
  html.rib360-mobile-menu-fixed body .rib360-public-header.rib360-public-discovery-header::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: rgba(255, 250, 242, .992);
    pointer-events: none;
  }
}

@media (prefers-reduced-transparency: reduce) {
  html body .rib360-public-header.rib360-public-discovery-header {
    background: var(--rib360-menu1-bg) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
}
