/**
 * bbPress Topic & Reply Styles
 *
 * Styles for topic listings, single topic view, replies, author info,
 * content elements, threaded replies, and topic headers.
 *
 * @package AgenticWP
 */

/* ==========================================================================
   TOPIC LIST
   Styles for topic listings within forums.
   ========================================================================== */

/* Topic List Container
   Reset list styling and set up layout */
ul.bbp-topics {
	list-style: none;
	padding: 40px 0 80px;
	margin: 0;
}

/* Hide default table header and footer */
.bbp-topics > .bbp-header,
.bbp-topics > .bbp-footer {
	display: none;
}

/* Topic Body Container */
.bbp-topics > .bbp-body {
	list-style: none;
	padding: 0;
	margin: 0;
}

/* Individual Topic Row
   Each topic is a <ul> element with columns as <li> */
.bbp-topics .bbp-body > ul[id^="bbp-topic-"] {
	list-style: none;
	display: flex;
	align-items: flex-start;
	gap: 24px;
	padding: 20px 0;
	margin: 0;
	border-bottom: 1px solid var(--line);
	transition: background-color 0.2s ease;
}

.bbp-topics .bbp-body > ul[id^="bbp-topic-"]:first-child {
	border-top: 1px solid var(--line);
}

.bbp-topics .bbp-body > ul[id^="bbp-topic-"]:hover {
	background-color: rgba(234, 255, 199, 0.3);
}

/* Topic Title Column
   Takes up most of the row width */
.bbp-topics li.bbp-topic-title {
	flex: 1;
	min-width: 0;
}

/* Topic Title Link */
.bbp-topics a.bbp-topic-permalink {
	display: inline-block;
	font-size: 17px;
	font-weight: 500;
	color: var(--ink);
	text-decoration: none;
	transition: color 0.2s ease;
	line-height: 1.4;
}

.bbp-topics a.bbp-topic-permalink:hover {
	color: var(--accent);
	text-decoration: underline;
	text-underline-offset: 2px;
}

/* Topic Meta
   Author and forum info below title */
.bbp-topics li.bbp-topic-title > .bbp-topic-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	font-size: 13px;
	color: var(--muted);
	margin: 4px 0 0;
}

.bbp-topics .bbp-topic-started-by,
.bbp-topics .bbp-topic-started-in {
	display: inline;
}

/* Separator between meta items */
.bbp-topics .bbp-topic-started-by::after {
	content: "·";
	margin-left: 6px;
	opacity: 0.5;
}

/* Hide "Started by:" and "in:" text, show just values */
.bbp-topics .bbp-topic-started-by a,
.bbp-topics .bbp-topic-started-in a {
	color: var(--accent);
	text-decoration: none;
	transition: color 0.2s ease;
}

.bbp-topics .bbp-topic-started-by a:hover,
.bbp-topics .bbp-topic-started-in a:hover {
	color: var(--ink);
}

/* Topic author avatar in meta */
.bbp-topics li.bbp-topic-title .bbp-author-avatar img {
	display: none;
}

/* Voice/Reply Count Columns
   Numeric counts with fixed width */
.bbp-topics li.bbp-topic-voice-count,
.bbp-topics li.bbp-topic-reply-count {
	flex-shrink: 0;
	width: 40px;
	text-align: center;
	font-size: 15px;
	font-weight: 600;
	color: var(--ink);
	align-self: flex-start;
	line-height: 1.4;
}

/* Freshness Column
   Last activity time and author */
.bbp-topics li.bbp-topic-freshness {
	flex-shrink: 0;
	width: 180px;
	text-align: right;
	font-size: 13px;
	color: var(--muted);
	align-self: flex-start;
	line-height: 1.4;
}

.bbp-topics li.bbp-topic-freshness > a:first-child {
	color: var(--muted);
	text-decoration: none;
	transition: color 0.2s ease;
	display: block;
}

.bbp-topics li.bbp-topic-freshness > a:first-child:hover {
	color: var(--accent);
}

/* Freshness Author Meta */
.bbp-topics li.bbp-topic-freshness > .bbp-topic-meta {
	margin-top: 6px;
}

.bbp-topics .bbp-topic-freshness-author {
	display: flex;
	align-items: center;
	justify-content: flex-end;
}

.bbp-topics .bbp-topic-freshness-author .bbp-author-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: var(--muted);
	text-decoration: none;
	font-size: 13px;
	transition: color 0.2s ease;
}

.bbp-topics .bbp-topic-freshness-author .bbp-author-link:hover {
	color: var(--accent);
}

.bbp-topics .bbp-topic-freshness-author .bbp-author-avatar {
	display: inline-flex;
	align-items: center;
}

