/* ============================================================
   NOMADBOLD — BUDDYBOSS / BUDDYPRESS RESKIN
   ============================================================
   BuddyBoss (and the BuddyPress core it was forked from) render
   their own Activity / Members / Groups / Forums pages using
   their own default light-theme CSS — this is what produced the
   plain white "Sorry, there were no groups found" boxes on a
   dark NomadBold site.

   This file does NOT replace any BuddyBoss/BuddyPress template
   files — it only re-skins the standard, decade-old BuddyPress
   core selectors (#buddypress, .item-list-tabs, .bp-list, etc.)
   that BuddyBoss deliberately keeps for backward compatibility
   with existing themes. That means this works without needing
   to know BuddyBoss's newer internal class names, and it can't
   break any BuddyBoss functionality — worst case, a rule simply
   doesn't match and that one element stays in its default style.

   If, after uploading, anything still looks unstyled (default
   white/blue), send a screenshot or the page's "Inspect Element"
   output for that spot and it can be targeted directly — much
   cheaper than guessing further from here blind.
   ============================================================ */

body.buddypress,
body.bp-user,
body.bb-topic,
body.single-forum,
#buddypress,
.buddypress-wrap {
  background: var(--black);
  color: var(--white);
}

#buddypress {
  max-width: 1320px;
  margin: 0 auto;
  padding: 40px 24px 80px;
  font-family: 'Jost', sans-serif;
}

.db-main #buddypress {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 0;
  float: none;
  display: block;
}

/* ── #buddypress: fully unconstrained wherever it holds the dashboard
     chrome ──
   Confirmed fixed: "Welcome back" lines up exactly with the sidebar,
   and "Log Out" lines up exactly with .db-main's own content edge. Do
   not touch .db-topbar-inner's padding again. */
#buddypress:has(.db-wrap) {
  max-width: none !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* The native PROFILE/TIMELINE tab bar (#object-nav) sits directly inside
   #buddypress, a full sibling of .db-wrap spanning the whole page width.
   Narrowed to a fixed max-width and auto-centered (instead of spanning
   full width), given a little breathing room from the top of the page,
   and its links centered within the box instead of left-aligned. Scoped
   to #object-nav specifically — NOT .item-list-tabs, which is the
   directory tab bar (Groups/Members) and should stay full width as
   before. */
#buddypress #object-nav,
#buddypress [class*="main-nav"],
#buddypress [class*="users-nav"] {
  max-width: 900px !important;
  width: auto !important;
  margin: 32px auto 24px !important;
  box-sizing: border-box !important;
}
#buddypress #object-nav ul,
#buddypress [class*="main-nav"] ul {
  justify-content: center !important;
}

/* The gray View/Edit/Profile Photo/Cover Photo bar (#subnav), unlike
   #object-nav, is nested INSIDE .db-main — which already carries its
   own 36px right padding from dashboard.css (the same value that makes
   "Log Out" line up). Giving #subnav its own extra right margin on top
   of that double-inset it, pushing its right edge too far left — that
   was exactly the "gray bar's right side not aligned" symptom. Leave it
   with no side margin of its own so .db-main's own padding is the only
   inset, matching Log Out by construction, same as its left edge
   already correctly matches .db-main's left edge. */
#buddypress .bp-subnavs,
#buddypress #subnav {
  margin: 0 0 24px 0 !important;
  box-sizing: border-box !important;
}

/* Move the tab bar all the way up on the profile page — kept for
   belt-and-suspenders; harmless now that #buddypress's own padding is
   already removed above when .db-wrap is present. Still relevant on
   other BuddyPress contexts (directories, groups) that don't have
   .db-wrap, where #buddypress's base padding above still applies. */
body.bp-user #buddypress {
  padding-top: 0 !important;
}

/* Confirmed fixed: this 36px right padding on .db-topbar-inner is what
   brought "Log Out" in to match .db-main's own 36px-inset content
   exactly. Do not touch again. */
body.buddypress .db-topbar-inner,
body.bp-user .db-topbar-inner,
body.bb-topic .db-topbar-inner,
body.single-forum .db-topbar-inner {
  padding-right: 36px !important;
  box-sizing: border-box !important;
}

/* ── Redundant native profile banner ──
   #item-header is BuddyPress's own cover-photo/avatar/name banner. Our
   dashboard topbar already shows the same identity info (Welcome back /
   name / tier pill), so on member profile pages this native banner is
   pure redundant clutter — and when there's no cover photo/avatar set (as
   on this test account), it renders as a nearly-empty box whose own
   border/padding show up as a stray divider line with dead space above
   the tab bar. Hide it only on profile pages (body.bp-user) — group
   pages keep their own #item-header banner untouched. */
