/*
Theme Name: Project Petals
Description: A warm, eco-friendly community theme built for BuddyPress (Nouveau template pack).
Version: 1.2.1
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: projectpetals
*/

/* ---------- Design tokens ---------- */
:root {
	--pp-bg: #faf6ee;
	--pp-surface: #ffffff;
	--pp-surface-2: #f3eee2;
	--pp-text: #2b3a2f;
	--pp-muted: #66736a;
	--pp-border: #e3dccb;
	--pp-primary: #3f6b4f;
	--pp-primary-hover: #2f5240;
	--pp-on-primary: #ffffff;
	--pp-accent: #c4683f;
	--pp-focus: #c4683f;
	--pp-radius: 14px;
	--pp-radius-sm: 8px;
	--pp-shadow: 0 1px 2px rgba(43, 58, 47, .06), 0 4px 14px rgba(43, 58, 47, .06);
	--pp-font: "Nunito", ui-rounded, "Segoe UI", system-ui, -apple-system, sans-serif;
	--pp-header-h: 64px;
	--pp-tabbar-h: 64px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	background: var(--pp-bg);
	color: var(--pp-text);
	font-family: var(--pp-font);
	font-size: 1.0625rem;
	line-height: 1.6;
}
img, svg, video { max-width: 100%; height: auto; }
a { color: var(--pp-primary); text-underline-offset: 3px; }
a:hover { color: var(--pp-primary-hover); }
:focus-visible { outline: 3px solid var(--pp-focus); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; }
.screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
	overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link:focus {
	clip: auto; width: auto; height: auto; margin: 0; padding: .75rem 1rem; z-index: 1000;
	background: var(--pp-primary); color: var(--pp-on-primary); left: .5rem; top: .5rem;
}

/* ---------- Layout ---------- */
.pp-wrap { width: min(1100px, 100% - 2rem); margin-inline: auto; }
.pp-main { padding-block: 1.5rem 3rem; min-height: 60vh; }
.pp-card, .pp-entry {
	background: var(--pp-surface);
	border: 1px solid var(--pp-border);
	border-radius: var(--pp-radius);
	box-shadow: var(--pp-shadow);
	padding: clamp(1rem, 3vw, 2rem);
}
.pp-entry__title { font-size: clamp(1.6rem, 4vw, 2.2rem); color: var(--pp-primary); }
.pp-entry--bp .pp-entry__title { margin-bottom: .75rem; }

/* ---------- Header ---------- */
.pp-header {
	position: sticky; top: 0; z-index: 50;
	background: var(--pp-surface);
	border-bottom: 1px solid var(--pp-border);
}
.pp-header__inner { display: flex; align-items: center; gap: 1rem; min-height: var(--pp-header-h); }
.pp-brand { display: flex; align-items: center; gap: .6rem; font-weight: 800; font-size: 1.25rem; color: var(--pp-primary); text-decoration: none; }
.pp-brand img { max-height: 40px; width: auto; }
.pp-brand__leaf { font-size: 1.5rem; }
.pp-nav { margin-left: auto; }
.pp-nav ul { list-style: none; display: flex; gap: .25rem; margin: 0; padding: 0; }
.pp-nav a {
	display: block; padding: .5rem .9rem; border-radius: 999px;
	color: var(--pp-text); text-decoration: none; font-weight: 700;
}
.pp-nav a:hover, .pp-nav .current-menu-item > a, .pp-nav a[aria-current="page"] {
	background: var(--pp-surface-2); color: var(--pp-primary);
}
.pp-actions { display: flex; align-items: center; gap: .4rem; }
.pp-icon-link {
	position: relative; display: inline-flex; align-items: center; justify-content: center;
	width: 44px; height: 44px; border-radius: 50%; color: var(--pp-text); text-decoration: none;
}
.pp-icon-link:hover { background: var(--pp-surface-2); }
.pp-icon-link svg, .pp-tab svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pp-badge {
	position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 5px;
	background: var(--pp-accent); color: #fff; border-radius: 999px; font-size: .7rem; font-weight: 800;
	display: inline-flex; align-items: center; justify-content: center; line-height: 1;
}
.pp-avatar img { border-radius: 50%; display: block; width: 36px; height: 36px; }
.pp-avatar { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%; }

/* ---------- Bottom tabs (mobile) ---------- */
.pp-tabbar { display: none; }
@media (max-width: 782px) {
	.pp-nav { display: none; }
	.pp-actions { margin-left: auto; }
	.pp-actions .pp-icon-link--hide-mobile { display: none; }
	body.pp-has-tabbar { padding-bottom: calc(var(--pp-tabbar-h) + env(safe-area-inset-bottom)); }
	.pp-tabbar {
		display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
		background: var(--pp-surface); border-top: 1px solid var(--pp-border);
		padding-bottom: env(safe-area-inset-bottom);
	}
	.pp-tab {
		flex: 1; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
		gap: 2px; min-height: var(--pp-tabbar-h); color: var(--pp-muted); text-decoration: none;
		font-size: .72rem; font-weight: 700;
	}
	.pp-tab[aria-current="page"] { color: var(--pp-primary); }
	.pp-tab .pp-badge { top: 6px; right: calc(50% - 22px); }
}

/* ---------- Footer ---------- */
.pp-footer { border-top: 1px solid var(--pp-border); color: var(--pp-muted); padding-block: 1.5rem; font-size: .95rem; text-align: center; }