.bbp-topics .bbp-topic-freshness-author .bbp-author-avatar img {
	border-radius: 50%;
	width: 20px;
	height: 20px;
}

.bbp-topics .bbp-topic-freshness-author .bbp-author-name {
	font-weight: 500;
}

/* Row Actions (favorites, subscriptions)
   Hidden by default, shown on user profile pages */
.bbp-topics .bbp-row-actions {
	display: inline-block;
	margin-right: 8px;
}

.bbp-topics .bbp-row-actions a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: var(--subtle-bg);
	color: var(--muted);
	text-decoration: none;
	font-size: 14px;
	transition: all 0.2s ease;
}

.bbp-topics .bbp-row-actions a:hover {
	background: var(--accent);
	color: var(--bg);
}

/* ==========================================================================
   STICKY TOPICS
   Special styling for pinned/sticky topics.
   ========================================================================== */

/* Sticky Topic Styling */
.bbp-topics .bbp-body > ul.sticky,
.bbp-topics .bbp-body > ul.super-sticky {
	position: relative;
	background-color: rgba(234, 255, 199, 0.2);
	border-left: 3px solid var(--accent);
	padding-left: 16px;
	padding-right: 16px;
	margin-left: -16px;
	margin-right: -16px;
}

/* Pinned Badge via CSS */
.bbp-topics .bbp-body > ul.sticky li.bbp-topic-title::before,
.bbp-topics .bbp-body > ul.super-sticky li.bbp-topic-title::before {
	content: "Pinned";
	display: inline-block;
	padding: 4px 10px;
	background: var(--accent-weak);
	color: var(--accent);
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	border-radius: 20px;
	margin-right: 10px;
	vertical-align: middle;
}

/* Super-sticky (site-wide) gets different badge */
.bbp-topics .bbp-body > ul.super-sticky li.bbp-topic-title::before {
	content: "Announcement";
	background: var(--accent);
	color: var(--bg);
}

/* ==========================================================================
   SINGLE TOPIC & REPLIES
   Styles for topic view page with replies.
   ========================================================================== */

/* Topic Lead (Original Post)
   The first post in a topic, displayed prominently */
.bbp-topic-content,
div.bbp-topic-content {
	background: var(--bg);
	border: 1px solid var(--line);
	border-radius: 16px;
	padding: 32px;
	margin-bottom: 32px;
}

/* Topic Lead Inner Content */
.bbp-topic-content .bbp-reply-content {
	max-width: 720px;
}

/* Reply Entries Container */
div.bbp-replies {
	margin-top: 32px;
}

/* Hide default bbPress reply list styling */
.bbp-replies .bbp-header,
.bbp-replies .bbp-footer {
	display: none;
}

/* Reply List Body */
.bbp-replies .bbp-body {
	list-style: none;
	padding: 0;
	margin: 0;
}

/* Individual Reply Entry
   Each reply is styled as a distinct block */
div.bbp-reply-header + div.bbp-reply-content,
.bbp-replies .bbp-reply-content {
	padding: 24px 24px 24px 16px; /* Reduced left padding */
	border-left: 3px solid var(--line);
	margin-bottom: 16px;
	background: var(--bg);
}

/* Alternate reply backgrounds for readability */
.bbp-replies li.bbp-body-row:nth-child(odd) .bbp-reply-content {
	background: var(--subtle-bg);
}

/* Reply wrapper styling */
div.reply,
.bbp-replies div.reply {
	margin-bottom: 24px;
	padding-bottom: 24px;
	border-bottom: 1px solid var(--line);
}

div.reply:last-child,
.bbp-replies div.reply:last-child {
	border-bottom: none;
	margin-bottom: 0;
	padding-bottom: 0;
}

/* ==========================================================================
   AUTHOR INFO SECTION
   Avatar, name, role badge, and user meta for posts/replies.
   ========================================================================== */

/* Author Box Container */
.bbp-reply-author,
.bbp-topic-author {
	display: flex;
	align-items: flex-start;
	gap: 20px;
	margin-bottom: 20px;
	padding-bottom: 20px;
	border-bottom: 1px solid var(--line);
}

/* Author Avatar */
.bbp-reply-author img.avatar,
.bbp-topic-author img.avatar {
	width: 64px;
	height: 64px;
	border-radius: 50%;
	object-fit: cover;
	flex-shrink: 0;
}

/* Author Info Container */
.bbp-reply-author .bbp-author-info,
.bbp-topic-author .bbp-author-info {
	flex: 1;
	min-width: 0;
}

/* Author Name Link */
.bbp-reply-author a.bbp-author-name,
.bbp-topic-author a.bbp-author-name,
.bbp-reply-author .bbp-author-link,
.bbp-topic-author .bbp-author-link {
	display: block;
	font-size: 18px;
	font-weight: 600;
	color: var(--ink);
	text-decoration: none;
	transition: color 0.2s ease;
	line-height: 1.3;
}

