/* =========================================================================
 * COMMUNITY
 *
 * Member and group directories, single profiles and single groups. These are
 * BuddyBoss's own class names, taken from its buddypress/ templates and
 * overridden from outside — no template is forked, so BuddyBoss stays
 * updatable.
 *
 * The community is where a student ends up after enrolling, so it should not
 * feel like a different site from the one that sold them the paper.
 * ====================================================================== */

/* ------------------------------------------------------- directory header */

.bp-secondary-header,
.bb-secondary-header {
	background: var(--rcm-card);
	border: 1px solid var(--rcm-border);
	border-radius: var(--rcm-radius-2xl);
	padding: 0.9rem 1.25rem;
	margin-bottom: 1.25rem;
	gap: 1rem;
}

.bb-item-count,
.bb-count {
	font-family: var(--rcm-font-display);
	font-size: var(--rcm-text-lg);
	font-weight: 700;
	letter-spacing: -0.02em;
	color: var(--rcm-fg);
}

.bb-count {
	color: var(--rcm-navy);
	font-variant-numeric: tabular-nums;
}

/* Directory search and the filter dropdown beside it. */
.subnav-search input[type="text"],
.subnav-search input[type="search"],
.subnav-filters select,
.bp-navs select {
	min-height: 2.75rem;
	padding: 0.55rem 0.9rem;
	border: 1px solid var(--rcm-border);
	border-radius: var(--rcm-radius);
	background: var(--rcm-bg);
	font-family: inherit;
	font-size: var(--rcm-text-sm);
	color: var(--rcm-fg);
}

.subnav-search input:focus,
.subnav-filters select:focus {
	border-color: var(--rcm-navy);
	box-shadow: 0 0 0 3px rgb(0 51 160 / 0.12);
	outline: none;
}

/* ------------------------------------------------------------- nav tabs */

/* The tab rows across directories and profiles: Members / Groups, or
   Activity / Profile / Courses on a member. */
.bp-navs,
.bp-navs.bp-subnavs,
div.item-list-tabs {
	background: transparent;
	border: 0;
	border-bottom: 1px solid var(--rcm-border);
	margin-bottom: 1.25rem;
}

.bp-navs ul,
div.item-list-tabs ul {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.bp-navs ul li a,
div.item-list-tabs ul li a {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	padding: 0.7rem 0.9rem;
	border-bottom: 2px solid transparent;
	font-size: var(--rcm-text-sm);
	font-weight: 600;
	color: var(--rcm-muted-fg);
	text-decoration: none;
	background: transparent;
}

.bp-navs ul li a:hover,
div.item-list-tabs ul li a:hover {
	color: var(--rcm-navy);
}

/* Gold underline for the current tab, matching the site header. */
.bp-navs ul li.current > a,
.bp-navs ul li.selected > a,
div.item-list-tabs ul li.current > a,
div.item-list-tabs ul li.selected > a {
	color: var(--rcm-navy);
	background: transparent;
	border-bottom-color: var(--rcm-gold);
}

.bp-navs ul li a span,
div.item-list-tabs ul li a span {
	display: inline-grid;
	place-items: center;
	min-width: 1.4rem;
	height: 1.4rem;
	padding: 0 0.35rem;
	border-radius: var(--rcm-radius-pill);
	background: var(--rcm-muted);
	font-size: var(--rcm-text-xs);
	font-variant-numeric: tabular-nums;
	color: var(--rcm-muted-fg);
}

.bp-navs ul li.current > a span,
.bp-navs ul li.selected > a span {
	background: var(--rcm-navy-08);
	color: var(--rcm-navy);
}

/* ------------------------------------------------------------ item cards */

/* Members and groups both render as .bs-item-wrap with a .list-wrap inside. */
body.directory .bs-item-wrap {
	background: transparent;
	border: 0;
	padding: 0;
}

/*
 * Directory pages only.
 *
 * BuddyPress puts `directory` on the body of a listing and `single-item` on a
 * single group or profile. Inside a single group the same class names describe
 * a card BuddyBoss lays out differently, and styling both from one rule is
 * what broke the member grid.
 */
body.directory .bs-item-wrap .list-wrap {
	background: var(--rcm-card);
	border: 1px solid var(--rcm-border);
	border-radius: var(--rcm-radius-2xl);
	padding: 1.25rem;
	height: 100%;
	transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

body.directory .bs-item-wrap .list-wrap:hover {
	border-color: var(--rcm-navy-12);
	box-shadow: var(--rcm-shadow-soft);
}

body.directory .bs-item-wrap .item-avatar img,
body.directory .bs-item-wrap .item-avatar .avatar {
	border-radius: 50%;
	border: 0;
}

/* A group avatar is a square thing, not a face. */
body.directory.groups .bs-item-wrap .item-avatar img,
body.directory.groups .bs-item-wrap .item-avatar .avatar {
	border-radius: var(--rcm-radius-lg);
}

body.directory .bs-item-wrap .item-title,
body.directory .bs-item-wrap .item-title a,
body.directory .bs-item-wrap .list-title,
body.directory .bs-item-wrap .list-title a {
	font-family: var(--rcm-font-display);
	font-size: var(--rcm-text-base);
	font-weight: 600;
	letter-spacing: -0.01em;
	color: var(--rcm-fg);
	text-decoration: none;
}

body.directory .bs-item-wrap .item-title a,
body.directory .bs-item-wrap .list-title a {
	text-decoration: none;
}

body.directory .bs-item-wrap .item-title a:hover,
body.directory .bs-item-wrap .list-title a:hover {
	color: var(--rcm-navy);
}

body.directory .bs-item-wrap .item-meta,
body.directory .bs-item-wrap .last-activity,
body.directory .bs-item-wrap .group-details {
	font-size: var(--rcm-text-sm);
	color: var(--rcm-muted-fg);
}

body.directory .bs-item-wrap .bs-group-type,
body.directory .bs-item-wrap .bb-member-type {
	display: inline-block;
	padding: 0.2rem 0.6rem;
	border-radius: var(--rcm-radius-pill);
	background: var(--rcm-navy-08);
	font-size: var(--rcm-text-xs);
	font-weight: 600;
	color: var(--rcm-navy);
}

/* --------------------------------------------------------------- buttons */

/* BuddyBoss renders .button, not .rcm-btn, so the RCM button is described
   again against its selectors rather than asking templates to change. */
#buddypress .generic-button a,
#buddypress a.button,
#buddypress button.button,
#buddypress input[type="submit"],
#buddypress .group-button a,
#buddypress .friendship-button a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.4rem;
	min-height: 2.5rem;
	padding: 0.5rem 1rem;
	border: 0;
	border-radius: var(--rcm-radius-pill);
	background: var(--rcm-navy);
	font-family: var(--rcm-font-sans);
	font-size: var(--rcm-text-sm);
	font-weight: 600;
	color: #fff;
	text-decoration: none;
	transition: background-color 0.16s ease;
}

#buddypress .generic-button a:hover,
#buddypress a.button:hover,
#buddypress input[type="submit"]:hover {
	background: var(--rcm-navy-deep);
	color: #fff;
}

