/* ═══════════════════════════════════════════════════
   MaoniMom buddypress.css
   Complete BuddyPress style override — loaded only on
   BuddyPress pages via is_buddypress(). Replaces bp-legacy-css
   and bp-nouveau entirely (both dequeued in mm-buddypress-css.php).
   Brand variables (--walnut, --clay, --parchment, etc.) are defined
   sitewide in Additional CSS and simply cascade in here.
═══════════════════════════════════════════════════ */

/* ── RESET ── */
#buddypress * {
  box-sizing: border-box;
  font-family: 'DM Sans', sans-serif;
}
#buddypress h1, #buddypress h2, #buddypress h3 {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-weight: 400;
  color: var(--walnut);
}

/* ── COMMUNITY PAGE WRAPPER ── */
#buddypress {
  max-width: 860px;
  margin: 0 auto;
  padding: 32px 20px 64px;
}
body.buddypress {
  background: var(--parchment);
}

/* ── HIDE UNWANTED ELEMENTS ── */
#buddypress #group-create-body,
#buddypress .generic-button.join-group,
#buddypress #group-settings-avatar,
#buddypress .activity-time-since span:after,
#buddypress #friends-personal-li,
#buddypress .item-list-tabs #friends-personal-li,
#buddypress .activity-meta a.friends,
#buddypress .member-follower-count,
#buddypress .member-friend-count {
  display: none !important;
}

/* ── BUTTONS ── */
#buddypress a.button,
#buddypress input[type=submit],
#buddypress button {
  font-family: 'DM Sans', sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  background: var(--clay);
  color: white;
  border: none;
  border-radius: 0;
  padding: 8px 18px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s;
  display: inline-block;
}
#buddypress a.button:hover,
#buddypress input[type=submit]:hover,
#buddypress button:hover {
  background: var(--walnut);
  color: white;
}
#buddypress a.button.outline {
  background: transparent;
  color: var(--clay);
  border: 1px solid var(--clay);
}

/* ── PAGINATION ── */
#buddypress .pagination {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin: 24px 0;
}
#buddypress .pagination a,
#buddypress .pagination span {
  font-size: 11px;
  color: var(--muted);
  padding: 6px 10px;
  border: 1px solid var(--border);
  text-decoration: none;
}
#buddypress .pagination .current {
  background: var(--clay);
  color: white;
  border-color: var(--clay);
}

/* ── SEARCH / TEXT INPUTS ── */
#buddypress input[type=search],
#buddypress input[type=text] {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 300;
  color: var(--walnut);
  background: var(--parchment);
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 8px 12px;
  outline: none;
  width: 100%;
}
#buddypress input[type=search]:focus,
#buddypress input[type=text]:focus {
  border-color: var(--clay);
}

/* ── MEMBER TYPE BADGES ── */
.maoni-member-badge {
  font-size: 9px;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 100px;
  border: 1px solid;
  display: inline-block;
}
.maoni-member-badge.paid { color: var(--clay); border-color: var(--clay); }
.maoni-member-badge.free { color: var(--sage); border-color: var(--sage); }
.maoni-member-badge.professional { color: var(--lavender); border-color: var(--lavender); }

/* ── PILL TAGS (stage / rooms) ── */
.maoni-pill {
  font-size: 10px;
  padding: 3px 10px;
  border-radius: 100px;
  display: inline-block;
  margin: 0 6px 6px 0;
}
.maoni-pill-stage { background: var(--sage); color: white; }
.maoni-pill-room { border: 1px solid var(--border); color: var(--oak); background: transparent; }