.bbp-reply-author a.bbp-author-name:hover,
.bbp-topic-author a.bbp-author-name:hover,
.bbp-reply-author .bbp-author-link:hover,
.bbp-topic-author .bbp-author-link:hover {
	color: var(--accent);
}

/* User Role Badge */
.bbp-reply-author .bbp-author-role,
.bbp-topic-author .bbp-author-role {
	display: inline-block;
	padding: 6px 14px;
	background: var(--accent-weak);
	color: var(--accent);
	font-size: 13px;
	font-weight: 600;
	border-radius: 20px;
	margin-top: 8px;
	text-transform: capitalize;
}

/* Keymaster/Admin Role - Different styling */
.bbp-reply-author .bbp-author-role[data-role="keymaster"],
.bbp-topic-author .bbp-author-role[data-role="keymaster"],
.bbp-author-role.bbp-user-keymaster {
	background: var(--accent);
	color: var(--bg);
}

/* Moderator Role */
.bbp-author-role.bbp-user-moderator {
	background: #dbeafe;
	color: #1e40af;
}

/* Post Count / Join Date */
.bbp-reply-author .bbp-author-post-count,
.bbp-topic-author .bbp-author-post-count,
.bbp-reply-author .bbp-author-topic-count,
.bbp-topic-author .bbp-author-topic-count {
	display: block;
	font-size: 13px;
	color: var(--muted);
	margin-top: 8px;
	line-height: 1.5;
}

/* ==========================================================================
   REPLY CONTENT
   Styling for the actual content within replies and topics.
   ========================================================================== */

/* Reply Content Container */
.bbp-reply-content,
.bbp-topic-content .bbp-reply-content {
	font-size: 18px;
	line-height: 1.75;
	color: var(--ink);
}

/* Paragraphs */
.bbp-reply-content p {
	margin: 0 0 24px;
}

.bbp-reply-content p:last-child {
	margin-bottom: 0;
}

/* Links */
.bbp-reply-content a {
	color: var(--accent);
	text-decoration: underline;
	text-underline-offset: 2px;
	transition: color 0.2s ease;
}

.bbp-reply-content a:hover {
	color: #0a1a4d;
}

/* Lists */
.bbp-reply-content ul,
.bbp-reply-content ol {
	margin: 0 0 24px;
	padding-left: 28px;
}

.bbp-reply-content li {
	margin-bottom: 8px;
}

.bbp-reply-content li:last-child {
	margin-bottom: 0;
}

.bbp-reply-content li::marker {
	color: var(--accent);
}

/* ==========================================================================
   CONTENT ELEMENTS
   Blockquotes, code blocks, images, and other rich content.
   ========================================================================== */

/* Blockquotes */
.bbp-reply-content blockquote {
	margin: 32px 0;
	padding: 24px 32px;
	border-left: 4px solid var(--accent);
	background: var(--subtle-bg);
	font-size: 19px;
	font-style: italic;
	color: var(--ink);
	border-radius: 0 8px 8px 0;
}

.bbp-reply-content blockquote p:last-child {
	margin-bottom: 0;
}

/* Inline Code */
.bbp-reply-content code {
	font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
	font-size: 0.9em;
	padding: 2px 6px;
	background: var(--subtle-bg);
	border-radius: 4px;
	color: var(--ink);
}

/* Code Blocks */
.bbp-reply-content pre {
	margin: 32px 0;
	padding: 24px;
	background: var(--code-bg);
	border-radius: 12px;
	overflow-x: auto;
}

.bbp-reply-content pre code {
	background: transparent;
	padding: 0;
	color: var(--code-text);
	font-size: 14px;
	line-height: 1.6;
}

/* Images */
.bbp-reply-content img {
	max-width: 100%;
	height: auto;
	border-radius: 12px;
	margin: 32px 0;
}

.bbp-reply-content img:first-child {
	margin-top: 0;
}

.bbp-reply-content img:last-child {
	margin-bottom: 0;
}

/* Tables */
.bbp-reply-content table {
	width: 100%;
	margin: 32px 0;
	border-collapse: collapse;
	font-size: 16px;
}

.bbp-reply-content th,
.bbp-reply-content td {
	padding: 12px 16px;
	text-align: left;
	border-bottom: 1px solid var(--line);
}

.bbp-reply-content th {
	font-weight: 600;
	background: var(--subtle-bg);
}

/* Headings in Content */
.bbp-reply-content h2 {
	font-size: 24px;
	font-weight: 700;
	margin: 32px 0 16px;
	color: var(--ink);
	letter-spacing: -0.01em;
}