/* ---------- Buttons & forms (theme + BuddyPress Nouveau) ---------- */
.pp-btn,
#buddypress .button, #buddypress button, #buddypress input[type="submit"], #buddypress a.button,
#buddypress .generic-button a, #buddypress .action a.button {
	display: inline-block;
	background: var(--pp-primary); color: var(--pp-on-primary);
	border: 2px solid var(--pp-primary); border-radius: 999px;
	padding: .55rem 1.2rem; font: inherit; font-weight: 800; cursor: pointer; text-decoration: none;
	transition: background .15s, transform .05s;
}
.pp-btn:hover,
#buddypress .button:hover, #buddypress button:hover, #buddypress input[type="submit"]:hover, #buddypress a.button:hover,
#buddypress .generic-button a:hover {
	background: var(--pp-primary-hover); border-color: var(--pp-primary-hover); color: var(--pp-on-primary);
}
#buddypress .button.disabled, #buddypress .button[disabled] { opacity: .55; cursor: not-allowed; }
#buddypress .action .button.accept, #buddypress .button.accept { background: var(--pp-primary); }
#buddypress .button.reject, #buddypress .button.leave-group, #buddypress .button.remove,
#buddypress .generic-button a.leave-group {
	background: transparent; color: var(--pp-accent); border-color: var(--pp-accent);
}
input[type="text"], input[type="email"], input[type="password"], input[type="search"], input[type="url"],
input[type="number"], input[type="date"], select, textarea {
	width: 100%; max-width: 100%;
	background: var(--pp-surface); color: var(--pp-text);
	border: 2px solid var(--pp-border); border-radius: var(--pp-radius-sm);
	padding: .6rem .8rem; font: inherit;
}
input:focus, select:focus, textarea:focus { border-color: var(--pp-primary); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--pp-primary) 30%, transparent); }
label { font-weight: 700; }

/* ---------- BuddyPress Nouveau re-skin ---------- */
#buddypress, #buddypress * { font-family: inherit; }
#buddypress { color: var(--pp-text); }
#buddypress a { color: var(--pp-primary); }
#buddypress .item-body, #buddypress .item-header, #buddypress .bp-list > li,
#buddypress #item-header-cover-image, #buddypress .activity-list .activity-item,
#buddypress #whats-new-form, #buddypress .bp-card, #buddypress .bp-feedback, #buddypress .message-box {
	background: var(--pp-surface); color: var(--pp-text); border-color: var(--pp-border);
}
#buddypress .activity-list .activity-item, #buddypress .bp-list > li {
	border: 1px solid var(--pp-border); border-radius: var(--pp-radius);
	box-shadow: var(--pp-shadow); margin-bottom: 1rem; padding: 1rem;
}
#buddypress .bp-list { border: 0; background: transparent; }
#buddypress .activity-list .activity-item .activity-content,
#buddypress .activity-list .activity-item .activity-header,
#buddypress .activity-list .activity-item .activity-meta { background: transparent; color: var(--pp-text); }
#buddypress .avatar, #buddypress img.avatar { border-radius: 50%; }
#buddypress #whats-new-form { border: 1px solid var(--pp-border); border-radius: var(--pp-radius); padding: 1rem; }
#buddypress #whats-new { min-height: 90px; }

/* Directory/profile tabs become friendly pills */
#buddypress .main-navs ul, #buddypress .bp-navs ul { background: transparent; border: 0; }
#buddypress .bp-navs li a, #buddypress .main-navs li a {
	background: transparent; color: var(--pp-muted); border-radius: 999px; font-weight: 700; padding: .45rem 1rem;
}
#buddypress .bp-navs li.current a, #buddypress .bp-navs li.selected a,
#buddypress .main-navs li.current a, #buddypress .main-navs li.selected a,
#buddypress .bp-navs li a:hover {
	background: var(--pp-surface-2); color: var(--pp-primary); opacity: 1;
}
#buddypress .bp-navs li a span, #buddypress .main-navs li a span { background: var(--pp-accent); color: #fff; border-radius: 999px; }
#buddypress .subnav-filters, #buddypress .bp-subnavs { background: transparent; border: 0; }
#buddypress .bp-subnavs li.current a { background: var(--pp-primary); color: var(--pp-on-primary); }

/* Feedback / notices */
#buddypress .bp-feedback, #buddypress .message-box {
	border: 1px solid var(--pp-border); border-left: 5px solid var(--pp-primary);
	border-radius: var(--pp-radius-sm); box-shadow: none;
}
#buddypress .bp-feedback.error { border-left-color: var(--pp-accent); }
#buddypress .bp-feedback p { color: var(--pp-text); }

/* Tables (messages, notifications) */
#buddypress table, #buddypress table.notifications, #buddypress table.messages-notices {
	background: var(--pp-surface); color: var(--pp-text); border-color: var(--pp-border);
}
#buddypress table th, #buddypress table td { border-color: var(--pp-border); background: transparent; }
#buddypress table tr.alt td, #buddypress table tr:nth-child(even) td { background: var(--pp-surface-2); }
#buddypress .unread td, #buddypress tr.unread { border-left: 4px solid var(--pp-accent); }

/* Profile header */
#buddypress #item-header-content, #buddypress #item-header-content a, #buddypress .item-header-wrap { color: var(--pp-text); }
#buddypress #cover-image-container { border-radius: var(--pp-radius); overflow: hidden; }
#buddypress .activity-meta.action a { background: var(--pp-surface-2); color: var(--pp-text); border-radius: 999px; }
#buddypress dl.profile-fields, #buddypress .profile .bp-widget { color: var(--pp-text); }
#buddypress .profile-fields td.label { color: var(--pp-muted); }

/* Registration */
#buddypress #signup-form .register-section, #buddypress #register-page .layout-wrap { background: transparent; }
.pp-register-intro { text-align: center; margin-bottom: 1.5rem; }
.pp-register-intro h1 { color: var(--pp-primary); }
.pp-register-intro p { color: var(--pp-muted); margin: 0; }

/* Group & member directory cards */
#buddypress .grid.bp-list > li { padding: 1rem; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }

/* ---------- Nouveau fixes (v1.0.1) ---------- */
/* Profile header: Nouveau expects a dark cover image; use readable text instead. */
#buddypress .users-header, #buddypress .groups-header { margin-bottom: 1.5rem; }
#buddypress .users-header h2.user-nicename,
#buddypress .users-header .user-nicename,
#buddypress #item-header-content h2,
#buddypress #item-header-content .mention-name {
	color: var(--pp-primary); text-shadow: none; font-size: clamp(1.4rem, 4vw, 2rem); font-weight: 800;
}
#buddypress #item-header-content .activity, #buddypress #item-header-content .highlight { color: var(--pp-muted); text-shadow: none; }
#buddypress #item-header-avatar img { border: 4px solid var(--pp-surface); box-shadow: var(--pp-shadow); }

