/* The compact site menu (Views/Shared/_CompactMenu): on Waves and the Chat page
   a member can keep the full header, swap it for one slim line, or hide it,
   leaving a small menu button. compact-menu.js switches it and remembers the
   choice per page; _CompactMenuHead sets it on <html> before the page paints.
   The class names began on Waves (wv-), and are kept so nothing else moves. */

.wv-topbar,
.wv-menu-fab {
  --wv-ink: var(--bb-sage-900);
  --wv-text: #3d4536;
  --wv-line: var(--bb-sage-200);
}

/* Compact: the site's header and menu bar give way to one slim line (.wv-topbar).
   Hidden: only a small menu button stays, top right. */
html.wv-menu-compact .site-header,
html.wv-menu-compact .site-subheader,
html.wv-menu-hidden .site-header,
html.wv-menu-hidden .site-subheader {
  display: none;
}

.wv-topbar,
.wv-menu-fab {
  display: none;
}

html.wv-menu-compact .wv-topbar {
  display: flex;
}

html.wv-menu-hidden .wv-menu-fab {
  display: flex;
}

.wv-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.9rem;
  padding: 0.35rem 0.45rem 0.35rem 0.9rem;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border: 1px solid var(--wv-line);
  border-radius: 999px;
  box-shadow: 0 6px 18px rgba(30, 58, 138, 0.08);
}

.wv-topbar-brand {
  flex-shrink: 0;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  color: var(--bb-blue-700);
  text-decoration: none;
}

.wv-topbar-brand span {
  color: var(--bb-sage-600);
}

.wv-topbar-links {
  display: flex;
  flex: 1 1 auto;
  gap: 0.1rem;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.wv-topbar-links::-webkit-scrollbar {
  display: none;
}

.wv-topbar-links a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 0.7rem;
  border-radius: 999px;
  color: var(--wv-text);
  font-size: 0.86rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.wv-topbar-links a:hover {
  background: var(--bb-sage-100);
  color: var(--wv-ink);
}

/* Finds in gold, like its button in the full menu bar (site.css .header-finds-btn). */
.wv-topbar-links a.wv-topbar-finds {
  background: #b8901f;
  color: #fff;
}

.wv-topbar-links a.wv-topbar-finds:hover,
.wv-topbar-links a.wv-topbar-finds:focus-visible {
  background: #977518;
  color: #fff;
}

.wv-topbar-links a.is-active {
  background: #1e3a8a;
  color: #fff;
}

.wv-topbar-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--wv-text);
  cursor: pointer;
}

.wv-topbar-icon svg {
  width: 18px;
  height: 18px;
}

.wv-topbar-icon:hover {
  background: var(--bb-sage-100);
  color: var(--wv-ink);
}

/* Who's signed in: initial, a green "online" dot and the first name. */
.wv-topbar-me {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
  max-width: 11rem;
  padding: 0.2rem 0.75rem 0.2rem 0.2rem;
  border: 1px solid var(--wv-line);
  border-radius: 999px;
  background: var(--bb-sage-100);
  color: var(--wv-ink);
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
}

.wv-topbar-me:hover {
  color: var(--wv-ink);
  border-color: var(--bb-sage-600);
}

.wv-topbar-me-avatar {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--bb-gold-500);
  color: var(--bb-blue-900);
  font-size: 0.9rem;
  font-weight: 800;
}

.wv-topbar-me-dot {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 2px #fff;
  animation: wv-online 2.4s ease-in-out infinite;
}

@keyframes wv-online {
  0%, 100% { box-shadow: 0 0 0 2px #fff, 0 0 0 2px rgba(34, 197, 94, 0.45); }
  50% { box-shadow: 0 0 0 2px #fff, 0 0 0 6px rgba(34, 197, 94, 0); }
}

.wv-topbar-me-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* The account menu under the name: Profile and Sign out. */
.wv-topbar-account {
  position: relative;
  flex-shrink: 0;
}

.wv-topbar-account > summary {
  list-style: none;
  cursor: pointer;
}

.wv-topbar-account > summary::-webkit-details-marker {
  display: none;
}

.wv-topbar-me-chevron {
  width: 13px;
  height: 13px;
  margin-left: -0.15rem;
  color: var(--bb-sage-700);
  transition: transform 0.15s;
}

.wv-topbar-account[open] .wv-topbar-me-chevron {
  transform: rotate(180deg);
}

.wv-topbar-account-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 35;
  display: flex;
  flex-direction: column;
  width: 230px;
  padding: 0.4rem;
  border: 1px solid var(--wv-line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.16);
}

.wv-topbar-account-who {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 0.45rem 0.6rem 0.6rem;
  margin-bottom: 0.3rem;
  border-bottom: 1px solid var(--bb-sage-100);
  line-height: 1.3;
}

.wv-topbar-account-who strong {
  color: var(--wv-ink);
  font-size: 0.9rem;
}

.wv-topbar-account-who span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--bb-sage-700);
  font-size: 0.78rem;
}

.wv-topbar-account-menu form {
  margin: 0;
}

.wv-topbar-account-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.5rem 0.6rem;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--wv-ink);
  font-size: 0.88rem;
  font-weight: 600;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.wv-topbar-account-item:hover {
  background: var(--bb-sage-100);
  color: var(--wv-ink);
}

.wv-topbar-account-item svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

.wv-topbar-signin {
  flex-shrink: 0;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  background: var(--bb-blue-600);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
}

.wv-topbar-signin:hover {
  color: #fff;
  background: var(--bb-blue-700);
}

.wv-menu-fab {
  position: fixed;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 40;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--wv-line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  color: var(--wv-ink);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.14);
  cursor: pointer;
}

.wv-menu-fab svg {
  width: 20px;
  height: 20px;
}

/* The switch (full, compact, hidden) on a light background, as on the Chat
   page. Waves has its own in the banner (.wv-viewswitch, waves.css). */
.menu-switch {
  display: inline-flex;
  flex-shrink: 0;
  padding: 3px;
  border: 1px solid var(--bb-sage-200);
  border-radius: 999px;
  background: var(--bb-sage-100);
}

.menu-switch button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--bb-sage-700);
  cursor: pointer;
}

.menu-switch button svg {
  width: 15px;
  height: 15px;
}

.menu-switch button:hover {
  color: var(--bb-sage-900);
}

.menu-switch button[aria-pressed="true"] {
  background: #fff;
  color: #1e3a8a;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
}

@media (max-width: 767.98px) {
  .wv-topbar {
    border-radius: 1rem;
    padding-left: 0.7rem;
  }

  /* Just the initial and its dot. */
  .wv-topbar-me {
    padding: 0.15rem;
  }

  .wv-topbar-me-name,
  .wv-topbar-me-chevron {
    display: none;
  }

  /* With the menu hidden, its button sits low on the right, above "back to top". */
  .wv-menu-fab {
    top: auto;
    bottom: 4.6rem;
    right: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wv-topbar-me-dot {
    animation: none;
  }
}
