/**
 * artorganic.world Community page and bbPress forums
 * (page-community.php, brand/mockup-community.html)
 *
 * Enqueued from functions.php on bbPress pages only, after global.css.
 * Part 1 styles the Community page, scoped to .ao-community; two classes
 * (0,2,0) outrank global.css's "body a" / "body h2" rules.
 * Part 2 styles bbPress's own forum, topic and reply views. bbPress and
 * OceanWP both style "#bbpress-forums ...", so these rules use
 * "body:not(#ao-boost) #bbpress-forums" (two IDs) to win without !important.
 * Colours, fonts and radii come from tokens.css.
 */

/* Avatar and icon tints, one per forum (mockup values; --sand is a token). */
:root {
	--ao-tint-1: #E9DCCB;
	--ao-tint-2: var(--sand);
	--ao-tint-3: #D6DCEA;
	--ao-tint-4: #EBD3C7;
}

/* ================================================================== */
/* Part 1: Community page                                              */
/* ================================================================== */

.ao-community {
	--ao-gutter: var(--space-3);

	color: var(--ink);
	background-color: var(--paper);
}

.ao-community *,
.ao-community *::before,
.ao-community *::after {
	box-sizing: border-box;
}

.ao-community .ao-container {
	max-width: 1240px;
	margin-inline: auto;
	padding-inline: var(--ao-gutter);
}

.ao-community p {
	margin: 0;
}

.ao-community .ao-tint-1 { background-color: var(--ao-tint-1); }
.ao-community .ao-tint-2 { background-color: var(--ao-tint-2); }
.ao-community .ao-tint-3 { background-color: var(--ao-tint-3); }
.ao-community .ao-tint-4 { background-color: var(--ao-tint-4); }

/* Shared small grey line: counts, forum and author, dates. */
.ao-community .ao-community__meta {
	font-size: var(--fs-xs);
	line-height: 1.5;
	color: var(--muted);
}

/* ------------------------------------------------------------------ */
/* Button                                                              */
/* ------------------------------------------------------------------ */

.ao-community .ao-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	padding: 12px 28px;
	border: 1.5px solid var(--indigo);
	border-radius: var(--radius-lg);
	font-size: var(--fs-sm);
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.ao-community .ao-btn--solid {
	background-color: var(--indigo);
	color: var(--paper);
}

.ao-community .ao-btn--outline {
	background-color: transparent;
	color: var(--indigo);
}

.ao-community .ao-btn:is(:hover, :focus-visible) {
	background-color: var(--ink);
	border-color: var(--ink);
	color: var(--paper);
}

/* ------------------------------------------------------------------ */
/* Members-only box (logged-out visitors)                              */
/* ------------------------------------------------------------------ */

/* Under the intro on the Community page; alone on forum URLs. */
.ao-community .ao-community__gate {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--space-2);
	padding-block: 56px var(--space-10);
}

.ao-community--gate .ao-community__gate {
	padding-top: clamp(var(--space-6), 8vw, var(--space-10));
}

.ao-community .ao-community__gate .ao-eyebrow a {
	color: inherit;
	text-decoration: none;
}

.ao-community .ao-community__gate .ao-eyebrow a:is(:hover, :focus-visible) {
	text-decoration: underline;
	text-underline-offset: 0.2em;
}

.ao-community .ao-community__members {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--space-2);
	width: 100%;
	max-width: 640px;
	padding: clamp(var(--space-4), 5vw, var(--space-6));
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background-color: var(--paper);
	text-align: center;
}

.ao-community .ao-community__members-title {
	margin: 0;
	font-family: var(--font-display);
	font-size: clamp(var(--fs-md), 1.4vw + 1rem, var(--fs-xl));
	font-weight: 700;
	line-height: 1.15;
	letter-spacing: -0.01em;
	color: var(--ink);
}

.ao-community .ao-community__members p {
	max-width: 480px;
	font-size: var(--fs-base);
	line-height: 1.6;
	color: var(--ink-soft);
}

.ao-community .ao-actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 12px;
	margin-top: var(--space-1);
}

/* ------------------------------------------------------------------ */
/* Hero band                                                           */
/* ------------------------------------------------------------------ */

.ao-community .ao-community__hero {
	background-color: var(--paper-2);
}

.ao-community .ao-community__hero-inner {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: var(--space-3);
	padding-block: clamp(var(--space-5), 6vw, var(--space-8)) 56px;
}

.ao-community .ao-community__hero-text {
	flex: 1 1 min(520px, 100%);
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.ao-community .ao-eyebrow {
	font-size: var(--fs-xs);
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--pigment);
}

.ao-community .ao-community__title {
	margin: 0;
	font-family: var(--font-display);
	font-size: clamp(var(--fs-xl), 3.4vw + 1rem, var(--fs-3xl));
	font-weight: 700;
	line-height: 1.05;
	letter-spacing: -0.02em;
	color: var(--ink);
}

.ao-community .ao-community__lead {
	max-width: 600px;
	font-size: clamp(var(--fs-base), 0.2vw + 1rem, 18px);
	line-height: 1.55;
	color: var(--ink-soft);
}