/* Activity action buttons (comment / favorite / delete): small and quiet */
#buddypress .activity-meta.action { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .75rem; }
#buddypress .activity-meta.action .button,
#buddypress .activity-meta.action a.button {
	background: transparent; color: var(--pp-muted); border: 1px solid var(--pp-border);
	padding: .3rem .8rem; font-size: .9rem; font-weight: 700; border-radius: 999px;
	min-height: 0; line-height: 1.4; box-shadow: none;
}
#buddypress .activity-meta.action .button:hover { background: var(--pp-surface-2); color: var(--pp-primary); border-color: var(--pp-primary); }
#buddypress .activity-meta.action .button.fav, #buddypress .activity-meta.action .button.unfav { color: var(--pp-accent); }
#buddypress .activity-meta.action .button .bp-screen-reader-text { position: absolute; left: -9999px; }

/* Activity cards */
#buddypress .activity-list .activity-item { display: flow-root; }
#buddypress .activity-list .activity-item div.item-avatar img { max-width: 56px; }
@media (min-width: 46.8em) {
	#buddypress .activity-list .activity-item div.item-avatar { width: 72px; margin-right: 1rem; }
	#buddypress .activity-list .activity-item div.item-avatar img { max-width: 100%; }
}
#buddypress .activity-list .activity-header { margin-bottom: .5rem; }
#buddypress .activity-list .activity-header a { font-weight: 800; text-decoration: none; }
#buddypress .activity-list .activity-header .time-since { color: var(--pp-muted); font-weight: 400; }
#buddypress .activity-inner { margin: .5rem 0; }

/* Sub-navigation bar (Personal / Mentions / Favorites ...) */
#buddypress .bp-subnavs, #buddypress #subnav, #buddypress .subnav-filters {
	background: transparent; border: 0; box-shadow: none;
}
#buddypress .bp-subnavs ul { display: flex; flex-wrap: wrap; gap: .35rem; margin: 0 0 1rem; padding: 0; }
#buddypress .bp-subnavs li, #buddypress .bp-subnavs li a { background: transparent; border: 0; box-shadow: none; }
#buddypress .bp-subnavs li a {
	display: inline-block; padding: .35rem .9rem; border-radius: 999px; color: var(--pp-muted);
	font-weight: 700; text-decoration: none; background: var(--pp-surface-2);
}
#buddypress .bp-subnavs li.current a, #buddypress .bp-subnavs li.selected a {
	background: var(--pp-primary); color: var(--pp-on-primary); text-decoration: none; border: 0;
}

/* Profile side navigation stacks vertically on wide screens */
@media (min-width: 46.8em) {
	#buddypress .bp-vertical-navs #object-nav ul, #buddypress.bp-vertical-navs #object-nav ul,
	.bp-vertical-navs #object-nav ul { display: flex; flex-direction: column; gap: .25rem; }
	.bp-vertical-navs #object-nav li { display: block; width: 100%; }
	.bp-vertical-navs #object-nav li a { display: block; }
}

/* Nouveau's dropdowns/selects */
#buddypress select, #buddypress .select-wrap select { background-color: var(--pp-surface); border: 2px solid var(--pp-border); border-radius: var(--pp-radius-sm); }
#buddypress .select-wrap { border: 0; background: transparent; }

/* ---------- Account dropdown ---------- */
.pp-nav { display: flex; gap: .25rem; }
.pp-account { position: relative; }
.pp-account summary { list-style: none; cursor: pointer; }
.pp-account summary::-webkit-details-marker { display: none; }
.pp-account summary:hover { background: var(--pp-surface-2); }
.pp-account__menu {
	position: absolute; right: 0; top: calc(100% + 6px); z-index: 70; min-width: 200px;
	list-style: none; margin: 0; padding: .4rem;
	background: var(--pp-surface); border: 1px solid var(--pp-border); border-radius: var(--pp-radius); box-shadow: var(--pp-shadow);
}
.pp-account__menu a { display: block; padding: .6rem .9rem; border-radius: var(--pp-radius-sm); color: var(--pp-text); text-decoration: none; font-weight: 700; }
.pp-account__menu a:hover { background: var(--pp-surface-2); color: var(--pp-primary); }
.pp-account__menu li:last-child { border-top: 1px solid var(--pp-border); margin-top: .3rem; padding-top: .3rem; }

/* ---------- Member profile: no banner, no sidebar ---------- */
body.bp-user #buddypress .users-header,
body.bp-user #buddypress #item-header { display: none; }

/* The left-hand menu becomes a row of tabs above the content. */
body.bp-user #buddypress .bp-navs.vertical { overflow: visible; }
body.bp-user #buddypress .bp-navs.vertical ul {
	float: none; width: 100%; border: 0; margin: 0 0 1rem;
	display: flex; flex-wrap: wrap; gap: .35rem;
}
body.bp-user #buddypress .bp-navs.vertical li { float: none; left: 0; margin: 0; width: auto; }
body.bp-user #buddypress .bp-navs.vertical li a { padding: .45rem 1rem; }
body.bp-user #buddypress .bp-navs.vertical li.selected a,
body.bp-user #buddypress .bp-navs.vertical li.current a { background: var(--pp-surface-2); color: var(--pp-primary); padding-left: 1rem; }
body.bp-user #buddypress .bp-navs.vertical li:hover { background: transparent; }
body.bp-user #buddypress .bp-navs.vertical li span { float: none; margin-left: .35rem; }
body.bp-user #buddypress .item-body:not(#group-create-body) {
	float: none; width: 100%; border: 0; padding: 0; min-height: 0; background: transparent;
}
body.bp-user #buddypress .item-body #subnav:not(.tabbed-links) { margin: 0; background: transparent; }

