/*
 * BD Final Header — compact sticky rebuilt version.
 */

:root {
  --bdh-blue: #062763;
  --bdh-blue-dark: #031844;
  --bdh-gold: #d8ab44;
  --bdh-gold-light: #ffe8aa;
  --bdh-white: #ffffff;
  --bdh-cream: #fffaf0;
}

html {
  scroll-padding-top: 82px !important;
}

/* Shell */
html body header.bd-final-header-shell,
html body header.bd-final-header-shell *,
html body header.bd-final-header-shell *::before,
html body header.bd-final-header-shell *::after {
  box-sizing: border-box !important;
}

html body header.bd-final-header-shell {
  position: sticky !important;
  top: 0 !important;
  z-index: 999999 !important;
  width: 100% !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  background: rgba(255, 255, 255, 0.96) !important;
  backdrop-filter: blur(10px) saturate(1.08) !important;
  -webkit-backdrop-filter: blur(10px) saturate(1.08) !important;
  border: 0 !important;
  border-bottom: 3px solid var(--bdh-gold) !important;
  box-shadow: 0 8px 24px rgba(3, 24, 68, 0.12) !important;
  color: var(--bdh-blue) !important;
  overflow: visible !important;
}

/* Main row */
html body header.bd-final-header-shell .bd-final-header-inner {
  width: min(1480px, calc(100vw - 32px)) !important;
  min-height: 66px !important;
  margin: 0 auto !important;
  padding: 0.28rem 0 !important;
  display: grid !important;
  grid-template-columns: auto 1fr !important;
  gap: clamp(0.8rem, 2vw, 2rem) !important;
  align-items: center !important;
  background: transparent !important;
  overflow: visible !important;
}

/* Logo */
html body header.bd-final-header-shell .bd-final-logo {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 112px !important;
  min-width: 112px !important;
  text-decoration: none !important;
}

html body header.bd-final-header-shell .bd-final-logo img {
  display: block !important;
  max-width: 112px !important;
  max-height: 54px !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
}

html body header.bd-final-header-shell .bd-final-logo-text {
  color: var(--bdh-blue) !important;
  font-weight: 900 !important;
}

/* Nav */
html body header.bd-final-header-shell .bd-final-nav {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: clamp(0.42rem, 0.85vw, 0.9rem) !important;
  flex-wrap: wrap !important;
  overflow: visible !important;
  min-width: 0 !important;
  background: transparent !important;
}

/* Top links */
html body header.bd-final-header-shell .bd-final-top,
html body header.bd-final-header-shell summary.bd-final-top {
  appearance: none !important;
  -webkit-appearance: none !important;
  position: relative !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.18rem !important;
  min-height: 30px !important;
  margin: 0 !important;
  padding: 0.18rem 0.04rem !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: var(--bdh-blue) !important;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  font-size: clamp(13px, 0.82vw, 16px) !important;
  font-weight: 880 !important;
  line-height: 1 !important;
  letter-spacing: -0.012em !important;
  text-decoration: none !important;
  cursor: pointer !important;
  list-style: none !important;
  white-space: nowrap !important;
  text-shadow: none !important;
  box-shadow: none !important;
  transition: color 160ms ease, transform 160ms ease !important;
}

html body header.bd-final-header-shell summary.bd-final-top::-webkit-details-marker {
  display: none !important;
}