/* ── ROOMS GRID (groups directory override) ── */
.maoni-rooms-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.maoni-room-card {
  display: block;
  background: var(--cream);
  border: 1px solid var(--border);
  padding: 28px 22px;
  text-decoration: none;
  transition: border-color 0.2s, transform 0.2s;
}
.maoni-room-card:hover { border-color: var(--clay); transform: translateY(-2px); }
.maoni-room-icon { font-size: 2rem; margin-bottom: 12px; }
.maoni-room-name {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 1.3rem;
  color: var(--walnut);
  margin-bottom: 8px;
}
.maoni-room-desc { font-size: 0.85rem; color: var(--oak); line-height: 1.6; margin-bottom: 14px; }
.maoni-room-enter { font-size: 0.7rem; letter-spacing: 1.5px; text-transform: uppercase; color: var(--clay); }
.maoni-room-card.maoni-room-quiet {
  background: var(--threshold);
  border-color: rgba(155,143,181,0.2);
}
.maoni-room-card.maoni-room-quiet .maoni-room-name { color: rgba(250,246,240,0.9); }
.maoni-room-card.maoni-room-quiet .maoni-room-desc { color: rgba(250,246,240,0.55); }
.maoni-room-card.maoni-room-quiet .maoni-room-enter { color: var(--lavender); }
@media (max-width: 900px) { .maoni-rooms-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .maoni-rooms-grid { grid-template-columns: 1fr; } }

/* ── ACTIVITY FEED ── */
#buddypress .activity-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
#buddypress .activity-list li.activity-item {
  background: var(--parchment);
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 16px 18px;
  transition: border-color 0.2s;
}
#buddypress .activity-list li.activity-item:hover { border-color: var(--blush); }

#buddypress .activity-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
#buddypress .activity-avatar img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--blush);
}
#buddypress .activity-header p {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  color: var(--muted);
  margin: 0;
  line-height: 1.4;
}
#buddypress .activity-header p a {
  font-size: 12px;
  font-weight: 600;
  color: var(--walnut);
  text-decoration: none;
}
#buddypress .activity-header p a:hover { color: var(--clay); }

#buddypress .activity-content .activity-inner p {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 300;
  color: var(--oak);
  line-height: 1.75;
  margin: 0 0 10px 0;
}

#buddypress .activity-meta {
  display: flex;
  gap: 16px;
  align-items: center;
}
#buddypress .activity-meta a {
  font-family: 'DM Sans', sans-serif;
  font-size: 10px;
  color: var(--muted);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 4px;
}
#buddypress .activity-meta a:hover { color: var(--clay); }

.maoni-post-room-tag {
  margin-left: auto;
  font-size: 9px;
  padding: 2px 8px;
  background: var(--cream);
  color: var(--muted);
  border-radius: 100px;
  white-space: nowrap;
}

/* Discreet report-flag icon — visible on hover only */
.maoni-report-flag {
  opacity: 0;
  transition: opacity 0.15s;
  cursor: pointer;
  font-size: 11px;
  color: var(--muted);
}
#buddypress .activity-list li.activity-item:hover .maoni-report-flag,
#buddypress .activity-list li.activity-item .maoni-report-flag:focus {
  opacity: 1;
}
.maoni-report-flag:hover { color: var(--clay); }
.maoni-report-flag.reported { opacity: 1; color: var(--sage); cursor: default; }

/* ── COMPOSE POST FORM ── */
#buddypress #whats-new-form {
  background: var(--cream);
  border: 1px solid var(--border);
  padding: 16px 18px;
  margin-bottom: 16px;
}
#buddypress #whats-new {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 300;
  color: var(--walnut);
  background: var(--parchment);
  border: 1px solid var(--border);
  padding: 12px 14px;
  width: 100%;
  resize: vertical;
  min-height: 80px;
  outline: none;
}
#buddypress #whats-new:focus { border-color: var(--clay); }
#buddypress #whats-new-submit {
  font-family: 'DM Sans', sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  background: var(--clay);
  color: white;
  border: none;
  padding: 8px 20px;
  cursor: pointer;
  margin-top: 8px;
}
#buddypress #whats-new-submit:hover { background: var(--walnut); }