/* ---------- Profile tab fixes (v1.0.3) ---------- */
body.bp-user #buddypress #object-nav ul,
body.bp-user #buddypress .main-navs ul {
	display: flex !important; flex-direction: row !important; flex-wrap: wrap; gap: .35rem;
	float: none !important; width: 100% !important; border: 0 !important; margin: 0 0 1rem; padding: 0;
}
body.bp-user #buddypress #object-nav li,
body.bp-user #buddypress .main-navs li { float: none !important; width: auto !important; margin: 0 !important; left: 0 !important; display: block; }
body.bp-user #buddypress #object-nav li a,
body.bp-user #buddypress .main-navs li a { padding: .45rem 1rem !important; display: block; }
body.bp-user #buddypress #object-nav li.current a, body.bp-user #buddypress #object-nav li.selected a,
body.bp-user #buddypress .main-navs li.current a, body.bp-user #buddypress .main-navs li.selected a {
	background: var(--pp-surface-2) !important; color: var(--pp-primary) !important;
}

/* Sub-tabs (Personal / Mentions / ...) */
#buddypress #subnav li.current a, #buddypress #subnav li.selected a, #buddypress #subnav li a[aria-current],
#buddypress #subsubnav li.current a, #buddypress #subsubnav li.selected a,
#buddypress .bp-subnavs li.current a, #buddypress .bp-subnavs li.selected a {
	background: var(--pp-primary) !important; color: var(--pp-on-primary) !important;
	text-decoration: none !important; border: 0 !important;
}
#buddypress #subnav li, #buddypress #subsubnav li { border: 0 !important; background: transparent !important; }

/* "No activity" notice icon */
#buddypress .bp-feedback .bp-icon { background: var(--pp-primary); color: #fff; border-radius: var(--pp-radius-sm) 0 0 var(--pp-radius-sm); }
#buddypress .bp-feedback { align-items: center; }

/* ---------- Profile: main tabs removed (reachable from the account menu) ---------- */
body.bp-user #buddypress #object-nav,
body.bp-user #buddypress #item-nav { display: none !important; }

/* ---------- Groups ---------- */
/* Directory tabs (All Groups / My Groups) + search */
#buddypress .dir-navs ul, #buddypress .directory-nav ul, #buddypress nav.dir-navs ul {
	display: flex; flex-wrap: wrap; gap: .35rem; margin: 0 0 1rem; padding: 0; border: 0; background: transparent;
}
#buddypress .dir-navs li, #buddypress .dir-navs li a { border: 0; }
#buddypress .dir-navs li a { display: block; padding: .45rem 1rem; border-radius: 999px; background: transparent; color: var(--pp-muted); font-weight: 700; text-decoration: none; }
#buddypress .dir-navs li.selected a, #buddypress .dir-navs li.current a { background: var(--pp-surface-2); color: var(--pp-primary); }
#buddypress .dir-navs li a:hover { background: var(--pp-surface-2); }
#buddypress .dir-navs li span.count { background: var(--pp-accent); color: #fff; border-radius: 999px; padding: 0 .5em; margin-left: .3rem; font-size: .8rem; }

#buddypress .subnav-search, #buddypress .bp-dir-search-form, #buddypress #dir-groups-search-form { background: transparent; border: 0; }
#buddypress .bp-search form, #buddypress .bp-dir-search-form { display: flex; gap: .5rem; align-items: center; }
#buddypress .bp-search input[type="search"] { border-radius: 999px; padding-left: 1rem; }
#buddypress .bp-search button[type="submit"] { padding: .55rem .9rem; }
#buddypress #group-order-select, #buddypress .last.filter { margin-bottom: .75rem; }

/* Group cards */
#buddypress #groups-list {
	display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.25rem;
	list-style: none; margin: 1.25rem 0; padding: 0;
}
#buddypress #groups-list > li.item-entry {
	display: flex; margin: 0; padding: 0; width: auto; float: none;
	background: var(--pp-surface); border: 1px solid var(--pp-border); border-radius: var(--pp-radius);
	box-shadow: var(--pp-shadow); overflow: hidden; transition: transform .15s;
}
#buddypress #groups-list > li.item-entry:hover { transform: translateY(-2px); }
#buddypress #groups-list .list-wrap { display: flex; flex-direction: column; align-items: center; text-align: center; width: 100%; padding: 1.5rem 1.25rem; border: 0; background: transparent; }
#buddypress #groups-list .item-avatar { width: 96px; margin: 0 0 .75rem; float: none; }
#buddypress #groups-list .item-avatar img { width: 96px; height: 96px; max-width: 100%; border-radius: 50%; object-fit: cover; }
#buddypress #groups-list .item { display: flex; flex-direction: column; flex: 1; width: 100%; margin: 0; padding: 0; }
#buddypress #groups-list .item-block { width: 100%; float: none; margin: 0; }
#buddypress #groups-list .list-title { font-size: 1.2rem; margin: 0 0 .25rem; }
#buddypress #groups-list .list-title a { color: var(--pp-primary); text-decoration: none; font-weight: 800; }
#buddypress #groups-list .item-meta { color: var(--pp-muted); font-size: .9rem; margin: 0 0 .25rem; }
#buddypress #groups-list .group-desc { margin: .75rem 0; color: var(--pp-text); font-size: .98rem; flex: 1; }
#buddypress #groups-list .group-desc p { margin: 0; }
#buddypress #groups-list .groups-loop-buttons, #buddypress #groups-list .action { margin-top: .75rem; float: none; width: auto; }