/* Leaving a group is not the action the design should push. */
#buddypress .group-button.leave-group a,
#buddypress .friendship-button.is_friend a,
#buddypress .generic-button a.leave-group {
	background: transparent;
	color: var(--rcm-fg);
	box-shadow: inset 0 0 0 1px var(--rcm-border);
}

#buddypress .group-button.leave-group a:hover,
#buddypress .friendship-button.is_friend a:hover {
	background: var(--rcm-muted);
	color: var(--rcm-danger);
}

/* -------------------------------------------------------- single headers */

/* Cover image plus avatar, on a member or a group. */
#buddypress #cover-image-container,
.bb-cover-photo-wrap {
	border-radius: var(--rcm-radius-2xl);
	overflow: hidden;
}

#buddypress #item-header-cover-image,
#buddypress .bb-user-header,
#buddypress .group-single-header {
	background: var(--rcm-card);
	border: 1px solid var(--rcm-border);
	border-radius: var(--rcm-radius-2xl);
	padding: 1.5rem;
}

#buddypress #item-header-content h2,
#buddypress .bb-user-name,
#buddypress #item-header-content .user-nicename,
#buddypress #item-header-content .group-name {
	font-family: var(--rcm-font-display);
	font-size: var(--rcm-text-2xl);
	font-weight: 700;
	letter-spacing: -0.02em;
	color: var(--rcm-fg);
	margin: 0;
}

#buddypress #item-header-content .activity,
#buddypress #item-header-content .group-meta,
#buddypress .bb-user-meta {
	font-size: var(--rcm-text-sm);
	color: var(--rcm-muted-fg);
}

#buddypress #item-header-avatar img,
#buddypress .bb-user-avatar img {
	border-radius: 50%;
	border: 3px solid var(--rcm-card);
	box-shadow: var(--rcm-shadow-soft);
}

/* ------------------------------------------------------------- activity */

#buddypress ul.activity-list,
.groups ul.activity-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

#buddypress .activity-list .activity-item,
#buddypress ul.activity-list > li,
.groups ul.activity-list > li {
	background: var(--rcm-card);
	border: 1px solid var(--rcm-border);
	border-radius: var(--rcm-radius-2xl);
	padding: 1.25rem;
	margin-bottom: 1rem;
}

