/**
 * ReadyLaunch Blog — Single Post Styles.
 *
 * Two-column layout (content + sticky comment sidebar) when comments are
 * enabled; single-column centered fallback otherwise. All component
 * styles for the redesigned single blog post page.
 *
 * @package BuddyBoss\MemberBlogs
 * @since 1.1.0
 */

/* ============================================================
   BACK NAVIGATION BAR
   ============================================================ */
.bb-rl-single-nav {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 0;
	margin-bottom: 8px;
	border-bottom: 1px solid var(--bb-content-border-color, #e2e8f0);
	font-size: 14px;
	color: var(--bb-alternate-text-color, #718096);
}

.bb-rl-single-nav__back {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: var(--bb-body-text-color, #4a5568);
	text-decoration: none;
	font-weight: 500;
	white-space: nowrap;
	transition: color 0.15s;
}

.bb-rl-single-nav__back:hover {
	color: var(--bb-primary-color, #007CFF);
}

.bb-rl-single-nav__back svg {
	flex-shrink: 0;
}

.bb-rl-single-nav__sep {
	width: 1px;
	height: 16px;
	background: var(--bb-content-border-color, #e2e8f0);
	flex-shrink: 0;
}

.bb-rl-single-nav__title {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	color: var(--bb-alternate-text-color, #718096);
}

/* ============================================================
   TWO-COLUMN LAYOUT
   ============================================================ */
.bb-rl-single-layout {
	display: grid;
	gap: 40px;
	padding-top: 24px;
	padding-bottom: 40px;
}

.bb-rl-single-layout--two-col {
	grid-template-columns: 1fr 380px;
}

.bb-rl-single-layout--single-col {
	grid-template-columns: 1fr;
}

.bb-rl-single-layout--single-col .bb-rl-single-content {
	max-width: 780px;
	margin: 0 auto;
	width: 100%;
}

/* ============================================================
   CONTENT COLUMN
   ============================================================ */

/* Featured Image */
.bb-rl-single-featured-image {
	margin: 0 0 28px;
	border-radius: 12px;
	overflow: hidden;
}

.bb-rl-single-featured-image img {
	width: 100%;
	height: auto;
	display: block;
}

/* Post Header */
.bb-rl-single-header {
	margin-bottom: 28px;
}

.bb-rl-single-title {
	font-size: 32px;
	font-weight: 700;
	line-height: 1.2;
	margin: 0 0 16px;
	color: var(--bb-heading-text-color, #1a202c);
}

/* Author Row */
.bb-rl-single-author-row {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 12px;
	flex-wrap: wrap;
}

.bb-rl-single-author-row__left {
	display: flex;
	align-items: center;
	gap: 10px;
}

.bb-rl-single-author-avatar img {
	border-radius: 50%;
	display: block;
}

.bb-rl-single-author-name a {
	color: var(--bb-heading-text-color, #1a202c);
	font-weight: 600;
	font-size: 14px;
	text-decoration: none;
}

.bb-rl-single-author-name a:hover {
	color: var(--bb-primary-color, #007CFF);
}

/* Follow Button */
.bb-rl-single-follow-btn {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 4px 12px;
	border: 1px solid var(--bb-primary-color, #007CFF);
	border-radius: 6px;
	background: transparent;
	color: var(--bb-primary-color, #007CFF);
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.15s;
	white-space: nowrap;
}

.bb-rl-single-follow-btn:hover {
	background: var(--bb-primary-color, #007CFF);
	color: #fff;
}

.bb-rl-single-follow-btn.is-following {
	background: var(--bb-primary-color, #007CFF);
	color: #fff;
}

.bb-rl-single-follow-btn.is-following:hover {
	opacity: 0.85;
}

.bb-rl-single-author-date {
	font-size: 14px;
	color: var(--bb-alternate-text-color, #718096);
}

/* Categories Row */
.bb-rl-single-categories-row,
.bb-rl-single-tags-row {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 8px;
	font-size: 14px;
	flex-wrap: wrap;
}

.bb-rl-single-categories-row__icon,
.bb-rl-single-tags-row__icon {
	flex-shrink: 0;
	color: var(--bb-alternate-text-color, #718096);
	display: flex;
	align-items: center;
}

.bb-rl-single-categories-row__list {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
}

.bb-rl-single-categories-row__list a {
	color: var(--bb-primary-color, #007CFF);
	text-decoration: none;
}

.bb-rl-single-categories-row__list a:hover {
	text-decoration: underline;
}

.bb-rl-single-categories-row__list .bb-rl-single-cat-sep {
	color: var(--bb-alternate-text-color, #718096);
}

/* Tag pills */
.bb-rl-single-tags-row__list {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.bb-rl-single-tag-pill {
	display: inline-block;
	padding: 2px 10px;
	background: var(--bb-content-background-color, #f7fafc);
	color: var(--bb-body-text-color, #4a5568);
	border: 1px solid var(--bb-content-border-color, #e2e8f0);
	border-radius: 20px;
	font-size: 13px;
	text-decoration: none;
	transition: background 0.2s;
}

.bb-rl-single-tag-pill:hover {
	background: var(--bb-content-border-color, #e2e8f0);
	color: var(--bb-body-text-color, #4a5568);
}

/* Actions Row (Subscribe + Bookmark) */
.bb-rl-single-actions-row {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 8px;
	margin-top: 4px;
}

.bb-rl-single-action-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border: 1px solid var(--bb-content-border-color, #e2e8f0);
	border-radius: 8px;
	background: transparent;
	color: var(--bb-alternate-text-color, #718096);
	cursor: pointer;
	transition: all 0.15s;
}

.bb-rl-single-action-btn:hover {
	color: var(--bb-heading-text-color, #1a202c);
	border-color: var(--bb-alternate-text-color, #a0aec0);
}

.bb-rl-single-action-btn.is-active {
	color: var(--bb-primary-color, #007CFF);
	border-color: var(--bb-primary-color, #007CFF);
}

.bb-rl-single-action-btn.is-loading {
	opacity: 0.5;
	pointer-events: none;
}

.bb-rl-single-action-btn svg {
	flex-shrink: 0;
}

/* ============================================================
   POST CONTENT
   ============================================================ */
.bb-rl-single-content .bb-rl-blog-content {
	font-size: 17px;
	line-height: 1.75;
	color: var(--bb-body-text-color, #2d3748);
	margin-bottom: 32px;
}

.bb-rl-single-content .bb-rl-blog-content img {
	max-width: 100%;
	height: auto;
	border-radius: 8px;
}

.bb-rl-single-content .bb-rl-blog-content h2,
.bb-rl-single-content .bb-rl-blog-content h3,
.bb-rl-single-content .bb-rl-blog-content h4 {
	color: var(--bb-heading-text-color, #1a202c);
	margin-top: 32px;
}

.bb-rl-single-content .bb-rl-blog-content p {
	margin-bottom: 16px;
}

.bb-rl-single-content .bb-rl-blog-content blockquote {
	border-left: 4px solid var(--bb-primary-color, #007CFF);
	padding-left: 20px;
	margin: 24px 0;
	color: var(--bb-alternate-text-color, #718096);
	font-style: italic;
}

/* ============================================================
   SHARE LINKS (redesigned)
   ============================================================ */
.bb-rl-single-share {
	margin-bottom: 28px;
	padding: 20px 0;
	border-top: 1px solid var(--bb-content-border-color, #e2e8f0);
}

.bb-rl-single-share__title {
	font-size: 15px;
	font-weight: 600;
	margin: 0 0 10px;
	color: var(--bb-heading-text-color, #1a202c);
}

.bb-rl-single-share__buttons {
	display: flex;
	gap: 8px;
}

.bb-rl-single-share__btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	border-radius: 8px;
	background: var(--bb-content-background-color, #f7fafc);
	color: var(--bb-body-text-color, #4a5568);
	transition: all 0.2s;
	text-decoration: none;
}

.bb-rl-single-share__btn:hover {
	background: var(--bb-primary-color, #007CFF);
	color: #fff;
}

.bb-rl-single-share__btn svg {
	flex-shrink: 0;
}

/* ============================================================
   AUTHOR BIO (redesigned)
   ============================================================ */
.bb-rl-single-author-bio {
	display: flex;
	gap: 20px;
	padding: 24px;
	background: var(--bb-content-background-color, #f7fafc);
	border-radius: 12px;
	margin-bottom: 32px;
}

.bb-rl-single-author-bio__avatar img {
	border-radius: 50%;
	width: 96px;
	height: 96px;
	display: block;
}

.bb-rl-single-author-bio__info {
	flex: 1;
	min-width: 0;
}

.bb-rl-single-author-bio__name-row {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 4px;
	flex-wrap: wrap;
}

.bb-rl-single-author-bio__name {
	font-size: 18px;
	font-weight: 600;
	margin: 0;
}

.bb-rl-single-author-bio__name a {
	color: var(--bb-heading-text-color, #1a202c);
	text-decoration: none;
}

.bb-rl-single-author-bio__name a:hover {
	color: var(--bb-primary-color, #007CFF);
}

.bb-rl-single-author-bio__badge {
	display: inline-block;
	padding: 2px 8px;
	background: var(--bb-primary-color, #007CFF);
	color: #fff;
	border-radius: 4px;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.bb-rl-single-author-bio__role {
	font-size: 13px;
	color: var(--bb-alternate-text-color, #718096);
	margin-bottom: 8px;
}

.bb-rl-single-author-bio__description {
	font-size: 14px;
	color: var(--bb-body-text-color, #4a5568);
	margin: 0 0 12px;
	line-height: 1.5;
}

.bb-rl-single-author-bio__footer {
	display: flex;
	align-items: center;
	gap: 16px;
}

.bb-rl-single-author-bio__post-count {
	font-size: 13px;
	color: var(--bb-alternate-text-color, #718096);
}

.bb-rl-single-author-bio__profile-btn {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 6px 16px;
	background: var(--bb-primary-color, #007CFF);
	color: #fff;
	border-radius: 6px;
	font-size: 13px;
	font-weight: 500;
	text-decoration: none;
	transition: opacity 0.15s;
}

.bb-rl-single-author-bio__profile-btn:hover {
	opacity: 0.9;
	color: #fff;
}

/* ============================================================
   RELATED BLOGS (with carousel)
   ============================================================ */
.bb-rl-single-related {
	margin-bottom: 40px;
}

.bb-rl-single-related__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 20px;
}

.bb-rl-single-related__title {
	font-size: 20px;
	font-weight: 600;
	margin: 0;
	color: var(--bb-heading-text-color, #1a202c);
}

.bb-rl-single-related__nav {
	display: flex;
	gap: 6px;
}

.bb-rl-single-related__nav-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border: 1px solid var(--bb-content-border-color, #e2e8f0);
	border-radius: 6px;
	background: transparent;
	color: var(--bb-body-text-color, #4a5568);
	cursor: pointer;
	transition: all 0.15s;
}

.bb-rl-single-related__nav-btn:hover {
	border-color: var(--bb-alternate-text-color, #a0aec0);
	color: var(--bb-heading-text-color, #1a202c);
}

.bb-rl-single-related__nav-btn:disabled {
	opacity: 0.4;
	cursor: default;
}

.bb-rl-single-related__nav-btn svg {
	flex-shrink: 0;
}

.bb-rl-single-related__track {
	display: flex;
	gap: 20px;
	overflow-x: hidden;
	scroll-behavior: smooth;
}

.bb-rl-single-related__track .bb-rl-blog-post-card {
	flex: 0 0 calc((100% - 40px) / 3);
	min-width: 0;
}

/* ============================================================
   COMMENT SIDEBAR (sticky)
   ============================================================ */
.bb-rl-single-sidebar {
	position: sticky;
	top: calc(var(--bb-admin-bar-height, 32px) + 80px);
	max-height: calc(100vh - var(--bb-admin-bar-height, 32px) - 100px);
	overflow-y: auto;
	scrollbar-width: thin;
	scrollbar-color: var(--bb-content-border-color, #e2e8f0) transparent;
}

.bb-rl-single-sidebar::-webkit-scrollbar {
	width: 4px;
}

.bb-rl-single-sidebar::-webkit-scrollbar-thumb {
	background: var(--bb-content-border-color, #e2e8f0);
	border-radius: 4px;
}

/* Sidebar Inner */
.bb-rl-comment-sidebar {
	background: var(--bb-content-background-color, #fff);
	border: 1px solid var(--bb-content-border-color, #e2e8f0);
	border-radius: 12px;
	overflow: hidden;
}

.bb-rl-comment-sidebar__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 20px;
	border-bottom: 1px solid var(--bb-content-border-color, #e2e8f0);
}

.bb-rl-comment-sidebar__title {
	font-size: 16px;
	font-weight: 600;
	margin: 0;
	color: var(--bb-heading-text-color, #1a202c);
}

.bb-rl-comment-sidebar__count {
	font-weight: 400;
	color: var(--bb-alternate-text-color, #718096);
}

/* Reactions Bar */
.bb-rl-comment-sidebar__reactions {
	padding: 12px 20px;
	border-bottom: 1px solid var(--bb-content-border-color, #e2e8f0);
}

/* Comment List */
.bb-rl-comment-sidebar__body {
	padding: 16px 20px;
	min-height: 100px;
}

/* Activity wrapper within sidebar */
.bb-rl-comment-sidebar__body .activity-item {
	list-style: none;
}

.bb-rl-comment-sidebar__body .activity-comments {
	margin: 0;
	padding: 0;
	list-style: none;
}

.bb-rl-comment-sidebar__body .activity-comments li {
	margin-bottom: 16px;
	padding-bottom: 16px;
	border-bottom: 1px solid var(--bb-content-border-color, #e2e8f0);
}

.bb-rl-comment-sidebar__body .activity-comments li:last-child {
	margin-bottom: 0;
	padding-bottom: 0;
	border-bottom: none;
}

/* Thread nesting */
.bb-rl-comment-sidebar__body .activity-comments .activity-comments {
	padding-left: 24px;
	margin-top: 12px;
}

/* Sidebar avatar sizes */
.bb-rl-comment-sidebar__body .bb-rl-acomment-avatar img,
.bb-rl-comment-sidebar__body .acomment-avatar img {
	width: 32px;
	height: 32px;
}

/* Empty State */
.bb-rl-comment-sidebar__empty {
	text-align: center;
	padding: 40px 20px;
	color: var(--bb-alternate-text-color, #718096);
}

.bb-rl-comment-sidebar__empty-icon {
	margin-bottom: 12px;
	color: var(--bb-content-border-color, #cbd5e0);
}

.bb-rl-comment-sidebar__empty-text {
	font-size: 14px;
	margin: 0;
}

/* Comment Form */
.bb-rl-comment-sidebar__form {
	padding: 16px 20px;
	border-top: 1px solid var(--bb-content-border-color, #e2e8f0);
}

/* Ensure activity comment form fits the sidebar */
.bb-rl-comment-sidebar .ac-form {
	margin: 0;
	padding: 0;
	border: none;
	box-shadow: none;
}

/* ============================================================
   WORDPRESS NATIVE COMMENTS (when comment_system = 'wordpress')
   ============================================================ */
.bb-rl-single-wp-comments {
	margin-top: 32px;
	padding-top: 32px;
	border-top: 1px solid var(--bb-content-border-color, #e2e8f0);
}

.bb-rl-single-wp-comments .comments-title {
	font-size: 20px;
	font-weight: 600;
	margin: 0 0 20px;
	color: var(--bb-heading-text-color, #1a202c);
}

.bb-rl-single-wp-comments .comment-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.bb-rl-single-wp-comments .comment-list .comment {
	margin-bottom: 20px;
	padding-bottom: 20px;
	border-bottom: 1px solid var(--bb-content-border-color, #e2e8f0);
}

.bb-rl-single-wp-comments .comment-list .comment:last-child {
	margin-bottom: 0;
	padding-bottom: 0;
	border-bottom: none;
}

.bb-rl-single-wp-comments .comment-list .children {
	list-style: none;
	padding-left: 24px;
	margin-top: 16px;
}

.bb-rl-single-wp-comments .comment-respond {
	margin-top: 24px;
}

.bb-rl-single-wp-comments .comment-reply-title {
	font-size: 18px;
	font-weight: 600;
	margin: 0 0 12px;
	color: var(--bb-heading-text-color, #1a202c);
}

.bb-rl-single-wp-comments .comment-form textarea {
	width: 100%;
	padding: 12px;
	border: 1px solid var(--bb-content-border-color, #e2e8f0);
	border-radius: 8px;
	font-size: 14px;
	line-height: 1.5;
	resize: vertical;
	min-height: 120px;
}

.bb-rl-single-wp-comments .comment-form .submit {
	display: inline-flex;
	align-items: center;
	padding: 8px 20px;
	background: var(--bb-primary-color, #007CFF);
	color: #fff;
	border: none;
	border-radius: 6px;
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	transition: opacity 0.15s;
}

.bb-rl-single-wp-comments .comment-form .submit:hover {
	opacity: 0.9;
}

/* ============================================================
   DARK MODE
   ============================================================ */
.bb-dark-theme .bb-rl-single-wp-comments {
	border-color: var(--bb-content-border-color);
}

.bb-dark-theme .bb-rl-single-wp-comments .comment {
	border-color: var(--bb-content-border-color);
}

.bb-dark-theme .bb-rl-single-wp-comments .comment-form textarea {
	background: var(--bb-content-background-color);
	border-color: var(--bb-content-border-color);
	color: var(--bb-body-text-color);
}

.bb-dark-theme .bb-rl-single-nav {
	border-color: var(--bb-content-border-color);
}

.bb-dark-theme .bb-rl-single-follow-btn {
	border-color: var(--bb-primary-color);
	color: var(--bb-primary-color);
}

.bb-dark-theme .bb-rl-single-follow-btn:hover,
.bb-dark-theme .bb-rl-single-follow-btn.is-following {
	color: #fff;
}

.bb-dark-theme .bb-rl-single-tag-pill {
	background: var(--bb-content-background-color);
	border-color: var(--bb-content-border-color);
	color: var(--bb-body-text-color);
}

.bb-dark-theme .bb-rl-single-action-btn {
	border-color: var(--bb-content-border-color);
	color: var(--bb-alternate-text-color);
}

.bb-dark-theme .bb-rl-single-action-btn:hover {
	color: var(--bb-heading-text-color);
	border-color: var(--bb-alternate-text-color);
}

.bb-dark-theme .bb-rl-single-share__btn {
	background: var(--bb-content-background-color);
	color: var(--bb-body-text-color);
}

.bb-dark-theme .bb-rl-single-author-bio {
	background: var(--bb-content-background-color);
}

.bb-dark-theme .bb-rl-single-related__nav-btn {
	border-color: var(--bb-content-border-color);
	color: var(--bb-body-text-color);
}

.bb-dark-theme .bb-rl-comment-sidebar {
	background: var(--bb-content-background-color);
	border-color: var(--bb-content-border-color);
}

.bb-dark-theme .bb-rl-comment-sidebar__header {
	border-color: var(--bb-content-border-color);
}

.bb-dark-theme .bb-rl-comment-sidebar__reactions {
	border-color: var(--bb-content-border-color);
}

.bb-dark-theme .bb-rl-comment-sidebar__form {
	border-color: var(--bb-content-border-color);
}

.bb-dark-theme .bb-rl-comment-sidebar__body .activity-comments li {
	border-color: var(--bb-content-border-color);
}

/* ============================================================
   RTL
   ============================================================ */
[dir="rtl"] .bb-rl-single-nav__back svg {
	transform: scaleX(-1);
}

[dir="rtl"] .bb-rl-single-author-row {
	flex-direction: row-reverse;
}

[dir="rtl"] .bb-rl-single-author-row__left {
	flex-direction: row-reverse;
}

[dir="rtl"] .bb-rl-single-actions-row {
	justify-content: flex-start;
}

[dir="rtl"] .bb-rl-single-content .bb-rl-blog-content blockquote {
	border-left: none;
	border-right: 4px solid var(--bb-primary-color, #007CFF);
	padding-left: 0;
	padding-right: 20px;
}

[dir="rtl"] .bb-rl-single-author-bio {
	flex-direction: row-reverse;
}

[dir="rtl"] .bb-rl-single-related__nav-btn--prev svg {
	transform: scaleX(-1);
}

[dir="rtl"] .bb-rl-single-related__nav-btn--next svg {
	transform: scaleX(-1);
}

[dir="rtl"] .bb-rl-comment-sidebar__body .activity-comments .activity-comments {
	padding-left: 0;
	padding-right: 24px;
}

[dir="rtl"] .bb-rl-single-wp-comments .comment-list .children {
	padding-left: 0;
	padding-right: 24px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1200px) {
	.bb-rl-single-layout--two-col {
		grid-template-columns: 1fr 340px;
		gap: 32px;
	}
}

@media (max-width: 992px) {
	/* Stack to single column */
	.bb-rl-single-layout--two-col {
		grid-template-columns: 1fr;
		gap: 0;
	}

	.bb-rl-single-sidebar {
		position: static;
		max-height: none;
		overflow-y: visible;
		margin-top: 32px;
	}

	.bb-rl-single-related__track .bb-rl-blog-post-card {
		flex: 0 0 calc((100% - 20px) / 2);
	}
}

@media (max-width: 600px) {
	.bb-rl-single-title {
		font-size: 24px;
	}

	.bb-rl-single-author-row {
		flex-direction: column;
		align-items: flex-start;
		gap: 8px;
	}

	.bb-rl-single-author-bio {
		flex-direction: column;
		align-items: center;
		text-align: center;
	}

	.bb-rl-single-author-bio__footer {
		justify-content: center;
	}

	.bb-rl-single-related__track .bb-rl-blog-post-card {
		flex: 0 0 100%;
	}

	.bb-rl-single-content .bb-rl-blog-content {
		font-size: 16px;
	}

	.bb-rl-single-nav {
		font-size: 13px;
	}

	.bb-rl-comment-sidebar__body .activity-comments .activity-comments {
		padding-left: 12px;
	}

	[dir="rtl"] .bb-rl-comment-sidebar__body .activity-comments .activity-comments {
		padding-left: 0;
		padding-right: 12px;
	}

	[dir="rtl"] .bb-rl-single-author-row {
		flex-direction: column;
		align-items: flex-end;
	}

	[dir="rtl"] .bb-rl-single-author-bio {
		flex-direction: column;
	}
}

/* ── Error shake animation for action buttons ──────────────── */

@keyframes bb-rl-shake {
	0%, 100% { transform: translateX(0); }
	20%, 60% { transform: translateX(-4px); }
	40%, 80% { transform: translateX(4px); }
}

.bb-rl-single-bookmark-btn.is-error,
.bb-rl-single-subscribe-btn.is-error,
.bb-rl-single-follow-btn.is-error {
	animation: bb-rl-shake 0.4s ease-in-out;
}