.bbp-reply-content h3 {
	font-size: 20px;
	font-weight: 600;
	margin: 28px 0 12px;
	color: var(--ink);
}

.bbp-reply-content h4 {
	font-size: 17px;
	font-weight: 600;
	margin: 24px 0 10px;
	color: var(--ink);
}

/* Horizontal Rules */
.bbp-reply-content hr {
	margin: 32px 0;
	border: none;
	border-top: 1px solid var(--line);
}

/* ==========================================================================
   REPLY META
   Date, edit link, report link, and other action links.
   ========================================================================== */

/* Reply Header (contains timestamp, reply-to link) */
.bbp-reply-header,
div.bbp-reply-header {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
	font-size: 13px;
	color: var(--muted);
	margin-bottom: 16px;
}

/* Reply Timestamp */
.bbp-reply-header .bbp-reply-post-date,
.bbp-meta span {
	color: var(--muted);
}

.bbp-reply-header .bbp-reply-post-date a,
.bbp-reply-header a {
	color: var(--muted);
	text-decoration: none;
	transition: color 0.2s ease;
}

.bbp-reply-header .bbp-reply-post-date a:hover,
.bbp-reply-header a:hover {
	color: var(--accent);
}

/* Reply Actions (Edit, Report, etc.) */
.bbp-reply-header .bbp-admin-links,
.bbp-admin-links {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-left: auto;
}

.bbp-admin-links a {
	display: inline-block;
	padding: 4px 10px;
	font-size: 12px;
	font-weight: 500;
	color: var(--muted);
	background: var(--subtle-bg);
	border-radius: 6px;
	text-decoration: none;
	transition: all 0.2s ease;
}

.bbp-admin-links a:hover {
	color: var(--accent);
	background: rgba(5, 14, 57, 0.08);
}

/* Reply IP Address (admin only) */
.bbp-admin-links .bbp-reply-ip {
	font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
	font-size: 11px;
}

/* Separator between meta items */
.bbp-reply-header .bbp-meta-sep {
	opacity: 0.5;
}

/* ==========================================================================
   THREADED REPLIES
   Indentation and styling for nested/threaded replies.
   ========================================================================== */

/* Threaded Reply Container
   bbPress uses .depth-X classes for nesting */
.bbp-replies .depth-2 {
	margin-left: 32px;
}

.bbp-replies .depth-3 {
	margin-left: 64px;
}

/* Alternative: Using bbp-reply-to responses */
.bbp-threaded-replies,
ul.bbp-threaded-replies {
	list-style: none;
	padding: 0;
	margin: 0;
	margin-left: 32px;
	padding-left: 24px;
	border-left: 2px solid var(--line);
}

/* Nested reply visual connector */
.bbp-threaded-replies::before {
	content: '';
	position: absolute;
	left: 0;
	top: 0;
	bottom: 0;
	width: 2px;
	background: var(--line);
}

/* Threaded reply item */
.bbp-threaded-replies > li {
	position: relative;
}

/* Reply-to indicator */
.bbp-reply-to,
.bbp-meta .bbp-reply-to {
	font-size: 13px;
	color: var(--muted);
}

.bbp-reply-to a {
	color: var(--accent);
	text-decoration: none;
}

.bbp-reply-to a:hover {
	text-decoration: underline;
}

/* Maximum nesting visual indication
   Beyond depth-3, replies don't indent further but show threading */
.bbp-replies .depth-4,
.bbp-replies .depth-5,
.bbp-replies .depth-6 {
	margin-left: 64px;
	border-left-color: var(--accent-weak);
}

/* ==========================================================================
   TOPIC HEADER
   Title, status badges, and meta for single topic view.
   ========================================================================== */

/* Single Topic Title */
.bbp-topic-title h1,
h1.bbp-topic-title,
.bbp-topic-header h1 {
	font-size: clamp(28px, 5vw, 36px);
	font-weight: 700;
	color: var(--ink);
	line-height: 1.2;
	margin: 0 0 16px;
	letter-spacing: -0.02em;
}

/* Topic Status Badges */
.bbp-topic-status,
span.bbp-topic-status {
	display: inline-block;
	padding: 6px 14px;
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	border-radius: 20px;
	margin-left: 12px;
	vertical-align: middle;
}

/* Closed Topic */
.bbp-topic-status-closed,
.bbp-topic-status.closed {
	background: #fef2f2;
	color: #dc2626;
}

/* Sticky Topic */
.bbp-topic-status-sticky {
	background: var(--accent-weak);
	color: var(--accent);
}

/* Super Sticky (Site-wide) */
.bbp-topic-status-super-sticky {
	background: var(--accent);
	color: var(--bg);
}