#buddypress .activity-header,
#buddypress .activity-header p {
	font-size: var(--rcm-text-sm);
	color: var(--rcm-muted-fg);
}

#buddypress .activity-header a {
	font-weight: 600;
	color: var(--rcm-fg);
	text-decoration: none;
}

#buddypress .activity-content .activity-inner {
	font-size: var(--rcm-text-base);
	line-height: 1.65;
}

#buddypress .activity-meta a,
#buddypress .acomment-options a {
	font-size: var(--rcm-text-sm);
	font-weight: 600;
	color: var(--rcm-navy);
}

#buddypress form.ac-form,
#buddypress #whats-new-form {
	background: var(--rcm-card);
	border: 1px solid var(--rcm-border);
	border-radius: var(--rcm-radius-2xl);
	padding: 1rem;
}

#buddypress #whats-new,
#buddypress .ac-input textarea {
	border: 1px solid var(--rcm-border);
	border-radius: var(--rcm-radius);
	background: var(--rcm-bg);
	font-family: inherit;
	font-size: var(--rcm-text-base);
	padding: 0.75rem 0.9rem;
}

/* --------------------------------------------------------------- forums */

.bbpress .bbp-forum-title,
.bbpress .bbp-topic-permalink {
	font-weight: 600;
	color: var(--rcm-fg);
	text-decoration: none;
}

.bbpress li.bbp-header,
.bbpress li.bbp-footer {
	background: var(--rcm-muted);
	border: 0;
	font-size: var(--rcm-text-xs);
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--rcm-muted-fg);
}

.bbpress ul.bbp-forums,
.bbpress ul.bbp-topics,
.bbpress ul.bbp-replies {
	border: 1px solid var(--rcm-border);
	border-radius: var(--rcm-radius-2xl);
	overflow: hidden;
	background: var(--rcm-card);
}

/* ------------------------------------------------------------- messages */

#buddypress .messages-notices td,
#buddypress table.messages-notices {
	border-color: var(--rcm-border);
}

#buddypress .thread-unread .thread-subject {
	font-weight: 700;
	color: var(--rcm-navy);
}

/* ------------------------------------------------------------ pagination */

#buddypress .pagination .page-numbers,
#buddypress div.pagination .pag-count {
	font-size: var(--rcm-text-sm);
	color: var(--rcm-muted-fg);
}

#buddypress .pagination .page-numbers.current {
	background: var(--rcm-navy);
	color: #fff;
	border-radius: var(--rcm-radius);
	padding: 0.15rem 0.5rem;
}

/* ----------------------------------------------------------------- empty */

#buddypress .bp-feedback,
#buddypress div.info,
#buddypress .widget_bp_core_members_widget .bp-feedback {
	background: var(--rcm-navy-08);
	border: 1px solid var(--rcm-navy-12);
	border-radius: var(--rcm-radius-lg);
	color: var(--rcm-fg);
	font-size: var(--rcm-text-sm);
	padding: 1rem 1.25rem;
}

#buddypress .bp-feedback.error {
	background: rgb(180 35 24 / 0.08);
	border-color: rgb(180 35 24 / 0.3);
	color: var(--rcm-danger);
}

#buddypress .bp-feedback.success {
	background: rgb(6 118 71 / 0.08);
	border-color: var(--rcm-success);
	color: var(--rcm-success);
}

/* ----------------------------------------------------------------- mobile */

@media (max-width: 48rem) {
	.bp-secondary-header,
	.bb-secondary-header {
		flex-direction: column;
		align-items: stretch;
	}

	.bp-secondary-header .push-right {
		margin-left: 0;
		flex-direction: column;
		gap: 0.5rem;
	}

	.subnav-search,
	.subnav-search input,
	.subnav-filters,
	.subnav-filters select {
		width: 100%;
	}

	/* Tabs scroll rather than wrapping into four stacked rows. */
	.bp-navs ul,
	div.item-list-tabs ul {
		flex-wrap: nowrap;
		overflow-x: auto;
		scrollbar-width: none;
	}

	.bp-navs ul::-webkit-scrollbar,
	div.item-list-tabs ul::-webkit-scrollbar {
		display: none;
	}

	.bp-navs ul li a,
	div.item-list-tabs ul li a {
		white-space: nowrap;
	}
}

/* =========================================================================
 * SINGLE GROUP
 *
 * A study room is where a student spends time, so it gets more attention than
 * the directory card that led there. Class names taken from BuddyBoss's
 * buddypress/groups/single templates: #item-header.groups-header.single-headers,
 * .bp-wrap, .item-body, .bb-sticky-sidebar.
 * ====================================================================== */

#item-header.single-headers {
	background: var(--rcm-card);
	border: 1px solid var(--rcm-border);
	border-radius: var(--rcm-radius-2xl);
	padding: 1.5rem;
	margin-bottom: 1.5rem;
}