html body header.bd-final-header-shell .bd-final-dd {
  position: relative !important;
  display: inline-flex !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

/* CSS chevron */
html body header.bd-final-header-shell summary.bd-final-top::after {
  content: "" !important;
  width: 0.34rem !important;
  height: 0.34rem !important;
  margin-left: 0.12rem !important;
  border-right: 2px solid currentColor !important;
  border-bottom: 2px solid currentColor !important;
  transform: rotate(45deg) translateY(-2px) !important;
  transform-origin: center !important;
  transition: transform 160ms ease, border-color 160ms ease !important;
}

html body header.bd-final-header-shell details[open] > summary.bd-final-top::after {
  color: var(--bdh-gold) !important;
  border-color: var(--bdh-gold) !important;
  transform: rotate(225deg) translateY(-1px) !important;
}

/* Gold underline */
html body header.bd-final-header-shell .bd-final-top::before {
  content: "" !important;
  position: absolute !important;
  left: 0.08rem !important;
  right: 0.08rem !important;
  bottom: -0.08rem !important;
  height: 2px !important;
  border-radius: 999px !important;
  background: linear-gradient(90deg, transparent, var(--bdh-gold), var(--bdh-gold-light), var(--bdh-gold), transparent) !important;
  background-size: 220% 100% !important;
  opacity: 0 !important;
  transform: scaleX(0) !important;
  transition: opacity 180ms ease, transform 180ms ease !important;
}

html body header.bd-final-header-shell .bd-final-top:hover,
html body header.bd-final-header-shell .bd-final-top:focus,
html body header.bd-final-header-shell details[open] > .bd-final-top {
  color: var(--bdh-blue-dark) !important;
  transform: translateY(-1px) !important;
}

html body header.bd-final-header-shell .bd-final-top:hover::before,
html body header.bd-final-header-shell .bd-final-top:focus::before,
html body header.bd-final-header-shell details[open] > .bd-final-top::before {
  opacity: 1 !important;
  transform: scaleX(1) !important;
  animation: bdhGold 1.1s ease both !important;
}

/* Small sparkle */
html body header.bd-final-header-shell details[open] > .bd-final-top span::after,
html body header.bd-final-header-shell .bd-final-top:hover span::after {
  content: "✦" !important;
  position: absolute !important;
  top: -0.48rem !important;
  right: -0.28rem !important;
  color: var(--bdh-gold) !important;
  font-size: 0.44rem !important;
  text-shadow: 0 0 10px rgba(255, 232, 170, 0.95) !important;
  animation: bdhSparkle 1.1s ease-in-out infinite !important;
}

/* Dropdowns */
html body header.bd-final-header-shell .bd-final-panel {
  position: absolute !important;
  top: calc(100% + 0.42rem) !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  display: grid !important;
  gap: 0 !important;
  min-width: 168px !important;
  width: max-content !important;
  max-width: 250px !important;
  margin: 0 !important;
  padding: 0.28rem !important;
  border: 1px solid rgba(216, 171, 68, 0.62) !important;
  border-radius: 12px !important;
  background: rgba(255, 253, 248, 0.98) !important;
  box-shadow: 0 14px 34px rgba(3, 24, 68, 0.18) !important;
  z-index: 100001 !important;
}

html body header.bd-final-header-shell .bd-final-panel a,
html body header.bd-final-header-shell .bd-final-panel a:link,
html body header.bd-final-header-shell .bd-final-panel a:visited {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  min-height: 0 !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0.34rem 0.55rem !important;
  border-radius: 8px !important;
  background: transparent !important;
  color: var(--bdh-blue) !important;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  font-size: 13px !important;
  font-weight: 760 !important;
  line-height: 1.08 !important;
  letter-spacing: -0.01em !important;
  text-align: left !important;
  white-space: nowrap !important;
  text-decoration: none !important;
  text-shadow: none !important;
  box-shadow: none !important;
  transform: none !important;
}

html body header.bd-final-header-shell .bd-final-panel a:hover,
html body header.bd-final-header-shell .bd-final-panel a:focus {
  background: rgba(216, 171, 68, 0.14) !important;
  color: var(--bdh-blue-dark) !important;
}

/* Icons */
html body header.bd-final-header-shell .bd-final-icon {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  border: 1px solid rgba(216, 171, 68, 0.55) !important;
  border-radius: 999px !important;
  background: #fff !important;
  color: var(--bdh-blue) !important;
  font-size: 18px !important;
  font-weight: 900 !important;
  line-height: 1 !important;
  text-decoration: none !important;
  box-shadow: 0 8px 18px rgba(3, 24, 68, 0.08) !important;
}

html body header.bd-final-header-shell .bd-final-icon:hover {
  border-color: var(--bdh-gold) !important;
  box-shadow: 0 12px 26px rgba(216, 171, 68, 0.24) !important;
  transform: translateY(-1px) !important;
}

/* Kill any old nav leftovers */
html body header.bd-final-header-shell .bd-nav,
html body header.bd-final-header-shell nav.wp-block-navigation,
html body header.bd-final-header-shell .wp-block-navigation,
html body header.bd-final-header-shell .main-navigation {
  display: none !important;
}

/* Stop old WP block header spacing from expanding */
html body header.bd-final-header-shell [style*="padding-top"],
html body header.bd-final-header-shell [style*="padding-bottom"],
html body header.bd-final-header-shell .wp-block-group,
html body header.bd-final-header-shell .alignwide,
html body header.bd-final-header-shell .alignfull {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  min-height: 0 !important;
}

@keyframes bdhGold {
  0% { background-position: 0% 50%; filter: brightness(0.92); }
  50% { background-position: 100% 50%; filter: brightness(1.35); }
  100% { background-position: 50% 50%; filter: brightness(1); }
}

@keyframes bdhSparkle {
  0%, 100% { opacity: 0.55; transform: rotate(8deg) scale(0.9); }
  50% { opacity: 1; transform: rotate(20deg) scale(1.18); }
}

/* Responsive */
@media (max-width: 980px) {
  html {
    scroll-padding-top: 128px !important;
  }

  html body header.bd-final-header-shell .bd-final-header-inner {
    grid-template-columns: 1fr !important;
    justify-items: center !important;
    min-height: 88px !important;
    gap: 0.28rem !important;
    padding: 0.35rem 0 !important;
  }

  html body header.bd-final-header-shell .bd-final-logo {
    width: 98px !important;
    min-width: 98px !important;
  }

  html body header.bd-final-header-shell .bd-final-logo img {
    max-width: 98px !important;
    max-height: 46px !important;
  }

  html body header.bd-final-header-shell .bd-final-nav {
    justify-content: center !important;
    gap: 0.35rem 0.65rem !important;
  }

  html body header.bd-final-header-shell .bd-final-top,
  html body header.bd-final-header-shell summary.bd-final-top {
    font-size: 13px !important;
    min-height: 28px !important;
  }

  html body header.bd-final-header-shell .bd-final-panel {
    left: auto !important;
    right: 0 !important;
    transform: none !important;
  }
}

@media (max-width: 720px) {
  html {
    scroll-padding-top: 176px !important;
  }

  html body header.bd-final-header-shell .bd-final-header-inner {
    width: min(100% - 20px, 1480px) !important;
    min-height: 104px !important;
  }

  html body header.bd-final-header-shell .bd-final-nav {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    width: 100% !important;
    gap: 0.35rem !important;
  }

  html body header.bd-final-header-shell .bd-final-top,
  html body header.bd-final-header-shell summary.bd-final-top,
  html body header.bd-final-header-shell .bd-final-icon {
    width: 100% !important;
    justify-content: center !important;
    min-height: 32px !important;
    height: 32px !important;
    font-size: 12px !important;
  }

  html body header.bd-final-header-shell .bd-final-dd {
    display: block !important;
    width: 100% !important;
  }

  html body header.bd-final-header-shell .bd-final-panel {
    position: static !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 100% !important;
    transform: none !important;
    margin-top: 0.35rem !important;
  }

  html body header.bd-final-header-shell .bd-final-panel a {
    justify-content: center !important;
    white-space: normal !important;
    text-align: center !important;
  }

  html body header.bd-final-header-shell .bd-final-icon {
    width: 32px !important;
    min-width: 32px !important;
    margin-inline: auto !important;
  }
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  html body header.bd-final-header-shell {
    background: #ffffff !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  html body header.bd-final-header-shell *,
  html body header.bd-final-header-shell *::before,
  html body header.bd-final-header-shell *::after {
    animation: none !important;
    transition: none !important;
  }
}
