/* nav.css — grouped primary navigation (Research / My League dropdowns) that
 * replaces the flat link row in the header. Mirrors the old .nav-links pills
 * so the look is consistent, and reuses the base.css tokens. The gated My
 * League group keeps the .only-personal-link class, so the existing
 * `body.guest-mode .only-personal-link { display:none }` rule still hides it.
 */

.bbnav {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: 10px;
  margin-right: auto;            /* push the identity/controls cluster to the right */
}
.bbnav-row {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-wrap: wrap;
}

.bbnav-link {
  font-family: var(--font-stack);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  padding: 7px 13px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  background: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  line-height: 1;
  transition: color .16s ease, background .16s ease, border-color .16s ease;
}
.bbnav-link:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.bbnav-link.is-active {
  color: #fff;
  background: linear-gradient(180deg, rgba(243,156,44,0.22), rgba(243,156,44,0.10));
  border-color: rgba(243,156,44,0.45);
  box-shadow: 0 0 0 1px rgba(243,156,44,0.08), 0 4px 14px rgba(243,156,44,0.10);
}
.bbnav-gold { color: var(--accent-gold); }
.bbnav-gold.is-active {
  color: var(--accent-gold);
  background: linear-gradient(180deg, rgba(232,177,76,0.20), rgba(232,177,76,0.08));
  border-color: rgba(232,177,76,0.45);
}
.bbnav-warn { color: var(--accent-warn); }

.bbnav-car {
  width: 7px; height: 7px;
  border-right: 1.6px solid currentColor;
  border-bottom: 1.6px solid currentColor;
  transform: rotate(45deg) translateY(-1px);
  opacity: 0.55;
  transition: transform .16s ease;
}
.bbnav-item.open .bbnav-trigger .bbnav-car { transform: rotate(225deg) translateY(2px); }

.bbnav-item { position: relative; }
.bbnav-menu {
  position: absolute;
  top: calc(100% + 9px);
  left: 0;
  min-width: 234px;
  background: var(--bg-panel);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: 0 24px 60px rgba(0,0,0,0.7);
  padding: 8px;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity .16s ease, transform .16s ease;
  z-index: 200;
}
.bbnav-item:hover .bbnav-menu,
.bbnav-item.open .bbnav-menu { opacity: 1; transform: translateY(0); pointer-events: auto; }

.bbnav-menu a {
  display: block;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  line-height: 1.25;
}
.bbnav-menu a:hover { background: rgba(255,255,255,0.04); }
.bbnav-menu a small {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
  margin-top: 2px;
}
.bbnav-menu a[aria-current="page"] { color: var(--accent-bright); }
.bbnav-menu a[aria-current="page"]::after { content: " ·"; color: var(--accent); }

/* hamburger — hidden on desktop */
.bbnav-toggle {
  display: none;
  background: var(--bg-input);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-sm);
  width: 38px; height: 34px;
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  padding: 0;
}
.bbnav-toggle span {
  display: block;
  width: 17px; height: 2px;
  background: var(--text-2);
  border-radius: 2px;
  transition: transform .18s ease, opacity .18s ease;
}
.bbnav.open .bbnav-toggle span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.bbnav.open .bbnav-toggle span:nth-child(2) { opacity: 0; }
.bbnav.open .bbnav-toggle span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* mobile: collapse the row into a drawer; sub-menus expand inline */
@media (max-width: 880px) {
  .bbnav { margin-left: auto; margin-right: 0; }
  .bbnav-toggle { display: inline-flex; }
  .bbnav-row {
    display: none;
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 1px;
    background: var(--bg-panel);
    border-top: 1px solid var(--stroke);
    border-bottom: 1px solid var(--stroke);
    box-shadow: 0 22px 44px rgba(0,0,0,0.6);
    padding: 12px 18px 18px;
  }
  .bbnav.open .bbnav-row { display: flex; }
  .bbnav-link { justify-content: flex-start; padding: 11px 12px; font-size: 14px; }
  .bbnav-item { position: static; }
  .bbnav-trigger { color: var(--text-faint); font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; font-weight: 700; pointer-events: none; padding-bottom: 4px; }
  .bbnav-trigger .bbnav-car { display: none; }
  .bbnav-menu {
    position: static;
    opacity: 1;
    transform: none;
    pointer-events: auto;
    box-shadow: none;
    border: 0;
    background: transparent;
    padding: 0 0 8px 10px;
    min-width: 0;
  }
  .bbnav-menu a small { display: none; }
}

/* Mobile drawer hardening: never exceed viewport width, contain its own scroll */
@media (max-width: 880px) {
  header { position: relative; }
  .bbnav-row {
    max-width: 100vw;
    max-height: calc(100vh - 100%);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
  }
  .bbnav-menu a { white-space: normal; }
}
