/* ============================================================
   HEADER � CLEAN + RESPONSIVE
============================================================ */

/* ------------------------------------------------------------
   MAIN HEADER BAR
------------------------------------------------------------ */

#bg-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--bg-white);
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
  overflow: visible;
}

/* When the welcome banner is visible and stuck, offset the header so it doesn't overlap/crop the logo */
#bg-welcome-banner + #bg-header {
  top: 44px;
}

/* When the banner is hidden (translated out), let the header return to the top */
#bg-welcome-banner.hidden + #bg-header {
  top: 0;
}

/* Inner container */
.bg-header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.7rem 1.2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.6rem;
}

/* ------------------------------------------------------------
   LOGO
------------------------------------------------------------ */

.bg-site-logo {
  display: flex;
  align-items: center;
  justify-content: center;
}

.bg-site-logo img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  aspect-ratio: 1 / 1;
  background: var(--bg-white);
  transition: transform 0.2s ease;
  object-fit: contain;
}

.bg-site-logo img:hover {
  transform: scale(1.05);
}

/* ------------------------------------------------------------
   HEADER ACTIONS
------------------------------------------------------------ */

.bg-header-right {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

/* Tools + notifications icon cluster */
#bg-header .bg-notification-bell {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

#bg-header .bg-notification-bell .bg-bell-tools,
#bg-header .bg-notification-bell .bg-bell-notifications {
  line-height: 1;
}

/* Logged-out account dropdown (uses assets/js/account.js) */
.bg-header-menu {
  position: relative;
  display: inline-flex;
}

.bg-header-menu .bg-account-menu {
  width: 240px;
  max-height: none;
}

.bg-header-menu.is-open .bg-account-menu {
  display: block;
}

.bg-header-learning .bg-account-menu {
  width: 280px;
}

.bg-header-menu-note {
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--text-secondary);
  padding: 2px 2px 8px;
}

/* Ensure consistent button height across links + buttons */
.bg-header-right .bg-btn,
.bg-header-right button.bg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  line-height: 1;
  transition: all 0.2s ease;
}

/* ------------------------------------------------------------
   WELCOME BANNER
------------------------------------------------------------ */

#bg-welcome-banner {
  background: #FFF980;
  border-bottom: 1px solid #111;
  text-align: center;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: #111;
  position: sticky;
  top: 0;
  z-index: 1001;
  transition: transform 0.4s ease, opacity 0.3s ease;
}

#bg-welcome-banner p {
  margin: 0;
}

#bg-welcome-banner.hidden {
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
}

/* ------------------------------------------------------------
   BODY OFFSET FOR BANNER
------------------------------------------------------------ */

body {
  transition: padding-top 0.3s ease;
}

body.has-banner {
  padding-top: 120px;
}

body.no-banner {
  padding-top: 80px;
}

/* ------------------------------------------------------------
   MOBILE TWEAKS
------------------------------------------------------------ */

@media (max-width: 700px) {
  #bg-header {
    text-align: left;
  }

  .bg-header-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 0.45rem 0.65rem;
  }

  .bg-header-left {
    display: flex;
    justify-content: flex-start;
    flex: 0 0 auto;
  }

  .bg-site-logo img {
    width: 56px;
    height: 56px;
  }

  .bg-header-right {
    flex: 1 1 auto;
    width: auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 6px;
  }

  .bg-header-right .bg-btn,
  .bg-header-right button.bg-btn {
    height: 32px;
    padding: 6px 10px;
    font-size: 13px;
    width: auto;
  }

  .bg-header-right .bg-notification-bell {
    width: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 4px 6px;
    font-size: 17px;
    line-height: 1;
  }

  .bg-header-right .bg-social-menu,
  .bg-header-right .bg-header-menu {
    width: auto;
    display: inline-flex;
  }

  .bg-header-right .bg-social-menu > .bg-btn,
  .bg-header-right .bg-header-menu > .bg-btn {
    width: auto;
  }

  .bg-header-right .bg-header-menu {
    justify-content: flex-end;
  }

  /* Keep header dropdowns fully on-screen on phones.
     Remove the local positioning context from each button wrapper so the
     dropdown anchors to #bg-header (sticky, full-viewport-width) instead
     of the button. That makes right:0 mean "flush with the viewport right
     edge" regardless of where the button happens to sit in the header. */
  #bg-header .bg-header-menu {
    position: static;
  }

  #bg-header .bg-header-right .bg-notification-dropdown,
  #bg-header .bg-social-menu .bg-social-dropdown,
  #bg-header .bg-header-menu .bg-account-menu {
    width: min(360px, calc(100vw - 16px));
    max-width: calc(100vw - 16px);
    max-height: min(70vh, 420px);
    left: auto;
    right: 8px;
    transform: none;
  }

  #bg-welcome-banner {
    padding: 0.35rem 0.65rem;
    font-size: 0.8rem;
  }

  #bg-welcome-banner + #bg-header {
    top: 36px;
  }

}


/* Search button - always styled as donate variant */