/* ── QUIET ROOM OVERRIDES — apply when body has class .group-the-quiet-room ── */
.group-the-quiet-room { background: var(--threshold) !important; }
.group-the-quiet-room #buddypress .activity-list li.activity-item {
  background: rgba(255,255,255,0.02);
  border-color: rgba(155,143,181,0.12);
}
.group-the-quiet-room #buddypress .activity-content .activity-inner p {
  color: rgba(250,246,240,0.6);
}
.group-the-quiet-room #buddypress .activity-header p,
.group-the-quiet-room #buddypress .activity-meta a {
  color: rgba(250,246,240,0.4);
}
.group-the-quiet-room #buddypress .activity-header p a {
  color: rgba(155,143,181,0.7);
}
.group-the-quiet-room #buddypress .activity-header p a:hover,
.group-the-quiet-room #buddypress .activity-meta a:hover {
  color: var(--lavender);
}
.group-the-quiet-room #buddypress h1,
.group-the-quiet-room #buddypress h2,
.group-the-quiet-room #buddypress h3 {
  color: rgba(250,246,240,0.9);
}
.group-the-quiet-room #buddypress #whats-new-form {
  background: rgba(255,255,255,0.02);
  border-color: rgba(155,143,181,0.15);
}
.group-the-quiet-room #buddypress #whats-new {
  background: rgba(255,255,255,0.03);
  border-color: rgba(155,143,181,0.2);
  color: rgba(250,246,240,0.6);
}
.group-the-quiet-room #buddypress #whats-new::placeholder {
  color: rgba(155,143,181,0.35);
  font-style: italic;
}
.group-the-quiet-room #buddypress #whats-new-submit,
.group-the-quiet-room #buddypress a.button,
.group-the-quiet-room #buddypress input[type=submit] {
  background: transparent;
  color: var(--lavender);
  border: 1px solid var(--lavender);
}
.group-the-quiet-room #buddypress #whats-new-submit:hover,
.group-the-quiet-room #buddypress a.button:hover {
  background: var(--lavender);
  color: var(--threshold);
}
/* Heart-only reaction — no thumbs up / celebration emoji reactions here */
.group-the-quiet-room .maoni-reaction-heart { color: var(--lavender); }
.group-the-quiet-room .maoni-reaction-other { display: none !important; }

/* ── SECONDARY COMMUNITY NAV ── */
.maoni-community-subnav {
  background: var(--cream);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  display: flex;
  gap: 0;
  overflow-x: auto;
}
.maoni-community-subnav a {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  color: var(--muted);
  text-decoration: none;
  padding: 12px 16px;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color 0.2s, border-color 0.2s;
}
.maoni-community-subnav a:hover { color: var(--walnut); }
.maoni-community-subnav a.active { color: var(--clay); border-bottom-color: var(--clay); }
.maoni-community-subnav a.quiet-room-link { color: rgba(155,143,181,0.6); }
.maoni-community-subnav a.quiet-room-link:hover,
.maoni-community-subnav a.quiet-room-link.active {
  color: var(--lavender);
  border-bottom-color: var(--lavender);
}

/* ── PROFILE / OBJECT NAV TABS ── */
#buddypress div.item-list-tabs,
#buddypress div.item-list-tabs ul {
  background: none;
  border: none;
  padding: 0;
  margin: 0 0 20px 0;
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
}
#buddypress div.item-list-tabs ul li a {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
  background: none;
  border: none;
  padding: 10px 16px;
  border-bottom: 2px solid transparent;
  text-decoration: none;
}
#buddypress div.item-list-tabs ul li.current a,
#buddypress div.item-list-tabs ul li a:hover {
  color: var(--clay);
  border-bottom-color: var(--clay);
  background: none;
}

/* ── PROFILE HEADER ── */
.maoni-profile-header {
  background: var(--cream);
  border: 1px solid var(--border);
  padding: 28px 24px;
  margin-bottom: 24px;
  display: flex;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
}
.maoni-profile-avatar img {
  border-radius: 50%;
  width: 72px;
  height: 72px;
  object-fit: cover;
  border: 3px solid var(--blush);
}
.maoni-profile-name {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 1.6rem;
  color: var(--walnut);
  margin: 0 0 4px;
}
.maoni-profile-meta { font-size: 0.8rem; color: var(--muted); margin-bottom: 10px; }

/* ── DIRECTORY MEMBER CARDS ── */
.maoni-member-card {
  background: var(--parchment);
  border: 1px solid var(--border);
  padding: 18px;
  text-align: center;
}
.maoni-member-card img { border-radius: 50%; width: 48px; height: 48px; border: 2px solid var(--blush); object-fit: cover; }
.maoni-member-card .maoni-member-name {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 1.1rem;
  color: var(--walnut);
  margin: 10px 0 6px;
}