body.bp-user #item-header {
  display: none !important;
}

/* ── Generic theme-compat wrapper used on BuddyPress's own native pages ──
   BuddyPress renders on virtual, non-Page URLs (e.g. /members/username/…),
   so instead of the theme's dashboard page templates, WordPress falls back
   to the theme's generic "inner page" template — the same one used for
   ordinary blog posts, complete with its own title hero
   (section.nb-generic-hero) and its own padded content wrapper
   (section.nb-generic-content > div.nb-generic-content-inner). BOTH
   levels of that wrapper need their padding/width reset — confirmed via
   DevTools that the OUTER section.nb-generic-content alone was still
   carrying 48px/80.248px/90px of padding even after the inner div was
   already reset. */
body.buddypress .nb-generic-hero,
body.bp-user .nb-generic-hero,
body.bb-topic .nb-generic-hero,
body.single-forum .nb-generic-hero {
  display: none !important;
}
body.buddypress .nb-generic-content,
body.bp-user .nb-generic-content,
body.bb-topic .nb-generic-content,
body.single-forum .nb-generic-content,
body.buddypress .nb-generic-content-inner,
body.bp-user .nb-generic-content-inner,
body.bb-topic .nb-generic-content-inner,
body.single-forum .nb-generic-content-inner {
  display: block !important;
  max-width: none !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  min-height: 0 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  filter: none !important;
}
/* Belt-and-suspenders: kill any lingering shadow/glow inside the
   dashboard chrome itself on these page types. */
body.buddypress .db-wrap *,
body.bp-user .db-wrap *,
body.bb-topic .db-wrap *,
body.single-forum .db-wrap * {
  box-shadow: none !important;
  filter: none !important;
  text-shadow: none !important;
}

/* Re-assert the dashboard's own text styling for the specific elements
   confirmed (or likely, given the same "container p/h*" pattern) to be
   getting overridden by the generic wrapper's blanket paragraph/heading
   rule. These values are copied directly from dashboard.css so they
   render identically to how they look on Community Forum / the main
   dashboard, regardless of what the generic wrapper tries to apply. */
.db-wrap .db-welcome {
  color: var(--gold-dim) !important;
  font-size: 15px !important;
  letter-spacing: 0.26em !important;
  text-transform: uppercase !important;
  margin-bottom: 6px !important;
  line-height: normal !important;
}
.db-wrap .db-name {
  color: var(--white) !important;
  font-family: 'Bebas Neue', sans-serif !important;
  font-size: clamp(28px, 4vw, 48px) !important;
  letter-spacing: 0.04em !important;
  line-height: 1 !important;
}
.db-wrap .db-section-sub {
  color: var(--gray) !important;
  font-size: 15px !important;
  line-height: normal !important;
}
.db-wrap .db-card-desc,
.db-wrap .db-affiliate-desc,
.db-wrap .db-download-meta,
.db-wrap .db-upgrade-text {
  color: var(--gray) !important;
  font-size: 15px !important;
}
.db-wrap .db-nav-section {
  color: var(--gold-dim) !important;
  font-size: 9px !important;
  letter-spacing: 0.28em !important;
  text-transform: uppercase !important;
}
.db-wrap .db-nav-link {
  color: var(--gray-lt) !important;
  font-size: 15px !important;
}
.db-wrap .db-nav-link.active {
  color: var(--gold) !important;
}

#buddypress h1,
#buddypress h2,
#buddypress h3,
#buddypress h4 {
  font-family: 'Bebas Neue', sans-serif;
  letter-spacing: 0.04em;
  color: var(--white);
}

#buddypress a {
  color: var(--gold);
}
#buddypress a:hover {
  color: var(--gold-lt);
}

/* ── Directory tab bar (All Groups / My Groups / Create a Group,
     All Members, etc. — and the Profile/Timeline/Messages/… sub-nav) ── */
#buddypress .item-list-tabs,
#buddypress .bp-navs,
#buddypress .bp-subnavs {
  background: var(--charcoal);
  border: 0.5px solid var(--border);
  border-radius: var(--radius);
  box-shadow: none !important;
  filter: none !important;
}
#buddypress .item-list-tabs ul,
#buddypress .bp-navs ul {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
}
#buddypress .item-list-tabs ul li,
#buddypress .bp-navs ul li {
  list-style: none;
}
#buddypress .item-list-tabs ul li a,
#buddypress .bp-navs ul li a,
#buddypress .bp-subnavs ul li a {
  display: inline-block;
  padding: 14px 18px;
  color: var(--gray-lt);
  font-size: 14px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  border-bottom: 2px solid transparent;
}
#buddypress .item-list-tabs ul li.selected a,
#buddypress .item-list-tabs ul li.current a,
#buddypress .bp-navs ul li.selected a,
#buddypress .bp-navs ul li.current a {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