/* Single group header */
#buddypress .groups-header { display: flex; flex-wrap: wrap; align-items: center; gap: 1.25rem; padding: 1.25rem; background: var(--pp-surface-2); border-radius: var(--pp-radius); }
#buddypress .groups-header #item-header-avatar { float: none; margin: 0; width: auto; }
#buddypress .groups-header #item-header-avatar img { width: 96px; height: 96px; border-radius: 50%; }
#buddypress .groups-header #item-header-content { flex: 1; min-width: 220px; float: none; width: auto; color: var(--pp-text); }
#buddypress .groups-header .group-description { color: var(--pp-text); margin-top: .5rem; }
#buddypress .groups-header .highlight, #buddypress .groups-header .activity { color: var(--pp-muted); }
#buddypress .groups-header .group-primary-actions, #buddypress .groups-header .groups-meta { margin-top: .5rem; }
#buddypress .groups-header .group-button.join-group, #buddypress .groups-header .generic-button .join-group { background: var(--pp-accent); border-color: var(--pp-accent); color: #fff; }

/* Group sub-navigation (Home / Members / Manage...) as pills */
body.groups #buddypress #object-nav ul, body.single-item.groups #buddypress #object-nav ul {
	display: flex; flex-wrap: wrap; gap: .35rem; margin: 1rem 0; padding: 0; float: none; width: 100%; border: 0;
}
body.groups #buddypress #object-nav li { float: none; width: auto; margin: 0; }
body.groups #buddypress #object-nav li.current a, body.groups #buddypress #object-nav li.selected a { background: var(--pp-surface-2); color: var(--pp-primary); }
body.groups #buddypress .bp-single-vert-nav .item-body, body.groups #buddypress .item-body:not(#group-create-body) { float: none; width: 100%; border: 0; padding: 0; min-height: 0; background: transparent; }

/* ---------- Members directory (same card look as groups) ---------- */
#buddypress #members-list {
	display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1.25rem;
	list-style: none; margin: 1.25rem 0; padding: 0;
}
#buddypress #members-list > li.item-entry {
	display: flex; margin: 0; padding: 0; width: auto; float: none;
	background: var(--pp-surface); border: 1px solid var(--pp-border); border-radius: var(--pp-radius);
	box-shadow: var(--pp-shadow); overflow: hidden; transition: transform .15s;
}
#buddypress #members-list > li.item-entry:hover { transform: translateY(-2px); }
#buddypress #members-list .list-wrap { display: flex; flex-direction: column; align-items: center; text-align: center; width: 100%; padding: 1.5rem 1rem; border: 0; background: transparent; }
#buddypress #members-list .item-avatar { width: 88px; margin: 0 0 .75rem; float: none; }
#buddypress #members-list .item-avatar img { width: 88px; height: 88px; max-width: 100%; border-radius: 50%; object-fit: cover; }
#buddypress #members-list .item { display: flex; flex-direction: column; width: 100%; flex: 1; margin: 0; padding: 0; }
#buddypress #members-list .item-block { width: 100%; float: none; margin: 0; }
#buddypress #members-list .list-title { font-size: 1.15rem; margin: 0 0 .25rem; }
#buddypress #members-list .list-title a { color: var(--pp-primary); text-decoration: none; font-weight: 800; }
#buddypress #members-list .item-meta { color: var(--pp-muted); font-size: .9rem; margin: 0 0 .5rem; }
#buddypress #members-list .item-extra-content { font-size: .9rem; color: var(--pp-text); margin-bottom: .5rem; }
#buddypress #members-list .members-meta.action, #buddypress #members-list .action { float: none; width: auto; margin-top: .5rem; }
#buddypress #members-list .members-meta.action ul, #buddypress #members-list ul.members-meta { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem; }
#buddypress #members-list .user-update { margin-top: .75rem; font-size: .9rem; color: var(--pp-muted); }

/* Member type / filter dropdowns */
#buddypress .subnav-filters { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; justify-content: space-between; margin-bottom: .75rem; }

/* Field visibility controls are never shown (all profile fields are public) */
#buddypress .field-visibility-settings-toggle, #buddypress .field-visibility-settings,
#buddypress .field-visibility-settings-notoggle { display: none !important; }

/* ---------- Members directory polish (v1.1) ---------- */
#buddypress .subnav-filters { padding: 0; margin: 0 0 1rem; }
#buddypress .subnav-search { flex: 1 1 280px; max-width: 460px; }
#buddypress .subnav-search form { display: flex; gap: .5rem; align-items: center; }
#buddypress .subnav-search input[type="search"] { flex: 1; min-width: 0; padding: .65rem 1rem; }
#buddypress .subnav-search button[type="submit"] { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 50%; padding: 0; }
#buddypress .component-filters select { min-width: 12rem; padding: .6rem 2.25rem .6rem .9rem; }

/* Filter row */
.pp-filters { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin: 0 0 1.25rem; padding: .75rem; background: var(--pp-surface-2); border-radius: var(--pp-radius); }
.pp-filter { flex: 1 1 180px; margin: 0; }
.pp-filter select, .pp-filter input { width: 100%; padding: .6rem .9rem; background-color: var(--pp-surface); border: 2px solid var(--pp-border); border-radius: var(--pp-radius-sm); font: inherit; font-size: .95rem; color: var(--pp-text); }
.pp-filter select:focus, .pp-filter input:focus { outline: 0; border-color: var(--pp-primary); box-shadow: 0 0 0 3px rgba(63, 107, 79, .2); }
.pp-filters-clear { background: none; border: 0; padding: .5rem .75rem; color: var(--pp-accent); font: inherit; font-weight: 700; cursor: pointer; text-decoration: underline; }

/* Cards */
#buddypress #members-list { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); align-items: stretch; }
#buddypress #members-list > li.item-entry { transition: transform .15s, box-shadow .15s; }
#buddypress #members-list > li.item-entry:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(43, 58, 47, .08), 0 10px 24px rgba(43, 58, 47, .1); }
#buddypress #members-list .list-wrap { padding: 1.5rem 1.25rem 1.25rem; }
#buddypress #members-list .item-avatar img { width: 96px; height: 96px; border: 3px solid var(--pp-surface-2); }
#buddypress #members-list .item-meta.last-activity { font-size: .8rem; margin-bottom: .75rem; }
#buddypress #members-list .item-extra-content { width: 100%; }