/* Topic Meta (reply count, voices, etc.) */
.bbp-topic-meta,
.bbp-single-topic-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 16px;
	font-size: 14px;
	color: var(--muted);
	margin-top: 12px;
	padding-top: 16px;
	border-top: 1px solid var(--line);
}

.bbp-topic-meta span {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

/* Topic Subscription/Favorite Links */
.bbp-topic-meta a,
.bbp-single-topic-meta a {
	color: var(--accent);
	text-decoration: none;
	transition: color 0.2s ease;
}

.bbp-topic-meta a:hover,
.bbp-single-topic-meta a:hover {
	color: #0a1a4d;
	text-decoration: underline;
}

/* Favorite/Subscribe Toggle Buttons */
.bbp-topic-meta .bbp-topic-favorite,
.bbp-topic-meta .bbp-topic-subscribe,
.favorite-toggle,
.subscription-toggle {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 12px;
	background: var(--subtle-bg);
	border-radius: 6px;
	font-size: 13px;
	font-weight: 500;
	color: var(--muted);
	text-decoration: none;
	transition: all 0.2s ease;
}

.bbp-topic-meta .bbp-topic-favorite:hover,
.bbp-topic-meta .bbp-topic-subscribe:hover,
.favorite-toggle:hover,
.subscription-toggle:hover {
	background: var(--accent);
	color: var(--bg);
}

/* Active/Favorited State */
.bbp-topic-meta .is-favorite,
.favorite-toggle.is-favorite {
	background: var(--accent);
	color: var(--bg);
}

/* ==========================================================================
   REPLY TO FORM AREA
   Quick reply form shown below replies.
   ========================================================================== */

/* Reply form container when displayed inline */
#new-reply-0,
.bbp-reply-form {
	margin-top: 40px;
	padding-top: 40px;
	border-top: 1px solid var(--line);
}

/* Reply form title */
.bbp-reply-form h2,
#new-reply-0 h2 {
	font-size: 22px;
	font-weight: 600;
	color: var(--ink);
	margin: 0 0 24px;
}

/* ==========================================================================
   TOPIC & REPLY RESPONSIVE
   ========================================================================== */

@media (max-width: 900px) {
	/* Topic list adjustments */
	.bbp-topics .bbp-body > ul[id^="bbp-topic-"] {
		gap: 12px;
	}

	/* Reduce freshness column width */
	.bbp-topics li.bbp-topic-freshness {
		width: 120px;
	}

	/* Single topic/reply adjustments */
	.bbp-topic-content,
	div.bbp-topic-content {
		padding: 24px;
	}

	div.bbp-reply-header + div.bbp-reply-content,
	.bbp-replies .bbp-reply-content {
		padding: 20px 20px 20px 14px;
	}

	/* Author box adjustments */
	.bbp-reply-author,
	.bbp-topic-author {
		gap: 16px;
	}

	.bbp-reply-author img.avatar,
	.bbp-topic-author img.avatar {
		width: 56px;
		height: 56px;
	}
}