#item-header.single-headers .bp-title,
#item-header.single-headers h1,
#item-header.single-headers h2 {
	font-family: var(--rcm-font-display);
	font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem);
	font-weight: 700;
	letter-spacing: -0.02em;
	line-height: 1.15;
	margin: 0 0 0.35rem;
}

/* A group avatar is a square object, unlike a person's. */
#item-header.groups-header #item-header-avatar img,
#item-header.groups-header .item-avatar img {
	border-radius: var(--rcm-radius-lg);
	border: 3px solid var(--rcm-card);
	box-shadow: var(--rcm-shadow-soft);
}

#item-header.single-headers .highlight,
#item-header.single-headers .group-status,
#item-header.single-headers .bp-group-type {
	display: inline-block;
	padding: 0.2rem 0.65rem;
	border-radius: var(--rcm-radius-pill);
	background: var(--rcm-navy-08);
	font-size: var(--rcm-text-xs);
	font-weight: 600;
	letter-spacing: 0.02em;
	color: var(--rcm-navy);
}

/* Kept clear of the floated avatar: the description wrapping back under it
   reads as a broken column rather than a paragraph. */
#item-header.single-headers #item-header-content {
	overflow: hidden;
}

#item-header.single-headers .group-description,
#item-header.single-headers .item-meta {
	font-size: var(--rcm-text-sm);
	line-height: 1.6;
	color: var(--rcm-muted-fg);
	margin: 0.5rem 0 0;
	max-width: 60ch;
}

.group-item-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-top: 1rem;
}

/* ------------------------------------------------------------ group body */

.groups .bp-wrap,
.group-single .bp-wrap {
	margin-top: 0;
}

.groups .item-body,
.group-single .item-body {
	background: var(--rcm-card);
	border: 1px solid var(--rcm-border);
	border-radius: var(--rcm-radius-2xl);
	padding: 1.5rem;
}

/* The sidebar column BuddyBoss sticks beside the group. */
.bb-sticky-sidebar .widget {
	background: var(--rcm-card);
	border: 1px solid var(--rcm-border);
	border-radius: var(--rcm-radius-2xl);
	padding: 1.25rem;
	margin-bottom: 1rem;
}

.bb-sticky-sidebar .widget-title,
.bb-sticky-sidebar .widgettitle {
	font-family: var(--rcm-font-display);
	font-size: var(--rcm-text-base);
	font-weight: 700;
	letter-spacing: -0.01em;
	margin: 0 0 0.75rem;
}

/* ------------------------------------------------------- organisers list */

.moderators-lists {
	margin-top: 1rem;
}

.moderators-title {
	font-size: var(--rcm-text-xs);
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--rcm-muted-fg);
	margin: 0 0 0.5rem;
}

.moderators-lists .user-list,
.bb-sticky-sidebar .user-list {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.moderators-lists .user-list img {
	width: 2rem;
	height: 2rem;
	border-radius: 50%;
	border: 2px solid var(--rcm-card);
}

/* ------------------------------------------------------------- members */

/*
 * BuddyBoss lays the member grid out itself, including a card, a hover action
 * bar and a grid/list toggle. Imposing another grid on top of it produced the
 * mess it was meant to tidy: the Organizers and Members headings became empty
 * cells, names wrapped mid-word into columns too narrow for them, and the
 * action bar sat over the bottom of each card.
 *
 * So nothing here changes the layout. Only the things that are the theme's
 * business — typeface, colour, corner radius — are touched, and the structure
 * is left to the plugin that already gets it right.
 */

.groups .item-body .bp-member-name,
.groups .item-body .item-title,
.groups .item-body .list-title a {
	font-family: var(--rcm-font-sans);
	font-weight: 600;
	color: var(--rcm-fg);
	text-decoration: none;
}

.groups .item-body .item-meta,
.groups .item-body .bp-member-joined,
.groups .item-body .last-activity {
	font-size: var(--rcm-text-xs);
	color: var(--rcm-muted-fg);
}

.groups .item-body .bb-search-form input[type="search"],
.groups .item-body .bp-search input[type="search"] {
	min-height: 2.75rem;
	border: 1px solid var(--rcm-border);
	border-radius: var(--rcm-radius);
	background: var(--rcm-bg);
	font-family: inherit;
	font-size: var(--rcm-text-sm);
}

/* ------------------------------------------------------------- mobile */

@media (max-width: 48rem) {
	#item-header.single-headers {
		padding: 1.1rem;
		text-align: center;
	}

	.group-item-actions {
		justify-content: center;
	}

	#item-header.single-headers .group-description {
		margin-inline: auto;
	}
}