.pp-member-meta { display: flex; flex-direction: column; align-items: center; gap: .35rem; text-align: center; font-size: .92rem; line-height: 1.45; }
.pp-member-meta p { margin: 0; }
.pp-member-role { font-weight: 700; color: var(--pp-text); }
.pp-member-location { color: var(--pp-muted); font-size: .85rem; }
.pp-member-location::before { content: "\1F4CD\FE0E "; opacity: .7; }
.pp-member-bio { color: var(--pp-text); margin-top: .35rem !important; text-align: left; }
.pp-member-focus { list-style: none; margin: .5rem 0 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: .35rem; }
.pp-member-focus li { padding: .15rem .6rem; background: var(--pp-surface-2); color: var(--pp-primary); border-radius: 999px; font-size: .75rem; font-weight: 700; }
.pp-member-links { margin-top: .5rem !important; font-size: .85rem; font-weight: 700; }
.pp-member-links a { color: var(--pp-primary); text-decoration: none; }
.pp-member-links a:hover { text-decoration: underline; }

/* Action buttons sit centered at the bottom, not hanging off the left edge */
#buddypress #members-list .members-meta.action { margin-top: auto; padding-top: 1rem; width: 100%; }
#buddypress #members-list .members-meta.action .generic-button, #buddypress #members-list .members-meta.action .generic-button button { margin: 0; }

/* ---------- Search + sort controls (v1.2) ---------- */
#buddypress .bp-search form, #buddypress .subnav-search form {
	display: flex; align-items: center; gap: .5rem; margin: 0; padding: 0; border: 0; background: transparent; box-shadow: none;
}
#buddypress .bp-search label { flex: 1; margin: 0; }
#buddypress .bp-search input[type="search"], #buddypress .bp-search input[type="text"] {
	width: 100%; height: 46px; padding: 0 1rem; line-height: normal;
	border: 2px solid var(--pp-border); border-radius: 999px; background: var(--pp-surface); font: inherit; color: var(--pp-text);
}
#buddypress .bp-search button[type="submit"], #buddypress .bp-search .nouveau-search-submit {
	display: inline-flex; align-items: center; justify-content: center; flex: 0 0 46px; width: 46px; height: 46px; padding: 0; margin: 0;
	border: 0; border-radius: 50%; background: var(--pp-primary); color: var(--pp-on-primary); cursor: pointer; font-size: 0; line-height: 1;
}
#buddypress .bp-search button[type="submit"]:hover { background: var(--pp-primary-hover); }
#buddypress .bp-search button[type="submit"] .dashicons { font-size: 20px; width: 20px; height: 20px; line-height: 1; }

/* Last Active / order-by dropdown: roomy, with one custom arrow */
#buddypress .component-filters { margin: 0; }
#buddypress .select-wrap { position: relative; display: block; min-width: 13rem; }
#buddypress .select-wrap select {
	width: 100%; height: 46px; padding: 0 2.5rem 0 1rem; line-height: 46px; overflow: visible;
	appearance: none; -webkit-appearance: none; font: inherit; color: var(--pp-text); cursor: pointer;
}
#buddypress .select-wrap .select-arrow { position: absolute; right: 1rem; top: 50%; transform: translateY(-50%); pointer-events: none; display: block; }
#buddypress .select-wrap .select-arrow::before { content: ""; display: block; width: 8px; height: 8px; border: solid var(--pp-primary); border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-2px, -2px); }
#buddypress .select-wrap:hover, #buddypress .select-wrap:focus { border: 0; box-shadow: none; }
.pp-filter select { height: 46px; padding: 0 1rem; appearance: auto; }
.pp-filter input { height: 46px; }

/* ---------- Icons + unified fields (v1.3) ---------- */
/* `#buddypress * { font-family: inherit }` above also wiped the icon font off real icon elements. */
#buddypress .dashicons, #buddypress [class*="dashicons-"], #buddypress button.dashicons, #buddypress a.button.dashicons,
#buddypress form button[type="submit"] > span:not(.bp-screen-reader-text):not(.screen-reader-text) { font-family: dashicons !important; }
#buddypress .bp-search button[type="submit"] > span { font-size: 20px; line-height: 1; width: auto; height: auto; }
#buddypress .bp-search button[type="submit"] > span.bp-screen-reader-text { font-family: inherit !important; }

/* One look for every text/select box in the directory controls */
#buddypress .bp-search input[type="search"], #buddypress .bp-search input[type="text"],
#buddypress .select-wrap select,
.pp-filter select, .pp-filter input {
	display: block; width: 100%; height: 46px; margin: 0; padding: 0 1rem; box-sizing: border-box;
	background-color: var(--pp-surface); color: var(--pp-text);
	border: 2px solid var(--pp-border); border-radius: var(--pp-radius-sm);
	font: inherit; font-size: 1rem; line-height: normal; box-shadow: none; text-indent: 0; overflow: visible;
}
#buddypress .select-wrap select, .pp-filter select {
	appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 2.5rem;
	background-image: linear-gradient(45deg, transparent 50%, var(--pp-primary) 50%), linear-gradient(135deg, var(--pp-primary) 50%, transparent 50%);
	background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px, 6px 6px; background-repeat: no-repeat;
}
#buddypress .select-wrap .select-arrow { display: none; }
#buddypress .bp-search input:focus, #buddypress .select-wrap select:focus, .pp-filter select:focus, .pp-filter input:focus {
	outline: 0; border-color: var(--pp-primary); box-shadow: 0 0 0 3px rgba(63, 107, 79, .2);
}
#buddypress .select-wrap { min-width: 14rem; padding: 0; border: 0; background: transparent; box-shadow: none; }
#buddypress .select-wrap:hover, #buddypress .select-wrap:focus, #buddypress .select-wrap:focus-within { border: 0; box-shadow: none; }
#buddypress .component-filters, #buddypress .component-filters .filter { margin: 0; padding: 0; }