/* ------------------------------------------------------------------ */
/* Forum cards                                                         */
/* ------------------------------------------------------------------ */

.ao-community .ao-community__forums {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr));
	gap: var(--space-3);
	padding-block: 56px var(--space-3);
}

.ao-community .ao-community__forum {
	display: flex;
	align-items: flex-start;
	gap: 20px;
	padding: var(--space-4);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	color: var(--ink);
	text-decoration: none;
	transition: border-color 0.15s ease, background-color 0.15s ease;
}

.ao-community .ao-community__forum:is(:hover, :focus-visible) {
	border-color: var(--indigo);
	background-color: var(--paper-2);
	color: var(--ink);
}

.ao-community .ao-community__forum-icon {
	display: flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	border-radius: 50%;
	color: var(--indigo);
}

.ao-community .ao-community__forum-body {
	display: flex;
	flex-direction: column;
	gap: var(--space-1);
	min-width: 0;
}

.ao-community .ao-community__forum-title {
	font-family: var(--font-display);
	font-size: clamp(var(--fs-md), 0.6vw + 1.1rem, 26px);
	font-weight: 700;
	line-height: 1.2;
}

.ao-community .ao-community__forum:is(:hover, :focus-visible) .ao-community__forum-title {
	color: var(--indigo);
}

.ao-community .ao-community__forum-desc {
	line-height: 1.6;
	color: var(--ink-soft);
}

/* ------------------------------------------------------------------ */
/* Recent topics, latest replies, guidelines                           */
/* ------------------------------------------------------------------ */

.ao-community .ao-community__main {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: var(--space-5);
	padding-block: var(--space-4) var(--space-10);
}

.ao-community .ao-community__feeds {
	flex: 999 1 min(560px, 100%);
	display: flex;
	flex-direction: column;
	gap: var(--space-6);
	min-width: 0;
}

.ao-community .ao-community__h2 {
	margin: 0 0 var(--space-2);
	font-family: var(--font-display);
	font-size: var(--fs-lg);
	font-weight: 700;
	line-height: 1.2;
	color: var(--ink);
}

.ao-community .ao-community__list {
	margin: 0;
	padding: 0;
	list-style: none;
	border-top: 1px solid var(--line);
}

.ao-community .ao-community__list > li {
	margin: 0;
	border-bottom: 1px solid var(--line);
}

.ao-community .ao-community__row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--space-1) var(--space-2);
	padding: 18px var(--space-0-5);
	color: var(--ink);
	text-decoration: none;
}

.ao-community .ao-community__row:is(:hover, :focus-visible) {
	background-color: var(--paper-2);
	color: var(--ink);
}

.ao-community .ao-community__avatar {
	display: flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	font-family: var(--font-display);
	font-size: var(--fs-sm);
	font-weight: 700;
	color: var(--ink);
}

.ao-community .ao-community__row-main {
	flex: 1 1 min(320px, calc(100% - 56px));
	display: flex;
	flex-direction: column;
	gap: var(--space-0-5);
	min-width: 0;
}

.ao-community .ao-community__row-title {
	font-size: var(--fs-base);
	font-weight: 600;
	line-height: 1.35;
	overflow-wrap: anywhere;
}

.ao-community .ao-community__row:is(:hover, :focus-visible) .ao-community__row-title {
	color: var(--indigo);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
}

.ao-community .ao-community__excerpt {
	font-size: var(--fs-sm);
	line-height: 1.5;
	color: var(--ink-soft);
}

.ao-community .ao-community__empty {
	padding: var(--space-3) 0;
	border-bottom: 1px solid var(--line);
	color: var(--ink-soft);
}

.ao-community .ao-community__guide {
	flex: 1 1 280px;
	max-width: 360px;
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 28px;
	border-radius: var(--radius);
	background-color: var(--paper-2);
}

.ao-community .ao-community__guide h2 {
	margin: 0;
	font-family: var(--font-display);
	font-size: var(--fs-md);
	font-weight: 700;
	line-height: 1.2;
	color: var(--ink);
}

.ao-community .ao-community__guide ul {
	margin: 0;
	padding-left: 20px;
	line-height: 1.7;
	color: var(--ink-soft);
}

.ao-community .ao-community__guide a {
	font-weight: 600;
	color: var(--indigo);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
}

.ao-community .ao-community__guide a:is(:hover, :focus-visible) {
	color: var(--pigment);
}

/* ------------------------------------------------------------------ */
/* Small screens (down to 390px)                                       */
/* ------------------------------------------------------------------ */

@media (max-width: 767px) {
	.ao-community .ao-community__main {
		padding-bottom: var(--space-8);
	}

	/* The guide goes full width under the lists. */
	.ao-community .ao-community__guide {
		max-width: none;
	}

	/* Stats line up under the title, next to the avatar's column. */
	.ao-community .ao-community__row-stats {
		padding-left: 56px;
	}
}