/* ── FORCE FULL-WIDTH, NO SIDEBAR ──
   .ast-container is a flex row (Astra's content+sidebar layout). Any
   custom BuddyPress page override must wrap ALL of its output in a
   single .mm-bp-page-wrap element, or the subnav and content below it
   become separate flex *items* sitting side by side instead of stacking. */
body.buddypress .ast-container {
  display: block !important;
}
.mm-bp-page-wrap {
  width: 100%;
}
body.buddypress #secondary,
body.buddypress .widget-area {
  display: none !important;
}

/* ── PMPRO "NO ACCESS" GATE ──
   Anonymous visitors viewing any room hit PMPro's own content-restriction
   template (a pre-existing sitewide rule, not something this pass added)
   rather than our custom BP templates — it renders before our own
   template_redirect hooks get a chance to run. Requiring an account to
   view (not a paid membership) matches the spec for every room including
   The Quiet Room; this just re-skins PMPro's bare default form to match
   the brand instead of replacing the flow. */
.pmpro-no-access {
  max-width: 480px;
  margin: 60px auto;
  padding: 40px 32px;
  background: var(--cream);
  border: 1px solid var(--border);
  text-align: center;
}
.pmpro-no-access p {
  font-family: 'DM Sans', sans-serif;
  color: var(--oak);
  font-size: 0.95rem;
  line-height: 1.7;
}
.pmpro-no-access form#loginform,
.pmpro-no-access form.pmpro_form {
  max-width: 320px;
  margin: 24px auto 0;
  text-align: left;
}
.pmpro-no-access form label {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8rem;
  color: var(--walnut);
  font-weight: 600;
  display: block;
  margin-bottom: 4px;
}
.pmpro-no-access form input[type="text"],
.pmpro-no-access form input[type="password"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  background: var(--parchment);
  color: var(--walnut);
  font-family: 'DM Sans', sans-serif;
  margin-bottom: 14px;
}
.pmpro-no-access form input[type="text"]:focus,
.pmpro-no-access form input[type="password"]:focus {
  border-color: var(--clay);
  outline: none;
}
.pmpro-no-access form input[type="submit"],
.pmpro-no-access .button.wp-generate-pw + input[type="submit"],
.pmpro-no-access #wp-submit {
  font-family: 'DM Sans', sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  background: var(--clay) !important;
  color: white !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 10px 22px !important;
  text-shadow: none !important;
  box-shadow: none !important;
  cursor: pointer;
}
.pmpro-no-access form input[type="submit"]:hover {
  background: var(--walnut) !important;
}
.pmpro-no-access p.login-remember { font-weight: 400; }
.pmpro-no-access p.login-remember label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 400;
}
.pmpro-no-access .wp-block-button__link {
  display: inline-block;
  font-family: 'DM Sans', sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  background: transparent !important;
  color: var(--clay) !important;
  border: 1px solid var(--clay) !important;
  border-radius: 0 !important;
  padding: 9px 20px !important;
  text-decoration: none !important;
}
.pmpro-no-access .wp-block-button__link:hover {
  background: var(--clay) !important;
  color: white !important;
}
.pmpro-no-access .wp-block-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 16px;
}

/* ── BP BETTER MESSAGES (real-time chat) ──
   Best-effort brand pass on the plugin's own wrapper classes — its exact
   DOM/class names aren't part of this codebase, so this is a light
   touch, not a full pixel-perfect restyle. Verify visually once logged in. */
.bp-better-messages, #bp-better-messages-app, .bpbm-app {
  --bpbm-primary: var(--clay);
  background: var(--parchment) !important;
  font-family: 'DM Sans', sans-serif !important;
}
.bp-better-messages .bpbm-message.own,
.bpbm-app .message-bubble.own {
  background: var(--clay) !important;
  color: white !important;
}
.bp-better-messages a, .bpbm-app a { color: var(--clay); }

/* ── MOBILE ── */
@media (max-width: 768px) {
  #buddypress { padding: 20px 16px 48px; }
  #buddypress .activity-header { flex-wrap: wrap; }
  .maoni-profile-header { flex-direction: column; text-align: center; }
}