@media (max-width: 640px) {
	/* Topic list - single column layout */
	.bbp-topics .bbp-body > ul[id^="bbp-topic-"] {
		flex-wrap: wrap;
		gap: 8px;
		padding: 14px 0;
	}

	/* Topic title takes full width on mobile */
	.bbp-topics li.bbp-topic-title {
		flex: 0 0 100%;
		order: 1;
	}

	.bbp-topics a.bbp-topic-permalink {
		font-size: 16px;
	}

	/* Topic meta */
	.bbp-topics li.bbp-topic-title > .bbp-topic-meta {
		font-size: 12px;
		margin-top: 6px;
	}

	/* Hide voice/reply count columns on mobile */
	.bbp-topics li.bbp-topic-voice-count,
	.bbp-topics li.bbp-topic-reply-count {
		display: none;
	}

	/* Freshness column - simplified on mobile */
	.bbp-topics li.bbp-topic-freshness {
		flex: 0 0 100%;
		width: 100%;
		text-align: left;
		order: 2;
		font-size: 12px;
		padding-top: 8px;
		border-top: 1px solid var(--line);
		margin-top: 4px;
	}

	/* Hide freshness author details on mobile, keep time only */
	.bbp-topics li.bbp-topic-freshness > .bbp-topic-meta {
		display: none;
	}

	.bbp-topics .bbp-topic-freshness-author {
		justify-content: flex-start;
	}

	/* Sticky topics mobile adjustment */
	.bbp-topics .bbp-body > ul.sticky,
	.bbp-topics .bbp-body > ul.super-sticky {
		margin-left: 0;
		margin-right: 0;
		padding-left: 12px;
		padding-right: 0;
	}

	/* Pinned badge smaller */
	.bbp-topics .bbp-body > ul.sticky li.bbp-topic-title::before,
	.bbp-topics .bbp-body > ul.super-sticky li.bbp-topic-title::before {
		font-size: 10px;
		padding: 3px 8px;
		margin-right: 8px;
	}

	/* Single Topic Title */
	.bbp-topic-title h1,
	h1.bbp-topic-title,
	.bbp-topic-header h1 {
		font-size: clamp(24px, 6vw, 28px);
	}

	/* Topic status badge */
	.bbp-topic-status,
	span.bbp-topic-status {
		padding: 5px 10px;
		font-size: 11px;
		margin-left: 8px;
	}

	/* Topic meta */
	.bbp-topic-meta,
	.bbp-single-topic-meta {
		gap: 10px;
		font-size: 13px;
	}

	/* Single topic/reply content */
	.bbp-topic-content,
	div.bbp-topic-content {
		padding: 20px;
		border-radius: 12px;
	}

	/* Author section - stack vertically on mobile */
	.bbp-reply-author,
	.bbp-topic-author {
		flex-direction: column;
		align-items: flex-start;
		gap: 12px;
		padding-bottom: 16px;
		margin-bottom: 16px;
	}

	/* Reduce avatar size */
	.bbp-reply-author img.avatar,
	.bbp-topic-author img.avatar {
		width: 40px;
		height: 40px;
	}

	/* Author name */
	.bbp-reply-author a.bbp-author-name,
	.bbp-topic-author a.bbp-author-name,
	.bbp-reply-author .bbp-author-link,
	.bbp-topic-author .bbp-author-link {
		font-size: 16px;
	}

	/* User role badge */
	.bbp-reply-author .bbp-author-role,
	.bbp-topic-author .bbp-author-role {
		padding: 4px 10px;
		font-size: 11px;
	}

	/* Post/topic count */
	.bbp-reply-author .bbp-author-post-count,
	.bbp-topic-author .bbp-author-post-count {
		font-size: 12px;
	}

	/* Reply content */
	.bbp-reply-content,
	.bbp-topic-content .bbp-reply-content {
		font-size: 17px;
	}

	div.bbp-reply-header + div.bbp-reply-content,
	.bbp-replies .bbp-reply-content {
		padding: 20px 20px 20px 12px;
	}

	/* Reply paragraphs */
	.bbp-reply-content p {
		margin: 0 0 20px;
	}

	/* Reply lists */
	.bbp-reply-content ul,
	.bbp-reply-content ol {
		padding-left: 20px;
		margin: 0 0 20px;
	}

	/* Blockquotes */
	.bbp-reply-content blockquote {
		margin: 24px 0;
		padding: 16px 20px;
		font-size: 17px;
	}

	/* Code blocks */
	.bbp-reply-content pre {
		margin: 24px 0;
		padding: 16px;
		border-radius: 8px;
	}

	.bbp-reply-content pre code {
		font-size: 13px;
	}

	/* Images */
	.bbp-reply-content img {
		margin: 24px 0;
		border-radius: 8px;
	}

	/* Tables */
	.bbp-reply-content table {
		margin: 24px 0;
		font-size: 14px;
	}

	.bbp-reply-content th,
	.bbp-reply-content td {
		padding: 10px 12px;
	}

	/* Headings in content */
	.bbp-reply-content h2 {
		font-size: 20px;
		margin: 24px 0 12px;
	}

	.bbp-reply-content h3 {
		font-size: 18px;
		margin: 20px 0 10px;
	}

	.bbp-reply-content h4 {
		font-size: 16px;
		margin: 18px 0 8px;
	}

	/* Reply header */
	.bbp-reply-header,
	div.bbp-reply-header {
		flex-direction: column;
		align-items: flex-start;
		gap: 8px;
	}

	.bbp-admin-links {
		margin-left: 0;
	}

	/* Reply wrapper */
	div.reply,
	.bbp-replies div.reply {
		margin-bottom: 20px;
		padding-bottom: 20px;
	}

	/* Threaded replies mobile */
	.bbp-replies .depth-2 {
		margin-left: 16px;
	}

	.bbp-replies .depth-3 {
		margin-left: 32px;
	}

	/* Cap nesting at 2 visual levels on mobile */
	.bbp-replies .depth-4,
	.bbp-replies .depth-5,
	.bbp-replies .depth-6 {
		margin-left: 32px;
	}

	/* Threaded replies container */
	.bbp-threaded-replies,
	ul.bbp-threaded-replies {
		margin-left: 16px;
		padding-left: 16px;
	}
}

/* ==========================================================================
   TOPIC & REPLY ACCESSIBILITY
   ========================================================================== */

/* Topic links */
.bbp-topics a.bbp-topic-permalink:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}