@media (max-width: 600px) {
	.ao-community {
		--ao-gutter: var(--space-2);
	}

	.ao-community .ao-community__hero-inner > .ao-btn {
		flex: 1 1 auto;
	}

	.ao-community .ao-community__forums {
		padding-top: var(--space-5);
		gap: var(--space-2);
	}

	.ao-community .ao-community__forum {
		gap: var(--space-2);
		padding: 20px;
	}

	.ao-community .ao-community__forum-icon {
		width: 48px;
		height: 48px;
	}

	.ao-community .ao-community__guide {
		padding: var(--space-3);
	}

	.ao-community .ao-community__gate {
		padding-block: var(--space-5) var(--space-8);
	}

	.ao-community .ao-community__members {
		padding: var(--space-4) 20px;
	}

	/* Both buttons full width, stacked, at 390px. */
	.ao-community .ao-community__members .ao-btn {
		flex: 1 1 100%;
	}
}

/* ================================================================== */
/* Part 2: bbPress forum, topic and reply pages                        */
/* ================================================================== */

/* bbPress sets 12px on the wrapper; OceanWP hides overflow. */
body:not(#ao-boost) #bbpress-forums {
	margin-bottom: var(--space-6);
	overflow: visible;
	font-size: var(--fs-sm);
	line-height: 1.6;
	color: var(--ink-soft);
}