/* Confirmed via inspect: the actual tab bar wrapper is
   <nav id="object-nav" class="bb-single-main-nav--horizontal
   users-nav">, and the gray View/Edit/Profile Photo/Cover Photo bar is
   <nav id="subnav" class="bp-navs bp-subnavs ... bb-subnav-plain">. Give
   both the same card look (background/border) as the .item-list-tabs/
   .bp-navs guesses above, since #object-nav wasn't matching those. */
#buddypress #object-nav,
#buddypress #subnav,
#buddypress nav[class*="main-nav"] {
  background: var(--charcoal);
  border: 0.5px solid var(--border);
  border-radius: var(--radius);
  box-shadow: none !important;
  filter: none !important;
}

/* ── Profile sub-nav "selected" tab pill (Profile/Timeline/Messages/…) ──
   BuddyBoss's newer nav markup (li.bp-personal-tab, with a nested
   div.bb-single-nav-item-point holding the label text) ships its own
   white background for the active tab. The gold text-color rule above
   inherits down into that nested div fine (color is inheritable), but
   background is NOT an inherited property, so the white box survived
   even with the rule above in place. This kills it explicitly, targeting
   both the legacy classes and BuddyBoss's own newer ones, and reaches
   the nested label div directly too. */
#buddypress li.selected,
#buddypress li.current,
#buddypress li.bp-personal-tab.selected,
#buddypress li.bp-personal-tab.current,
#buddypress li.selected a,
#buddypress li.current a,
#buddypress .bb-single-nav-item-point {
  background: transparent !important;
  background-color: transparent !important;
  color: var(--gold) !important;
}
#buddypress li.selected a,
#buddypress li.current a,
#buddypress li.bp-personal-tab.selected a,
#buddypress li.bp-personal-tab.current a {
  border-bottom: 2px solid var(--gold) !important;
}

/* Hover state on the profile sub-nav tabs — BuddyBoss's default hover
   fills the tab with a flat light-gray/white box (visible as an ugly
   gray rectangle on mouseover). Override with a subtle gold tint that
   matches the rest of the theme instead. */
#buddypress li.bp-personal-tab:hover,
#buddypress li.bp-personal-tab a:hover,
#buddypress li.bp-personal-tab:hover .bb-single-nav-item-point,
#buddypress .bb-single-nav-item-point:hover,
#buddypress .item-list-tabs ul li:hover,
#buddypress .item-list-tabs ul li a:hover,
#buddypress .bp-navs ul li:hover,
#buddypress .bp-navs ul li a:hover {
  background: rgba(201,168,76,0.08) !important;
  background-color: rgba(201,168,76,0.08) !important;
  color: var(--gold-lt) !important;
}

/* ── Avatar upload / take-photo tabs (Change Profile/Cover Photo screens) ──
   Confirmed via inspect: <li class="avatar-nav-item current"
   id="bp-avatar-upload"><a class="bp-avatar-nav-item">Upload</a></li>.
   BuddyBoss draws a border box around the current/active one by default;
   strip it so "Upload" matches the plain-text look of "Take Photo". */
#buddypress li.avatar-nav-item.current,
#buddypress li.avatar-nav-item.current a,
#buddypress a.bp-avatar-nav-item {
  border: none !important;
  box-shadow: none !important;
}

/* ── Search / filter / sort controls ── */
#buddypress .dir-search input[type="text"],
#buddypress .dir-search input[type="search"],
#buddypress .bp-search-form input[type="text"],
#buddypress .bp-search-form input[type="search"],
#buddypress input[type="text"],
#buddypress input[type="search"],
#buddypress input[type="email"],
#buddypress input[type="password"],
#buddypress textarea,
#buddypress select {
  background: var(--black2);
  border: 0.5px solid var(--border);
  border-radius: var(--radius);
  color: var(--white);
  padding: 10px 14px;
  font-family: 'Jost', sans-serif;
  font-size: 15px;
}
#buddypress select {
  padding: 10px 32px 10px 14px;
}
#buddypress input::placeholder,
#buddypress textarea::placeholder {
  color: var(--gray);
}
#buddypress input[type="submit"],
#buddypress input[type="text"]:focus,
#buddypress select:focus {
  outline: none;
  border-color: var(--gold-dim);
}