/* Author links */
.bbp-reply-author a.bbp-author-name:focus-visible,
.bbp-topic-author a.bbp-author-name:focus-visible,
.bbp-reply-author .bbp-author-link:focus-visible,
.bbp-topic-author .bbp-author-link:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}

/* Admin action links */
.bbp-admin-links a:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}

/* Content links */
.bbp-reply-content a:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}

/* Favorite/subscribe toggles */
.bbp-topic-meta .bbp-topic-favorite:focus-visible,
.bbp-topic-meta .bbp-topic-subscribe:focus-visible,
.favorite-toggle:focus-visible,
.subscription-toggle:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}

/* Row action buttons */
.bbp-topics .bbp-row-actions a:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
	/* Topic rows */
	.bbp-topics .bbp-body > ul[id^="bbp-topic-"] {
		transition: none;
	}

	/* Topic links */
	.bbp-topics a.bbp-topic-permalink {
		transition: none;
	}

	/* Author links */
	.bbp-reply-author a.bbp-author-name,
	.bbp-topic-author a.bbp-author-name,
	.bbp-reply-author .bbp-author-link,
	.bbp-topic-author .bbp-author-link {
		transition: none;
	}

	/* Admin links */
	.bbp-admin-links a {
		transition: none;
	}

	/* Reply header links */
	.bbp-reply-header a {
		transition: none;
	}

	/* Favorite/subscribe toggles */
	.bbp-topic-meta .bbp-topic-favorite,
	.bbp-topic-meta .bbp-topic-subscribe,
	.favorite-toggle,
	.subscription-toggle {
		transition: none;
	}

	/* Row actions */
	.bbp-topics .bbp-row-actions a {
		transition: none;
	}
}

/* ==========================================================================
   ADMIN & MODERATION CONTROLS
   Enhanced styling for admin-only elements and moderation actions.
   Phase 6 implementation.
   ========================================================================== */

/* IP Address Display (admin only)
   Style the raw IP address shown next to user role */
#bbpress-forums .bbp-reply-ip,
#bbpress-forums .bbp-author-ip {
	display: inline-block;
	padding: 2px 8px;
	font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
	font-size: 11px;
	color: var(--muted);
	background: var(--subtle-bg);
	border-radius: 4px;
	margin-left: 8px;
	opacity: 0.7;
}

#bbpress-forums .bbp-reply-ip:hover,
#bbpress-forums .bbp-author-ip:hover {
	opacity: 1;
}

/* Admin Notice Container
   Styled notice for "unrestricted HTML content" message */
#bbpress-forums .bbp-template-notice ul:has(li:only-child) {
	list-style: none;
	margin: 0;
	padding: 0;
}

#bbpress-forums .bbp-form .bbp-template-notice,
#bbpress-forums fieldset .bbp-template-notice {
	background: #eff6ff;
	border: 1px solid #bfdbfe;
	border-radius: 8px;
	padding: 12px 16px;
	margin-bottom: 20px;
	font-size: 13px;
	color: #1e40af;
}

/* Subscribe/Favorite Action Links
   Convert plain text links to styled pill buttons.
   Use font-size: 0 trick to hide pipe (|) text separators output by bbPress. */
#bbpress-forums .bbp-topic-action,
#bbpress-forums .topic-info .bbp-topic-action {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin-bottom: 16px;
}

/* Hide pipe separators in subscription/favorite toggle containers.
   bbPress outputs: <span id="subscription-toggle">&nbsp;|&nbsp;<span>...</span></span> */
#bbpress-forums #subscription-toggle,
#bbpress-forums #favorite-toggle {
	font-size: 0; /* Hide pipe text nodes */
}

/* Forum subscription toggle spacing
   Add space below subscribe button before info bar on single forum pages */
#bbpress-forums > #subscription-toggle {
	display: block;
	margin-bottom: 16px;
}

/* Style Subscribe/Favorite as pills */
#bbpress-forums a.subscription-toggle,
#bbpress-forums a.favorite-toggle {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 14px;
	background: var(--subtle-bg);
	color: var(--muted);
	border: 1px solid var(--line);
	border-radius: 20px;
	font-size: 13px;
	font-weight: 500;
	text-decoration: none;
	transition: all 0.2s ease;
}

#bbpress-forums a.subscription-toggle:hover,
#bbpress-forums a.favorite-toggle:hover {
	background: var(--accent);
	border-color: var(--accent);
	color: var(--bg);
}

/* Active states for Subscribe/Favorite */
#bbpress-forums a.subscription-toggle.is-subscribed,
#bbpress-forums a.favorite-toggle.is-favorite {
	background: var(--accent);
	border-color: var(--accent);
	color: var(--bg);
}