/* ---------- Icons on Messages, Notifications, Settings (v1.4) ---------- */
#buddypress .bp-icon, #buddypress .bp-icons, #buddypress .bp-icons:before, #buddypress .bp-icon:before,
#buddypress [class*="dashicons"]:before, #buddypress .dashicons:before,
#buddypress .message-action-star:before, #buddypress .message-action-unstar:before, #buddypress .message-action-view:before,
#buddypress .message-action-delete:before, #buddypress .message-action-exit:before { font-family: dashicons !important; font-style: normal; font-weight: 400; text-transform: none; }
#buddypress .dashicons, #buddypress [class*="dashicons-"] { display: inline-block; width: 20px; height: 20px; font-size: 20px; line-height: 1; text-align: center; vertical-align: middle; }
#buddypress .dashicons:before, #buddypress [class*="dashicons-"]:before { display: inline-block; }
/* Icon-only message actions: plain icons, not green pill buttons */
#buddypress .bp-icons { background: none; border: 0; padding: .3em .5em; color: var(--pp-primary); box-shadow: none; }
#buddypress .bp-icons:hover { background: none; color: var(--pp-primary-hover); }
#buddypress .message-action-star:before { color: #aaa; }
#buddypress .message-action-unstar:before { color: #e0a82e; }
/* Notification actions and order arrows */
#buddypress .notification-actions a, #buddypress .notifications-order-actions a { color: var(--pp-primary); background: none; border: 0; box-shadow: none; }
/* Password show/hide toggle */
#buddypress .wp-hide-pw { display: inline-flex; align-items: center; justify-content: center; padding: .4rem .6rem; }
#buddypress .wp-hide-pw .dashicons { color: inherit; }

/* ---------- TinyMCE editor (message compose, etc.) (v1.5) ---------- */
/* `#buddypress * { font-family: inherit }` and the pill-button skin both hit the editor's own icon font and toolbar buttons. */
#buddypress .mce-ico, #buddypress .mce-ico.mce-i-none, #buddypress i.mce-ico { font-family: tinymce, Arial !important; font-style: normal; font-weight: 400; font-variant: normal; text-transform: none; line-height: 1; }
#buddypress .mce-btn-small .mce-ico { font-family: tinymce-small, Arial !important; }
#buddypress .mce-ico.mce-i-none { font-family: inherit !important; }
#buddypress .mce-btn button, #buddypress .mce-menubtn button, #buddypress .mce-toolbar .mce-btn button {
	background: transparent; color: inherit; border: 0; border-radius: 0; box-shadow: none; padding: 4px 6px; font-weight: 400; transform: none;
}
#buddypress .mce-btn:hover, #buddypress .mce-btn:focus, #buddypress .mce-btn.mce-active { background: var(--pp-surface-2); border-radius: var(--pp-radius-sm); }
#buddypress .mce-btn button:hover { background: transparent; color: inherit; }
#buddypress .mce-toolbar .mce-ico, #buddypress .mce-btn .mce-ico { font-size: 16px; }
#buddypress .mce-caret { border-top-color: currentColor; }
/* Text-mode (Visual/Text) tabs and quicktags buttons keep their own look */
#buddypress .wp-editor-tabs button, #buddypress .quicktags-toolbar input.ed_button { border-radius: var(--pp-radius-sm); }

/* Editor toolbar icon colour: dark green on the light toolbar (was inheriting white from the pill-button skin) */
#buddypress .mce-btn button, #buddypress .mce-btn .mce-ico, #buddypress .mce-btn .mce-txt, #buddypress .mce-menubtn .mce-caret,
#buddypress .mce-btn button:hover, #buddypress .mce-btn:hover .mce-ico { color: var(--pp-text) !important; }
#buddypress .mce-btn.mce-active .mce-ico, #buddypress .mce-btn.mce-active button { color: var(--pp-primary) !important; }
#buddypress .mce-btn.mce-disabled .mce-ico { color: var(--pp-border) !important; }

/* ---------- TinyMCE icon fonts, declared here so they never depend on the editor's own stylesheet (v1.6) ---------- */
@font-face { font-family: "pp-tinymce"; src: url("../../../wp-includes/js/tinymce/skins/lightgray/fonts/tinymce.woff") format("woff"), url("../../../wp-includes/js/tinymce/skins/lightgray/fonts/tinymce.ttf") format("truetype"); font-weight: normal; font-style: normal; font-display: block; }
@font-face { font-family: "pp-tinymce-small"; src: url("../../../wp-includes/js/tinymce/skins/lightgray/fonts/tinymce-small.woff") format("woff"), url("../../../wp-includes/js/tinymce/skins/lightgray/fonts/tinymce-small.ttf") format("truetype"); font-weight: normal; font-style: normal; font-display: block; }
#buddypress .mce-ico, #buddypress i.mce-ico { font-family: "pp-tinymce", tinymce, Arial !important; }
#buddypress .mce-btn-small .mce-ico { font-family: "pp-tinymce-small", tinymce-small, Arial !important; }
#buddypress .mce-ico.mce-i-none { font-family: inherit !important; }