/* Grid / list view toggle icons */
#buddypress .grid-filters,
#buddypress .view-filters,
#buddypress .display-toggle {
  border: 0.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--charcoal);
}
#buddypress .grid-filters a,
#buddypress .view-filters a,
#buddypress .display-toggle a {
  color: var(--gray-lt);
}
#buddypress .grid-filters a.selected,
#buddypress .view-filters a.selected,
#buddypress .display-toggle a.selected {
  color: var(--gold);
}

/* ── Result lists — groups, members, activity ── */
#buddypress .bp-list,
#buddypress ul.item-list,
#buddypress div.groups-members,
#buddypress div.members-list {
  background: transparent;
}
#buddypress .bp-list > li,
#buddypress ul.item-list > li,
#buddypress .item-entry {
  background: var(--charcoal);
  border: 0.5px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  padding: 16px;
  color: var(--gray-lt);
}
#buddypress .item-title,
#buddypress .list-title {
  color: var(--white);
  font-family: 'Bebas Neue', sans-serif;
  letter-spacing: 0.03em;
}
#buddypress .item-desc,
#buddypress .desc {
  color: var(--gray);
  font-size: 14px;
}
#buddypress .avatar,
#buddypress img.avatar {
  border-radius: 50%;
  border: 0.5px solid var(--border);
}

/* ── "No results" / info / feedback notices ──
   BuddyPress renders these as light blue boxes by default; this
   is almost certainly the exact element behind the "Sorry, there
   were no groups found" message in the screenshot. */
#buddypress div.info,
#buddypress p.info,
#buddypress .bp-feedback,
#buddypress .bp-messages .info,
#buddypress .bp-messages .success,
#buddypress .bp-messages .error,
#buddypress .bp-messages .warning,
#buddypress .bb-message,
#buddypress .bp-template-notice {
  background: rgba(201,168,76,0.06);
  border: 0.5px solid var(--gold-dim);
  border-radius: var(--radius);
  color: var(--gray-lt);
  padding: 18px 20px;
}
#buddypress div.info p,
#buddypress .bp-feedback p {
  color: var(--gray-lt);
}

/* ── Buttons ── */
#buddypress a.button,
#buddypress .button,
#buddypress .generic-button a,
#buddypress input[type="submit"],
#buddypress button {
  display: inline-block;
  background: var(--gold);
  color: var(--black);
  border: none;
  border-radius: var(--radius);
  padding: 10px 20px;
  font-family: 'Jost', sans-serif;
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.04em;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s;
}
#buddypress a.button:hover,
#buddypress .button:hover,
#buddypress input[type="submit"]:hover,
#buddypress button:hover {
  background: var(--gold-lt);
  color: var(--black);
}
/* Secondary/outline-style buttons BuddyPress marks with these
   classes (leave/join toggles, etc.) */
#buddypress a.leave-group,
#buddypress a.button.leave-group,
#buddypress .generic-button a.confirm {
  background: transparent;
  border: 0.5px solid var(--border);
  color: var(--gray-lt);
}

/* ── Pagination ── */
#buddypress .pagination,
#buddypress .bp-pagination {
  color: var(--gray);
  font-size: 14px;
}
#buddypress .pagination a,
#buddypress .bp-pagination a {
  color: var(--gold);
}

/* ── Single group / member header banners ── */
#buddypress .group-header,
#buddypress #item-header,
#buddypress .bp-cover-image-container {
  background: var(--navy);
  border: 0.5px solid var(--border);
  border-radius: var(--radius);
}

/* ── Activity stream entries ── */
#buddypress .activity-list > li,
#buddypress .activity-item {
  background: var(--charcoal);
  border: 0.5px solid var(--border);
  border-radius: var(--radius);
  color: var(--gray-lt);
}
#buddypress .activity-content,
#buddypress .activity-header {
  color: var(--gray-lt);
}
#buddypress .activity-header a {
  color: var(--gold);
}

/* ── Forums (bbPress-style markup BuddyBoss renders) ── */
#buddypress .bbp-forums-list,
#buddypress .bbp-topics-list,
#buddypress ul.forums,
#buddypress ul.topics,
.bbp-body {
  background: transparent;
  color: var(--gray-lt);
}
.bbp-forum-title,
.bbp-topic-title {
  color: var(--white) !important;
}

/* Fallback: catch anything still rendering with BuddyBoss's own
   light card/background utility classes so it doesn't leave a
   jarring white box against the dark theme. */
#buddypress [class*="bb-card"],
#buddypress [class*="bb-white"],
#buddypress [class*="bg-white"] {
  background: var(--charcoal) !important;
  color: var(--gray-lt) !important;
}
