/* Critical header overrides to ensure dropdown styling remains consistent after platform CSS loads. */
.bpg-header .divider-vertical { display: none !important; }
.bpg-header .nav-link .bar,
.bpg-header .dropdown-split-toggle .bar { display: none !important; }

.bpg-header .dropdown-menu {
  /* hidden initial state with slight upward offset for slide-in */
  opacity: 0 !important;
  visibility: hidden !important;
  transform: translateY(-8px) translateZ(0) !important;
  pointer-events: none !important; /* avoid accidental mouse capture when hidden */
  z-index: 1020 !important; /* ensure dropdown sits above other content */
  will-change: opacity, transform !important;
  /* default hide delay (prevents instant hide on accidental mouseout) */
  transition: opacity 320ms cubic-bezier(.2,.9,.2,1) 120ms, transform 320ms cubic-bezier(.2,.9,.2,1) 120ms !important;
  margin-top: 0 !important; /* remove gap to avoid mouseout between trigger and menu */
  background: #fff !important;
  border-radius: 6px !important;
  box-shadow: 0 10px 30px rgba(0,0,0,0.08) !important;
  transform-origin: top center !important;
}

/* Show immediately on hover/focus or when the JS .show class is present */
.bpg-header .nav-item.weblink.dropdown:hover > .dropdown-menu,
.bpg-header .nav-item.weblink.dropdown:focus-within > .dropdown-menu,
.bpg-header .nav-item.dropdown:hover > .dropdown-menu,
.bpg-header .nav-item.dropdown:focus-within > .dropdown-menu,
.bpg-header .nav-item.weblink.dropdown .dropdown-menu:hover,
.bpg-header .nav-item.dropdown .dropdown-menu:hover,
.bpg-header .nav-item:hover > .dropdown-menu,
.bpg-header .nav-item:focus-within > .dropdown-menu,
.bpg-header .dropdown-menu.show {
  transition-delay: 0ms !important; /* cancel hide delay when showing */
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateY(0) !important;
  pointer-events: auto !important;
}

/* Small invisible hover buffer beneath nav items to reduce flicker when moving pointer to menu */
.bpg-header .nav-item { position: relative; }
.bpg-header .nav-item.has-children::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  /* overlap slightly with the dropdown to prevent any mouse gap */
  top: calc(100% - 6px);
  height: 40px; /* larger buffer to give users room to move */
  pointer-events: auto; /* allow the buffer to capture hover so the menu doesn't close */
  background: transparent; /* transparent buffer */
  z-index: 1999; /* sit just below the dropdown menu */
}

/* Nudge the dropdown a little higher so it overlaps the buffer and removes gaps */
.bpg-header .dropdown-menu {
  top: calc(100% - 6px) !important;
}

.bpg-header .dropdown-menu .dropdown-divider { display: none !important; }
.bpg-header .nav-item.weblink.dropdown:hover > .dropdown-menu .dropdown-divider,
.bpg-header .nav-item.dropdown:hover > .dropdown-menu .dropdown-divider {
  display: block !important;
}

.bpg-header .dropdown-split-toggle,
.bpg-header .dropdown-split-toggle::before,
.bpg-header .dropdown-split-toggle::after {
  border: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  content: none !important;
  width: auto !important;
  height: auto !important;
  min-width: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  display: inline-block !important;
}

.bpg-header .dropdown-split-toggle .caret { display: none !important; }
.bpg-header .nav-link .caret { display: inline-block !important; }

.bpg-header .dropdown-split-toggle,
.bpg-header .dropdown-split-toggle::after,
.bpg-header .dropdown-split-toggle::before {
  border-bottom: 0 !important;
  outline: none !important;
  box-shadow: none !important;
}

/* Critical: ensure navbar elements remain visible if a later theme overrides them.
   Scoped to desktop only to allow Bootstrap collapse to work on mobile. */
@media (min-width: 992px) {
  .bpg-header .navbar-collapse {
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
    display: flex !important;
    justify-content: center;
  }

  .bpg-header .navbar-nav,
  .bpg-header .nav-item,
  .bpg-header .nav-link {
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
  }
  .bpg-header .navbar-nav {
    display: flex !important;
    flex-direction: row !important;
  }
  .bpg-header .nav-item {
    display: flex !important;
    align-items: center !important;
  }
  .bpg-header .nav-link {
    display: inline-flex !important;
    align-items: center !important;
  }
}

/* Sign-in button alignment: keep static on small screens to avoid overlap with the hamburger */
@media (max-width: 991.98px) {
/* Keep only mobile-scoped overrides for the auth item so desktop grid placement
   governed by header.styles.css is not defeated by this high-specificity file. */
@media (max-width: 991.98px) {
  .bpg-header .nav-item-auth { right: auto !important; position: static !important; margin-left: 0 !important; }
  body .bpg-header .nav-item-auth { right: auto !important; position: static !important; margin-left: 0 !important; }
  body.bpg-header .nav-item-auth { right: auto !important; position: static !important; margin-left: 0 !important; }
  .bpg-header .bpg-signin-btn { display: inline-flex !important; align-items: center !important; justify-content: center !important; }
  .bpg-signin-btn:hover, .bpg-signin-btn:focus { transform: none !important; }
}
/* Ensure sign-in visually aligns with nav links on desktop */
@media (min-width: 992px) {
  .bpg-header .nav-item-auth { display:flex !important; align-items:center !important; }
  .bpg-header .nav-item-auth .bpg-signin-btn { margin: 0 !important; vertical-align: middle !important; }
}

/* Remove any accidental gap below the header and ensure the first page block is flush */
.bpg-header {
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}

/* When content immediately follows the header, remove extra top spacing from that first sibling */
.bpg-header + * {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* Specific: collapse top padding on the common section row used across pages */
.bpg-header + .row.sectionBlockLayout,
.bpg-header + section.page_section,
.bpg-header + .page-header {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* Remove legacy title/nav spacing rules (title removed in redesign) and legacy logo size */
.bpg-header .bpg-header-logo-link { display:inline-flex; align-items:center; }
.navbar-header .bpg-logo-block + .bpg-logo-block { display:none !important; }
/* Title block suppressed; ensure any residual styles hidden */
.bpg-header .bpg-site-title, .bpg-header .bpg-site-title-text { display:none !important; }

/* Modern alignment overrides (added post-initial styles so they win specificity) */
.bpg-header .container.custom-container { gap:32px !important; }
.bpg-header nav.menu-bar .navbar-nav { padding-right:0 !important; gap:28px !important; }

/* Ensure .nav-item-auth is static only on small screens (so the hamburger and stacked nav don't overlap).
   On desktop the main stylesheet places the auth item in the right grid column; keep that behavior. */
@media (max-width: 991.98px) {
  .bpg-header .nav-item-auth { position: static !important; right: auto !important; top: auto !important; transform:none !important; margin-left: auto !important; }
}

/* Ensure centered title doesn't block interaction on small screens */
@media (max-width: 991.98px) {
  .bpg-header .bpg-site-title { position: static !important; transform: none !important; pointer-events: auto !important; width: auto !important; margin-left: 16px !important; }
}

/* Remove previous centering overrides; grid + spacer handles centering now. Keep only dropdown + interaction tweaks here. */