#bbpress-forums a.subscription-toggle.is-subscribed:hover,
#bbpress-forums a.favorite-toggle.is-favorite:hover {
	background: var(--error-text);
	border-color: var(--error-text);
}

/* Moderation Links Container
   Convert pipe-separated links to a styled group */
#bbpress-forums .bbp-admin-links {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	margin-left: auto;
}

/* Hide pipe separators */
#bbpress-forums .bbp-admin-links > br {
	display: none;
}

/* Style moderation links as compact buttons */
#bbpress-forums .bbp-admin-links a {
	display: inline-flex;
	align-items: center;
	padding: 4px 10px;
	font-size: 12px;
	font-weight: 500;
	color: var(--muted);
	background: var(--subtle-bg);
	border: 1px solid transparent;
	border-radius: 6px;
	text-decoration: none;
	transition: all 0.15s ease;
	white-space: nowrap;
}

#bbpress-forums .bbp-admin-links a:hover {
	color: var(--ink);
	background: var(--bg);
	border-color: var(--line);
}

/* Destructive action buttons - special styling */
#bbpress-forums .bbp-admin-links a[href*="trash"],
#bbpress-forums .bbp-admin-links a[href*="spam"] {
	color: var(--error-text);
}

#bbpress-forums .bbp-admin-links a[href*="trash"]:hover,
#bbpress-forums .bbp-admin-links a[href*="spam"]:hover {
	background: var(--error-bg);
	border-color: var(--error-border);
	color: var(--error-text);
}

/* Reply button styling */
#bbpress-forums .bbp-admin-links button,
#bbpress-forums .bbp-admin-links .bbp-reply-to-link {
	display: inline-flex;
	align-items: center;
	padding: 4px 12px;
	font-size: 12px;
	font-weight: 600;
	color: var(--accent);
	background: transparent;
	border: 1px solid var(--accent);
	border-radius: 6px;
	cursor: pointer;
	transition: all 0.15s ease;
}

#bbpress-forums .bbp-admin-links button:hover,
#bbpress-forums .bbp-admin-links .bbp-reply-to-link:hover {
	background: var(--accent);
	color: var(--bg);
}

/* Topic Header Actions Area
   Container for Subscribe, Favorite, and Status buttons */
#bbpress-forums .topic-header-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
	margin-bottom: 20px;
	padding-bottom: 16px;
	border-bottom: 1px solid var(--line);
}

/* ==========================================================================
   EMPTY STATES
   Friendly messages for when there's no content.
   Phase 6 implementation.
   ========================================================================== */

/* No Topics Found */
#bbpress-forums .bbp-template-notice.important,
#bbpress-forums .bbp-template-notice:has(li:only-child:contains("No topics found")),
.bbp-no-topic {
	text-align: center;
	padding: 40px 24px;
	background: var(--subtle-bg);
	border-radius: 16px;
	border: 1px dashed var(--line);
}

/* No Replies Notice */
.bbp-no-reply,
#bbpress-forums .bbp-template-notice:has(li:only-child:contains("No replies found")) {
	text-align: center;
	padding: 32px 24px;
	background: var(--subtle-bg);
	border-radius: 12px;
}

/* Topic Closed Notice */
#bbpress-forums .bbp-template-notice.warning {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 16px 20px;
	background: #fffbeb;
	border: 1px solid #fcd34d;
	border-radius: 12px;
}

#bbpress-forums .bbp-template-notice.warning::before {
	content: "⚠️";
	font-size: 18px;
}

/* Empty Profile States */
#bbpress-forums .bbp-user-section-empty {
	text-align: center;
	padding: 40px 24px;
	color: var(--muted);
	background: var(--subtle-bg);
	border-radius: 12px;
}

#bbpress-forums .bbp-user-section-empty p {
	margin: 0;
	font-size: 15px;
}

/* ==========================================================================
   ADMIN CONTROLS RESPONSIVE
   Mobile adjustments for moderation controls.
   ========================================================================== */

@media (max-width: 640px) {
	/* Stack header actions vertically */
	#bbpress-forums .topic-header-actions {
		flex-direction: column;
		align-items: flex-start;
		gap: 10px;
	}

	/* Moderation links wrap nicely */
	#bbpress-forums .bbp-admin-links {
		gap: 4px;
		margin-left: 0;
		margin-top: 8px;
	}

	#bbpress-forums .bbp-admin-links a {
		padding: 3px 8px;
		font-size: 11px;
	}

	/* Subscribe/Favorite pills */
	#bbpress-forums a.subscription-toggle,
	#bbpress-forums a.favorite-toggle {
		padding: 5px 12px;
		font-size: 12px;
	}

	/* IP address hide on mobile */
	#bbpress-forums .bbp-reply-ip,
	#bbpress-forums .bbp-author-ip {
		display: none;
	}
}