body:not(#ao-boost) #bbpress-forums *,
body:not(#ao-boost) #bbpress-forums *::before,
body:not(#ao-boost) #bbpress-forums *::after {
	box-sizing: border-box;
}

body:not(#ao-boost) #bbpress-forums img.avatar {
	border: 0;
	border-radius: 50%;
}

/* bbPress's own breadcrumb, when shown (OceanWP's sits in the title band). */
body:not(#ao-boost) #bbpress-forums div.bbp-breadcrumb {
	margin-bottom: var(--space-2);
	font-size: var(--fs-xs);
	color: var(--muted);
}

/* ------------------------------------------------------------------ */
/* Search form                                                         */
/* ------------------------------------------------------------------ */

body:not(#ao-boost) #bbpress-forums #bbp-search-form {
	margin-bottom: var(--space-3);
}

body:not(#ao-boost) #bbpress-forums #bbp-search-form > div {
	display: flex;
	gap: var(--space-1);
	max-width: 480px;
}

body:not(#ao-boost) #bbpress-forums #bbp-search-form #bbp_search {
	flex: 1 1 auto;
	min-width: 0;
	height: 44px;
	max-height: none;
	margin: 0;
	padding: 0 var(--space-2);
}

body:not(#ao-boost) #bbpress-forums .bbp-search-form {
	float: none;
}

/* ------------------------------------------------------------------ */
/* Notices ("This forum has 2 topics", "You must be logged in")        */
/* ------------------------------------------------------------------ */

body:not(#ao-boost) #bbpress-forums div.bbp-template-notice {
	margin: 0 0 var(--space-3);
	padding: 14px 18px;
	border: 1px solid var(--line);
	border-radius: var(--radius-sm);
	background-color: var(--paper-2);
	color: var(--ink);
}

body:not(#ao-boost) #bbpress-forums div.bbp-template-notice.info {
	border-color: color-mix(in srgb, var(--indigo) 25%, var(--paper));
	background-color: color-mix(in srgb, var(--indigo) 6%, var(--paper));
}

body:not(#ao-boost) #bbpress-forums div.bbp-template-notice:is(.error, .warning) {
	border-color: var(--pigment);
	background-color: color-mix(in srgb, var(--pigment) 8%, var(--paper));
}

body:not(#ao-boost) #bbpress-forums div.bbp-template-notice :is(ul, li, p) {
	margin: 0 !important; /* bbPress puts !important on the p margin. */
	padding: 0;
	font-size: var(--fs-sm);
	line-height: 1.5;
	list-style: none;
}

body:not(#ao-boost) #bbpress-forums div.bbp-template-notice a {
	color: var(--indigo);
	text-decoration: underline;
}

body:not(#ao-boost) #bbpress-forums .bbp-no-topic,
body:not(#ao-boost) #bbpress-forums .bbp-no-reply {
	margin-top: 0;
}

/* ------------------------------------------------------------------ */
/* Forum and topic lists                                               */
/* ------------------------------------------------------------------ */

body:not(#ao-boost) #bbpress-forums :is(ul.bbp-forums, ul.bbp-topics, ul.bbp-search-results, ul.bbp-replies) {
	margin: 0 0 var(--space-3);
	overflow: hidden;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background-color: var(--paper);
	font-size: var(--fs-sm);
}

/* Header and footer rows. */
body:not(#ao-boost) #bbpress-forums li:is(.bbp-header, .bbp-footer) {
	padding: 12px var(--space-3);
	border: 0;
	background-color: var(--paper-2);
	font-size: var(--fs-xs);
	font-weight: 600;
	color: var(--muted);
}

body:not(#ao-boost) #bbpress-forums li.bbp-header {
	border-bottom: 1px solid var(--line);
}

/* The footer row is an empty spacer in forum and topic lists. */
body:not(#ao-boost) #bbpress-forums :is(ul.bbp-forums, ul.bbp-topics) > li.bbp-footer {
	display: none;
}

/* One grid for the header and each row: title, two counts, last post.
   Replaces bbPress's floats (55% / 10% / 10% / 22%). */
body:not(#ao-boost) #bbpress-forums :is(ul.forum-titles, ul.forum, ul.topic) {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 84px 84px minmax(160px, 24%);
	align-items: center;
	gap: var(--space-2);
}

body:not(#ao-boost) #bbpress-forums :is(ul.forum-titles, ul.forum, ul.topic) > li {
	float: none;
	width: auto;
	margin: 0;
	padding: 0;
}

body:not(#ao-boost) #bbpress-forums :is(ul.forum-titles, ul.forum, ul.topic)::before,
body:not(#ao-boost) #bbpress-forums :is(ul.forum-titles, ul.forum, ul.topic)::after {
	display: none;
}

body:not(#ao-boost) #bbpress-forums li.bbp-body > :is(ul.forum, ul.topic) {
	padding: 18px var(--space-3);
	border-top: 1px solid var(--line);
	background-color: var(--paper);
}

body:not(#ao-boost) #bbpress-forums li.bbp-body > :is(ul.forum, ul.topic):first-child {
	border-top: 0;
}

body:not(#ao-boost) #bbpress-forums li.bbp-body > :is(ul.forum, ul.topic):hover {
	background-color: color-mix(in srgb, var(--paper-2) 60%, var(--paper));
}

/* Stickies: a pigment edge instead of bbPress's yellow. */
body:not(#ao-boost) #bbpress-forums li.bbp-body > ul.topic:is(.sticky, .super-sticky) {
	box-shadow: inset 3px 0 0 var(--pigment);
	background-color: color-mix(in srgb, var(--pigment) 5%, var(--paper)) !important; /* bbPress: transparent !important */
}

body:not(#ao-boost) #bbpress-forums :is(li.bbp-forum-topic-count, li.bbp-forum-reply-count, li.bbp-topic-voice-count, li.bbp-topic-reply-count) {
	text-align: center;
	color: var(--ink);
}

body:not(#ao-boost) #bbpress-forums :is(li.bbp-forum-freshness, li.bbp-topic-freshness) {
	text-align: right;
	font-size: var(--fs-xs);
	color: var(--muted);
}

body:not(#ao-boost) #bbpress-forums :is(li.bbp-forum-freshness, li.bbp-topic-freshness) > a {
	color: var(--ink-soft);
}

/* Titles. */
body:not(#ao-boost) #bbpress-forums li :is(a.bbp-forum-title, a.bbp-topic-permalink) {
	display: inline-block;
	margin: 0 !important; /* bbPress: margin-bottom 0 !important on topics */
	font-size: var(--fs-base);
	font-weight: 600;
	line-height: 1.35;
	color: var(--ink);
	overflow-wrap: anywhere;
}

body:not(#ao-boost) #bbpress-forums li a.bbp-forum-title {
	font-family: var(--font-display);
	font-size: var(--fs-md);
	font-weight: 700;
}

body:not(#ao-boost) #bbpress-forums li :is(a.bbp-forum-title, a.bbp-topic-permalink):is(:hover, :focus-visible) {
	color: var(--indigo);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
}

body:not(#ao-boost) #bbpress-forums .bbp-forum-info .bbp-forum-content {
	margin-top: var(--space-0-5);
	font-size: var(--fs-sm);
	line-height: 1.55;
	color: var(--ink-soft);
}

/* Sub-forum links under a forum. */
body:not(#ao-boost) #bbpress-forums ul.bbp-forums-list {
	margin: var(--space-1) 0 0;
	padding: 0;
	border: 0;
}

body:not(#ao-boost) #bbpress-forums ul.bbp-forums-list li {
	display: inline;
	font-size: var(--fs-xs);
}

/* "Started by", freshness author. */
body:not(#ao-boost) #bbpress-forums p.bbp-topic-meta {
	margin: var(--space-0-5) 0 0;
	font-size: var(--fs-xs);
	line-height: 1.5;
	color: var(--muted);
}

body:not(#ao-boost) #bbpress-forums p.bbp-topic-meta span {
	white-space: normal;
}

body:not(#ao-boost) #bbpress-forums p.bbp-topic-meta img.avatar {
	margin: 0 6px 0 0;
	vertical-align: middle;
}

body:not(#ao-boost) #bbpress-forums p.bbp-topic-meta a {
	color: var(--ink-soft);
}

/* Resolved/sticky glyphs (bbPress icon font) look broken in Inter. */
body:not(#ao-boost) #bbpress-forums ul.topic li.bbp-topic-title::before {
	display: none;
}

/* Page numbers inside a topic row. */
body:not(#ao-boost) #bbpress-forums .bbp-topic-pagination {
	margin-left: var(--space-1);
}

body:not(#ao-boost) #bbpress-forums .bbp-topic-pagination a {
	padding: 1px 6px;
	border: 1px solid var(--line);
	border-radius: 6px;
	font-size: 12px;
	line-height: 1.4;
	color: var(--ink-soft);
}

/* ------------------------------------------------------------------ */
/* Single topic: posts and replies                                     */
/* ------------------------------------------------------------------ */

/* Header row: "Author" / "Posts" + subscribe/favourite links. */
body:not(#ao-boost) #bbpress-forums ul.bbp-replies li.bbp-header {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--space-1) var(--space-2);
}

body:not(#ao-boost) #bbpress-forums ul.bbp-replies li:is(.bbp-header, .bbp-footer) .bbp-reply-author {
	float: none;
	width: 140px;
}

body:not(#ao-boost) #bbpress-forums ul.bbp-replies li:is(.bbp-header, .bbp-footer) .bbp-reply-content {
	flex: 1 1 auto;
	margin: 0;
	padding: 0;
}

body:not(#ao-boost) #bbpress-forums ul.bbp-replies li.bbp-header :is(#subscription-toggle, #favorite-toggle) {
	float: right;
	margin-left: var(--space-2);
}

/* Subscribe / favourite: plain links, not bbPress's green pills. */
body:not(#ao-boost) #bbpress-forums :is(#subscription-toggle, #favorite-toggle) a {
	padding: 0;
	border: 0;
	background: none;
	font-size: var(--fs-xs);
	font-weight: 600;
	color: var(--indigo);
	text-decoration: underline;
	text-underline-offset: 0.2em;
}

/* Date bar above each post. */
body:not(#ao-boost) #bbpress-forums div:is(.bbp-reply-header, .bbp-topic-header, .bbp-forum-header) {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--space-0-5) var(--space-2);
	padding: 10px var(--space-3);
	border-top: 1px solid var(--line);
	background-color: var(--paper-2);
	font-size: var(--fs-xs);
	color: var(--muted);
}

body:not(#ao-boost) #bbpress-forums li.bbp-body > div.bbp-reply-header:first-child {
	border-top: 0;
}

body:not(#ao-boost) #bbpress-forums div.bbp-reply-header .bbp-meta {
	display: contents;
}

body:not(#ao-boost) #bbpress-forums :is(.bbp-reply-header a.bbp-reply-permalink, .bbp-topic-header a.bbp-topic-permalink) {
	order: 2;
	margin-left: auto;
	color: var(--muted);
}

body:not(#ao-boost) #bbpress-forums span.bbp-admin-links {
	order: 3;
	float: none;
	color: var(--line);
}

body:not(#ao-boost) #bbpress-forums span.bbp-admin-links a {
	font-size: 12px;
	font-weight: 500;
	letter-spacing: 0.02em;
	color: var(--muted);
}

body:not(#ao-boost) #bbpress-forums span.bbp-admin-links a:is(:hover, :focus-visible) {
	color: var(--pigment);
}

/* The post itself: author column + content. Covers the lead topic post
   and replies (div.topic / div.reply), odd and even. */
body:not(#ao-boost) #bbpress-forums li.bbp-body > div:is(.reply, .topic) {
	display: grid;
	grid-template-columns: 140px minmax(0, 1fr);
	gap: var(--space-3);
	width: 100%;
	padding: var(--space-3);
	background-color: var(--paper);
}

body:not(#ao-boost) #bbpress-forums li.bbp-body > div:is(.reply, .topic)::before,
body:not(#ao-boost) #bbpress-forums li.bbp-body > div:is(.reply, .topic)::after {
	display: none;
}

/* The opening post stands out a little. */
body:not(#ao-boost) #bbpress-forums li.bbp-body > div.topic {
	background-color: color-mix(in srgb, var(--paper-2) 45%, var(--paper));
}

body:not(#ao-boost) #bbpress-forums li.bbp-body > div:is(.status-spam, .status-trash, .status-pending) {
	background-color: color-mix(in srgb, var(--pigment) 8%, var(--paper));
}

body:not(#ao-boost) #bbpress-forums div:is(.bbp-reply-author, .bbp-topic-author) {
	float: none;
	width: auto;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	text-align: center;
	font-size: var(--fs-xs);
}

body:not(#ao-boost) #bbpress-forums div:is(.bbp-reply-author, .bbp-topic-author) a.bbp-author-link {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--space-1);
	color: var(--ink);
	text-decoration: none;
}

body:not(#ao-boost) #bbpress-forums div:is(.bbp-reply-author, .bbp-topic-author) img.avatar {
	width: 64px;
	height: 64px;
	max-width: none;
	margin: 0;
	float: none;
	background-color: var(--sand);
}

body:not(#ao-boost) #bbpress-forums div:is(.bbp-reply-author, .bbp-topic-author) :is(.bbp-author-name, a.bbp-author-name) {
	margin: 0;
	font-size: var(--fs-sm);
	font-weight: 600;
	color: var(--ink);
	word-break: normal;
	overflow-wrap: anywhere;
}

body:not(#ao-boost) #bbpress-forums div:is(.bbp-reply-author, .bbp-topic-author) .bbp-author-role {
	padding: 2px 10px;
	border-radius: 999px;
	background-color: var(--paper-2);
	font-size: 12px;
	font-style: normal;
	font-weight: 500;
	color: var(--muted);
}

/* Moderator-only IP line. */
body:not(#ao-boost) #bbpress-forums div:is(.bbp-reply-author, .bbp-topic-author) .bbp-reply-ip,
body:not(#ao-boost) #bbpress-forums div:is(.bbp-reply-author, .bbp-topic-author) .bbp-topic-ip {
	font-size: 12px;
	color: var(--muted);
}

body:not(#ao-boost) #bbpress-forums div:is(.bbp-reply-content, .bbp-topic-content) {
	margin: 0;
	padding: 0;
	min-width: 0;
	font-size: var(--fs-base);
	line-height: 1.7;
	color: var(--ink-soft);
	overflow-wrap: anywhere;
}

body:not(#ao-boost) #bbpress-forums div:is(.bbp-reply-content, .bbp-topic-content) > :first-child {
	margin-top: 0;
}

body:not(#ao-boost) #bbpress-forums div:is(.bbp-reply-content, .bbp-topic-content) p {
	margin: 0 0 1em;
}

body:not(#ao-boost) #bbpress-forums div:is(.bbp-reply-content, .bbp-topic-content) a {
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
}

body:not(#ao-boost) #bbpress-forums div:is(.bbp-reply-content, .bbp-topic-content) img {
	max-width: 100%;
	height: auto;
	border-radius: var(--radius-sm);
}

body:not(#ao-boost) #bbpress-forums div:is(.bbp-reply-content, .bbp-topic-content) blockquote {
	margin: 0 0 1em;
	padding: 12px 18px;
	border-left: 3px solid var(--pigment);
	border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
	background-color: var(--paper-2);
	font-style: normal;
}

body:not(#ao-boost) #bbpress-forums :is(.bbp-reply-content, .bbp-topic-content) ul:is(.bbp-reply-revision-log, .bbp-topic-revision-log) {
	margin-top: var(--space-2);
	border-top: 1px dashed var(--line);
	font-size: var(--fs-xs);
	color: var(--muted);
}

/* Threaded replies. */
body:not(#ao-boost) #bbpress-forums ul.bbp-threaded-replies {
	margin-left: var(--space-5);
	border-left: 2px solid var(--line);
}

body:not(#ao-boost) #bbpress-forums div.bbp-reply-to {
	margin-left: 0;
	padding: var(--space-1) var(--space-3);
}

/* ------------------------------------------------------------------ */
/* Pagination                                                          */
/* ------------------------------------------------------------------ */

body:not(#ao-boost) #bbpress-forums .bbp-pagination {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-1) var(--space-2);
	float: none;
	width: 100%;
	margin: 0 0 var(--space-2);
	font-size: var(--fs-xs);
	color: var(--muted);
}

body:not(#ao-boost) #bbpress-forums .bbp-pagination-count {
	float: none;
	border: 0;
}

body:not(#ao-boost) #bbpress-forums .bbp-pagination-links {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	float: none;
}

body:not(#ao-boost) #bbpress-forums .bbp-pagination-links :is(a, span.current, span.dots) {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	float: none;
	min-width: 36px;
	height: 36px;
	margin: 0;
	padding: 0 10px;
	border: 1px solid var(--line);
	border-radius: var(--radius-sm);
	background: none;
	opacity: 1;
	font-size: var(--fs-sm);
	color: var(--ink);
	text-decoration: none;
}

body:not(#ao-boost) #bbpress-forums .bbp-pagination-links span.dots {
	border-color: transparent;
}

body:not(#ao-boost) #bbpress-forums .bbp-pagination-links a:is(:hover, :focus-visible) {
	border-color: var(--ink);
}

body:not(#ao-boost) #bbpress-forums .bbp-pagination-links span.current {
	border-color: var(--pigment);
	background-color: var(--pigment);
	color: var(--paper);
}

/* ------------------------------------------------------------------ */
/* Forms: new topic, reply, login, edit                                */
/* Inputs and buttons already take global.css's styles.                */
/* ------------------------------------------------------------------ */

body:not(#ao-boost) #bbpress-forums fieldset.bbp-form {
	clear: both;
	min-width: 0;
	margin: 0 0 var(--space-3);
	padding: var(--space-3);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background-color: var(--paper);
}

/* Nested fieldsets (subscribe, topic status) have no box of their own. */
body:not(#ao-boost) #bbpress-forums fieldset.bbp-form fieldset.bbp-form {
	margin: 0 0 var(--space-2);
	padding: 0;
	border: 0;
}

body:not(#ao-boost) #bbpress-forums fieldset.bbp-form legend {
	float: left;
	width: 100%;
	margin: 0 0 var(--space-2);
	padding: 0;
	font-family: var(--font-display);
	font-size: var(--fs-md);
	font-weight: 700;
	line-height: 1.25;
	color: var(--ink);
}

body:not(#ao-boost) #bbpress-forums fieldset.bbp-form legend + * {
	clear: left;
}

body:not(#ao-boost) #bbpress-forums fieldset.bbp-form fieldset.bbp-form legend {
	font-family: var(--font-body);
	font-size: var(--fs-sm);
	font-weight: 600;
}

body:not(#ao-boost) #bbpress-forums fieldset.bbp-form label {
	display: inline-block;
	margin: 0 0 6px;
	font-size: var(--fs-sm);
	font-weight: 600;
	color: var(--ink);
}

body:not(#ao-boost) #bbpress-forums fieldset.bbp-form :is(input[type="checkbox"], input[type="radio"]) + label {
	margin: 0 0 0 6px;
	font-weight: 400;
}

body:not(#ao-boost) #bbpress-forums fieldset.bbp-form p {
	margin: 0 0 var(--space-2);
}

body:not(#ao-boost) #bbpress-forums fieldset.bbp-form :is(input[type="text"], input[type="email"], input[type="url"], input[type="password"], select) {
	width: 100%;
	max-width: 560px;
	margin: 0;
}

body:not(#ao-boost) #bbpress-forums :is(textarea#bbp_topic_content, textarea#bbp_reply_content, textarea#bbp_forum_content, textarea.bbp-the-content) {
	width: 100%;
	min-height: 180px;
	margin: 0;
	font-size: var(--fs-base);
	line-height: 1.6;
	resize: vertical;
}

body:not(#ao-boost) #bbpress-forums div.bbp-the-content-wrapper {
	margin-bottom: var(--space-2);
}

/* Quicktags toolbar (b, i, link, ...) above the text box. */
body:not(#ao-boost) #bbpress-forums div.bbp-the-content-wrapper div.quicktags-toolbar {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	padding: 6px;
	border: 1px solid var(--field-border);
	border-bottom: 0;
	border-radius: var(--radius-sm) var(--radius-sm) 0 0;
	background-color: var(--paper-2);
}

body:not(#ao-boost) #bbpress-forums div.bbp-the-content-wrapper div.quicktags-toolbar input.ed_button {
	min-height: 0;
	height: 30px;
	margin: 0;
	padding: 0 10px;
	border: 1px solid var(--line);
	border-radius: 8px;
	background-color: var(--paper);
	font-size: 13px;
	font-weight: 500;
	line-height: 1;
	letter-spacing: normal;
	text-transform: none;
	color: var(--ink);
}

body:not(#ao-boost) #bbpress-forums div.bbp-the-content-wrapper div.quicktags-toolbar input.ed_button:is(:hover, :focus-visible) {
	border-color: var(--ink);
	background-color: var(--paper);
	color: var(--ink);
}

body:not(#ao-boost) #bbpress-forums div.bbp-the-content-wrapper div.quicktags-toolbar + textarea {
	border-top-left-radius: 0;
	border-top-right-radius: 0;
}

body:not(#ao-boost) #bbpress-forums p.form-allowed-tags,
body:not(#ao-boost) #bbpress-forums .bbp-form code {
	width: auto;
	font-size: 12px;
	color: var(--muted);
}

body:not(#ao-boost) #bbpress-forums .bbp-form code {
	padding: var(--space-1);
	border: 1px solid var(--line);
	border-radius: 8px;
	background-color: var(--paper-2);
}

/* Moderators' attribute box (status, type, forum) sits beside the editor. */
body:not(#ao-boost) #bbpress-forums fieldset.bbp-forum-form-attributes {
	float: none;
	width: auto;
	margin-left: 0;
}

body:not(#ao-boost) #bbpress-forums div.bbp-submit-wrapper {
	float: none;
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: var(--space-1);
	margin-top: var(--space-2);
}

body:not(#ao-boost) #bbpress-forums div.bbp-submit-wrapper::before,
body:not(#ao-boost) #bbpress-forums div.bbp-submit-wrapper::after {
	display: none;
}

/* Avatar beside "Your account will be able to post..." in forms. */
body:not(#ao-boost) .bbp-reply-form div.avatar img,
body:not(#ao-boost) .bbp-topic-form div.avatar img {
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: none;
}

/* Login form shown to visitors under a forum. */
body:not(#ao-boost) #bbpress-forums .bbp-login-form {
	max-width: 480px;
}

body:not(#ao-boost) #bbpress-forums .bbp-login-form fieldset.bbp-form legend {
	display: block;
}

body:not(#ao-boost) #bbpress-forums .bbp-login-form :is(.bbp-username, .bbp-password, .bbp-email, .bbp-remember-me) {
	margin: 0 0 var(--space-2);
}

body:not(#ao-boost) #bbpress-forums .bbp-login-form label {
	display: block;
}

body:not(#ao-boost) #bbpress-forums .bbp-login-form .bbp-remember-me label {
	display: inline-block;
}

body:not(#ao-boost) #bbpress-forums .bbp-login-form :is(.bbp-username, .bbp-password, .bbp-email) input {
	max-width: none;
	padding: 0 var(--space-2);
}

body:not(#ao-boost) #bbpress-forums .bbp-login-form .bbp-submit-wrapper {
	justify-content: flex-start;
}

/* ------------------------------------------------------------------ */
/* Profiles, tags, lead topic                                          */
/* ------------------------------------------------------------------ */

body:not(#ao-boost) #bbpress-forums div.bbp-topic-tags {
	margin: 0 0 var(--space-2);
	font-size: var(--fs-xs);
	color: var(--muted);
}

body:not(#ao-boost) #bbpress-forums #bbp-single-user-details #bbp-user-avatar img.avatar {
	border-radius: 50%;
}

body:not(#ao-boost) #bbpress-forums #bbp-single-user-details #bbp-user-navigation a {
	border-radius: var(--radius-sm);
	color: var(--ink);
}

body:not(#ao-boost) #bbpress-forums #bbp-single-user-details #bbp-user-navigation .current a {
	border-color: var(--line);
	background-color: var(--paper-2);
}

body:not(#ao-boost) #bbpress-forums #bbp-your-profile fieldset :is(input, textarea) {
	border: 1px solid var(--field-border);
	border-radius: var(--radius-sm);
	background-color: var(--paper);
}

/* ------------------------------------------------------------------ */
/* Small screens (down to 390px)                                       */
/* ------------------------------------------------------------------ */

@media (max-width: 767px) {
	/* Lists: the title takes the full row; counts and last post wrap
	   underneath as one line. The column header row is dropped, so each
	   count is labelled. */
	body:not(#ao-boost) #bbpress-forums :is(ul.bbp-forums, ul.bbp-topics) > li.bbp-header {
		display: none;
	}

	body:not(#ao-boost) #bbpress-forums :is(ul.forum, ul.topic) {
		display: flex;
		flex-wrap: wrap;
		align-items: baseline;
		gap: var(--space-0-5) var(--space-2);
	}

	body:not(#ao-boost) #bbpress-forums li.bbp-body > :is(ul.forum, ul.topic) {
		padding: var(--space-2);
	}

	body:not(#ao-boost) #bbpress-forums :is(li.bbp-forum-info, li.bbp-topic-title) {
		flex: 1 1 100%;
	}

	body:not(#ao-boost) #bbpress-forums :is(li.bbp-forum-topic-count, li.bbp-forum-reply-count, li.bbp-topic-voice-count, li.bbp-topic-reply-count, li.bbp-forum-freshness, li.bbp-topic-freshness) {
		text-align: left;
		font-size: var(--fs-xs);
		color: var(--muted);
	}

	body:not(#ao-boost) #bbpress-forums li.bbp-forum-topic-count::after { content: " topics"; }
	body:not(#ao-boost) #bbpress-forums li.bbp-forum-reply-count::after { content: " posts"; }
	body:not(#ao-boost) #bbpress-forums li.bbp-topic-voice-count::after { content: " voices"; }
	body:not(#ao-boost) #bbpress-forums li.bbp-topic-reply-count::after { content: " posts"; }

	body:not(#ao-boost) #bbpress-forums :is(li.bbp-forum-freshness, li.bbp-topic-freshness) {
		flex: 1 1 100%;
	}

	body:not(#ao-boost) #bbpress-forums :is(li.bbp-forum-freshness, li.bbp-topic-freshness) p.bbp-topic-meta {
		display: inline;
		margin: 0 0 0 6px;
	}

	/* Posts: author on one line above the text. */
	body:not(#ao-boost) #bbpress-forums ul.bbp-replies li.bbp-header .bbp-reply-author {
		display: none;
	}

	body:not(#ao-boost) #bbpress-forums li.bbp-body > div:is(.reply, .topic) {
		grid-template-columns: minmax(0, 1fr);
		gap: 14px;
		padding: 20px var(--space-2);
	}

	body:not(#ao-boost) #bbpress-forums div:is(.bbp-reply-author, .bbp-topic-author) {
		flex-direction: row;
		flex-wrap: wrap;
		align-items: center;
		gap: 6px 10px;
		text-align: left;
	}

	body:not(#ao-boost) #bbpress-forums div:is(.bbp-reply-author, .bbp-topic-author) a.bbp-author-link {
		flex-direction: row;
		gap: 10px;
	}

	body:not(#ao-boost) #bbpress-forums div:is(.bbp-reply-author, .bbp-topic-author) img.avatar {
		width: 40px;
		height: 40px;
	}

	body:not(#ao-boost) #bbpress-forums div:is(.bbp-reply-header, .bbp-topic-header, .bbp-forum-header),
	body:not(#ao-boost) #bbpress-forums li:is(.bbp-header, .bbp-footer) {
		padding-inline: var(--space-2);
	}

	body:not(#ao-boost) #bbpress-forums ul.bbp-threaded-replies {
		margin-left: var(--space-2);
	}

	body:not(#ao-boost) #bbpress-forums fieldset.bbp-form {
		padding: 20px var(--space-2);
	}

	body:not(#ao-boost) #bbpress-forums div.bbp-submit-wrapper button {
		flex: 1 1 auto;
	}

	body:not(#ao-boost) #bbpress-forums #bbp-single-user-details {
		float: none;
		width: auto;
		margin-bottom: var(--space-3);
	}

	body:not(#ao-boost) #bbpress-forums :is(#bbp-user-body, #bbp-single-user-details #bbp-user-description) {
		margin-left: 0;
	}

	body:not(#ao-boost) #bbpress-forums #bbp-your-profile fieldset :is(input, textarea, select, fieldset.password) {
		width: 100%;
	}

	body:not(#ao-boost) #bbpress-forums #bbp-your-profile fieldset label[for] {
		float: none;
		width: auto;
	}
}
