/**
 * Reskins BuddyPress and bbPress's OWN default templates (Nouveau/Legacy for
 * BP, the standard bbPress template pack) using our design tokens — this
 * theme does NOT ship full copies of their ~40+ template files. BP/bbPress
 * both render through the active theme's header.php/footer.php automatically,
 * so this file just needs to restyle their existing markup, not replace it.
 *
 * Caveat worth knowing: exact class names shift a little between BuddyPress
 * template packs (Nouveau vs. legacy) and bbPress versions. The selectors
 * below target the stable, well-documented ones, and the body-level type/
 * link-color rules in main.css already cascade into BP/bbPress content
 * regardless — so even an unmatched selector here degrades gracefully rather
 * than looking unstyled. Treat this as a strong starting reskin, and expect
 * to spot-check it against your actual BuddyPress/bbPress versions.
 */

/* ---------- Shared wrapper ---------- */

#buddypress {
	background: var(--inw-paper);
	border: 1px solid var(--inw-border);
	padding: 2rem;
	margin: 2rem 0;
	font-family: var(--inw-font-body);
}

#bbpress-forums {
	background: var(--inw-paper);
	border: 1px solid var(--inw-border);
	padding: 2rem;
	margin: 2rem 0;
	font-family: var(--inw-font-body);
}

/* Password field + show/hide toggle. Sits in normal document flow below the
   input rather than overlaid on it. */
#buddypress .wp-pwd input[type="password"],
#buddypress .wp-pwd input[type="text"] {
	margin-bottom: 0;
}

#buddypress .wp-pwd .wp-hide-pw {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin-top: 0.5em;
	padding: 0.4em 0.7em;
	background: transparent;
	border: 1px solid var(--inw-border);
	border-radius: var(--inw-radius-sm);
	box-shadow: none;
	cursor: pointer;
	color: var(--inw-gray);
}

#buddypress .wp-pwd .wp-hide-pw:hover {
	background: transparent;
	color: var(--inw-red);
	border-color: var(--inw-red);
}

#buddypress #pass-strength-result {
	margin-top: 0.6em;
}

/* Defensive: some BuddyPress icons/SVGs (accordion toggles, field-type
   indicators) ship without an explicit size in certain versions, and an
   unstyled SVG can render at the browser's default size — which is large.
   Capping icon-sized elements specifically within forms (not all of
   #buddypress) fixes that failure mode without shrinking legitimate content
   like avatar or cover images elsewhere on profile/activity screens. */
#buddypress form svg,
#buddypress form .dashicons,
#buddypress .wp-pwd svg,
#buddypress .wp-pwd .dashicons,
#buddypress .pw-weak svg {
	width: 20px;
	height: 20px;
	max-width: 20px;
	max-height: 20px;
	font-size: 20px;
}

#buddypress h2,
#buddypress h3,
#bbpress-forums h2,
#bbpress-forums h3 {
	font-family: var(--inw-font-display);
}

/* ---------- Tabs / nav (directories, group nav, member nav) ---------- */

#buddypress .item-list-tabs ul,
#buddypress div.item-list-tabs ul {
	list-style: none;
	display: flex;
	gap: 0.5rem;
	padding: 0;
	margin: 0 0 1.5rem;
	border-bottom: 2px solid var(--inw-ink);
}

#buddypress .item-list-tabs ul li a {
	display: inline-block;
	padding: 0.6em 1em;
	font-family: var(--inw-font-mono);
	font-size: 0.8rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	text-decoration: none;
	color: var(--inw-gray);
}

#buddypress .item-list-tabs ul li.selected a,
#buddypress .item-list-tabs ul li.current a {
	color: var(--inw-red);
	font-weight: 700;
}

/* ---------- Lists (members, groups, activity) ---------- */

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

#buddypress .bp-list > li,
#buddypress ul.item-list > li {
	display: flex;
	gap: 1rem;
	align-items: flex-start;
	padding: 1.2em 0;
	border-bottom: 1px dashed var(--inw-border);
}

#buddypress .avatar {
	border: 1.5px solid var(--inw-ink);
	border-radius: 4px;
}

/* ---------- Activity stream ---------- */

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

#buddypress .activity-list > li {
	padding: 1.2em 0;
	border-bottom: 1px dashed var(--inw-border);
}

#buddypress .activity-content {
	font-size: 0.95rem;
}

#buddypress .activity-header {
	margin-bottom: 0.4em;
}

/* ---------- Buttons & forms ---------- */

#buddypress a.button,
#buddypress input[type="submit"],
#buddypress button,
#bbpress-forums input[type="submit"],
#bbpress-forums .button,
#bbpress-forums #bbp-search-form button {
	font-family: var(--inw-font-body);
	font-weight: 700;
	font-size: 0.9rem;
	padding: 0.55em 1.1em;
	border-radius: var(--inw-radius);
	border: 1.5px solid var(--inw-ink);
	background: var(--inw-ink);
	color: var(--inw-paper);
	cursor: pointer;
}

#buddypress a.button:hover,
#buddypress input[type="submit"]:hover,
#bbpress-forums input[type="submit"]:hover {
	background: var(--inw-red);
	border-color: var(--inw-red-dark);
}

#buddypress input[type="text"],
#buddypress input[type="email"],
#buddypress input[type="password"],
#buddypress textarea,
#bbpress-forums input[type="text"],
#bbpress-forums textarea {
	font-family: var(--inw-font-body);
	border: 1.5px solid var(--inw-ink);
	border-radius: var(--inw-radius);
	padding: 0.5em;
}

/* ---------- bbPress forum/topic lists ---------- */

#bbpress-forums ul.bbp-forums,
#bbpress-forums ul.bbp-topics,
#bbpress-forums ul.bbp-replies {
	border: 1px solid var(--inw-border);
}

#bbpress-forums li.bbp-header,
#bbpress-forums li.bbp-body > ul {
	border-bottom: 1px dashed var(--inw-border);
}

#bbpress-forums li.bbp-footer {
	display: none; /* redundant pagination footer row in some template versions */
}

#bbpress-forums .bbp-forum-title,
#bbpress-forums .bbp-topic-title {
	font-weight: 700;
	text-decoration: none;
}

#bbpress-forums .bbp-topic-meta,
#bbpress-forums .bbp-forum-meta {
	font-family: var(--inw-font-mono);
	font-size: 0.75rem;
	color: var(--inw-gray);
}

#bbpress-forums fieldset.bbp-form {
	border: 1px solid var(--inw-border);
	padding: 1.5rem;
	margin-bottom: 1.5rem;
}

#bbpress-forums fieldset.bbp-form legend {
	font-family: var(--inw-font-display);
	padding: 0 0.5em;
}

/* ---------- Group header (used on region group pages) ---------- */

#buddypress #item-header {
	background: var(--inw-ink);
	color: var(--inw-paper);
	padding: 2rem;
	margin: -2rem -2rem 2rem;
}

#buddypress #item-header h2,
#buddypress #item-header a {
	color: var(--inw-paper);
}