/* ---------- TinyMCE toolbar icons drawn with Dashicons (v1.7) ---------- */
#buddypress .mce-btn .mce-ico[class*="mce-i-"]:not(.mce-i-none):not(.mce-i-image)::before { font-family: dashicons !important; font-size: 20px; line-height: 1; display: inline-block; width: 20px; height: 20px; text-align: center; }
#buddypress .mce-ico.mce-i-bold::before { content: "\f200" !important; }
#buddypress .mce-ico.mce-i-italic::before { content: "\f201" !important; }
#buddypress .mce-ico.mce-i-bullist::before { content: "\f203" !important; }
#buddypress .mce-ico.mce-i-numlist::before { content: "\f204" !important; }
#buddypress .mce-ico.mce-i-blockquote::before { content: "\f205" !important; }
#buddypress .mce-ico.mce-i-alignleft::before { content: "\f206" !important; }
#buddypress .mce-ico.mce-i-aligncenter::before { content: "\f207" !important; }
#buddypress .mce-ico.mce-i-alignright::before { content: "\f208" !important; }
#buddypress .mce-ico.mce-i-wp_more::before { content: "\f209" !important; }
#buddypress .mce-ico.mce-i-spellchecker::before { content: "\f210" !important; }
#buddypress .mce-ico.mce-i-fullscreen::before { content: "\f211" !important; }
#buddypress .mce-ico.mce-i-wp_adv::before { content: "\f212" !important; }
#buddypress .mce-ico.mce-i-underline::before { content: "\f213" !important; }
#buddypress .mce-ico.mce-i-alignjustify::before { content: "\f214" !important; }
#buddypress .mce-ico.mce-i-pastetext::before { content: "\f216" !important; }
#buddypress .mce-ico.mce-i-removeformat::before { content: "\f217" !important; }
#buddypress .mce-ico.mce-i-charmap::before { content: "\f220" !important; }
#buddypress .mce-ico.mce-i-outdent::before { content: "\f221" !important; }
#buddypress .mce-ico.mce-i-indent::before { content: "\f222" !important; }
#buddypress .mce-ico.mce-i-wp_help::before { content: "\f223" !important; }
#buddypress .mce-ico.mce-i-strikethrough::before { content: "\f224" !important; }
#buddypress .mce-ico.mce-i-unlink::before { content: "\f225" !important; }
#buddypress .mce-ico.mce-i-rtl::before { content: "\f320" !important; }
#buddypress .mce-ico.mce-i-link::before { content: "\f103" !important; }
#buddypress .mce-ico.mce-i-undo::before { content: "\f171" !important; }
#buddypress .mce-ico.mce-i-redo::before { content: "\f172" !important; }
#buddypress .mce-ico.mce-i-wp_code::before { content: "\f475" !important; }
#buddypress .mce-ico.mce-i-wp_page::before { content: "\f474" !important; }
#buddypress .mce-ico.mce-i-table::before { content: "\f535" !important; }
#buddypress .mce-ico.mce-i-forecolor::before { content: "\f215" !important; }
#buddypress .mce-ico.mce-i-hr::before { content: "\f460" !important; }
#buddypress .mce-ico.mce-i-dfw::before { content: "\f211" !important; }
#buddypress .mce-ico.mce-i-wp_fullscreen::before { content: "\f211" !important; }

/* ---------- Member cards: icon links, left-aligned grid (v1.8) ---------- */
.pp-member-links { display: flex; justify-content: center; gap: .5rem; }
.pp-member-links a { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; background: var(--pp-surface-2); color: var(--pp-primary); transition: background .15s, color .15s; }
.pp-member-links a:hover { background: var(--pp-primary); color: var(--pp-on-primary); text-decoration: none; }
.pp-member-links .dashicons { width: 20px; height: 20px; font-size: 20px; line-height: 20px; }

#buddypress #members-list { justify-content: start; justify-items: stretch; width: 100%; max-width: none; margin-left: 0; margin-right: 0; padding-left: 0; padding-right: 0; }
#buddypress #members-list > li.item-entry { margin-left: 0; margin-right: 0; justify-self: stretch; width: auto; max-width: none; }

/* Nouveau's clearfix pseudo-elements become empty grid cells and push the cards over by one column. */
#buddypress #members-list::before, #buddypress #members-list::after,
#buddypress #groups-list::before, #buddypress #groups-list::after { display: none; content: none; }

/* Action buttons (Add Friend, etc.) flow below the card content instead of floating over it (Nouveau pins them with position:absolute). */
#buddypress #members-list > li .action, #buddypress #members-list > li .members-meta.action {
	position: static; bottom: auto; left: auto; top: auto; width: 100%; height: auto; padding: 1rem 0 0; margin: auto 0 0; text-align: center;
}
#buddypress #members-list > li .action .generic-button { width: auto; margin: 0; display: inline-block; }
#buddypress #members-list > li .action .generic-button a, #buddypress #members-list > li .action .generic-button button { width: auto; }
#buddypress #members-list > li .list-wrap { padding-bottom: 1.5rem; }

/* ---------- Message CTA on member cards (v1.9) ---------- */
#buddypress #members-list > li .members-meta.action, #buddypress #members-list > li .action {
	display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: .5rem;
}
#buddypress #members-list > li .pp-message-btn { order: -1; flex: 1 1 100%; }
#buddypress #members-list > li .pp-message-link {
	display: flex; align-items: center; justify-content: center; gap: .4rem; width: 100%;
	background: var(--pp-accent); border-color: var(--pp-accent); color: #fff; font-size: 1rem; padding: .65rem 1.25rem;
}
#buddypress #members-list > li .pp-message-link:hover { background: #a8532f; border-color: #a8532f; color: #fff; }
#buddypress #members-list > li .pp-message-link .dashicons { width: 20px; height: 20px; font-size: 20px; line-height: 20px; }
/* Add Friend becomes the quieter, outlined secondary action */
#buddypress #members-list > li .action .generic-button:not(.pp-message-btn) a,
#buddypress #members-list > li .action .generic-button:not(.pp-message-btn) button {
	background: transparent; color: var(--pp-primary); border: 2px solid var(--pp-primary); font-size: .9rem; padding: .4rem 1rem;
}
#buddypress #members-list > li .action .generic-button:not(.pp-message-btn) a:hover,
#buddypress #members-list > li .action .generic-button:not(.pp-message-btn) button:hover { background: var(--pp-primary); color: var(--pp-on-primary); }

/* ---------- Caps lock warning on the register page ---------- */
/* WP's forms.css (which hides this until Caps Lock is pressed) isn't loaded on the front end. */
.caps-warning { display: none; align-items: center; margin-top: .4rem; padding: .35rem .6rem; background: #fcf9e8; border: 1px solid #f0c33c; border-radius: var(--pp-radius-sm); color: #1d2327; font-size: .875rem; }
.caps-warning .caps-icon { display: inline-flex; flex: 0 0 20px; width: 20px; height: 20px; margin-right: .4rem; }
.caps-warning .caps-icon svg { width: 20px; height: 20px; }
