/* ==========================================================================
   SmartPreview — Recent Feed Styles
   ========================================================================== */

/* 1) Base: inherit theme size for everything */
.recent-feed {
	font-size: 1rem !important;    /* match your theme’s base */
	line-height: 1.6 !important;
}

/* 2) Topic title: slightly larger than base */
.recent-feed .topic-item .topic-header .topic-title {
	font-size: 1.2rem !important;   /* ~20% up from base */
}

/* 3) Timestamp: a bit smaller meta text */
.recent-feed .topic-item .topic-header .topic-time {
	font-size: 0.85rem !important;
}

/* Base container: full width, inherit theme fonts, include padding in width */
.recent-feed {
	width: 100%;
	margin: 0;
	padding: 0;
	font-family: inherit;
	line-height: inherit !important;
	box-sizing: border-box !important;
}

/* --------------------------------------------------------------------------
   Topic “cards”
   -------------------------------------------------------------------------- */
.recent-feed .topic-item {
	background-color: #ffffff;
	border: 1px solid #dfe0e4;
	border-radius: 6px;
	padding: 1.5rem;
	margin-bottom: 1rem;
	transition: background-color 0.2s, box-shadow 0.2s;
}

.recent-feed .topic-item:hover {
	background-color: #f5f8fa;
	box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}
/* Unread styles */

.recent-feed .first-post.unread {
        background-color: #fef2f3;
        padding: 0.75rem;
        border-radius: 4px;
}

/* Highlight the first unread reply just like your theme’s unread‐row */
.recent-feed .reply-snippet.unread {
  background-color: #fef2f3;
  padding: 0.75rem;
  border-radius: 4px;    /* slightly rounded corners */
  /* … */
}


/* --------------------------------------------------------------------------
   Header: title + timestamp
   -------------------------------------------------------------------------- */
.recent-feed .topic-item .topic-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 0.5rem;
}

.recent-feed .topic-item .topic-header .topic-title {
	line-height: 1.3 !important;
	font-weight: bold;
	text-decoration: none;
}

.recent-feed .topic-item .topic-header .topic-title:hover {
	text-decoration: underline;
}

.recent-feed .topic-item .topic-header .topic-time {
	color: #657786;
}

/* --------------------------------------------------------------------------
   First-post toggle
   -------------------------------------------------------------------------- */
.recent-feed .topic-item .toggle-first {
	display: inline-block;
	margin-bottom: 0.5rem;
	cursor: pointer;
}

.recent-feed .topic-item .toggle-first:hover {
	text-decoration: underline;
}

/* --------------------------------------------------------------------------
   Preview text blocks
   -------------------------------------------------------------------------- */
.recent-feed .topic-item .first-post,
.recent-feed .topic-item .reply-post {
	line-height: 1.5 !important;
	color: #333333;
	margin-bottom: 0.75rem;
}

/* Reply indentation + arrow */
.recent-feed .topic-item .reply-post {
	display: flex;
	align-items: flex-start;
	margin-left: 1.5rem;
	padding-left: 0.75rem;
}

.recent-feed .topic-item .reply-post::before {
	content: "↳";
	margin-right: 0.5rem;
	flex-shrink: 0;
}

/* ======== SmartPreview Feed Styling ======== */

/* 1) Remove underlines on all feed links */
.recent-feed a {
  text-decoration: none;
  color: inherit; /* use the surrounding text color */
}

.recent-feed a:hover {
  text-decoration: none;
}

.recent-feed .topic-item[data-topic-url],
.recent-feed .reply-snippet[data-reply-url] {
	cursor: pointer;
}

.recent-feed .topic-item[tabindex="0"]:focus-visible,
.recent-feed .reply-snippet[tabindex="0"]:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

/* 2) Specific link resets (if you have other nested selectors) */
.recent-feed .first-post a,
.recent-feed .reply-snippet a {
  text-decoration: none;
  color: inherit;
}

.recent-feed .first-post a,
.recent-feed .reply-text a {
	pointer-events: none;
}

.recent-feed .first-post a:hover,
.recent-feed .reply-snippet a:hover {
  text-decoration: none;
}

/* 3) Add a reply arrow before the reply‐meta */
.reply-snippet .reply-meta::before {
        content: "↳";
        display: inline-block;
        margin-right: 0.3rem;
        vertical-align: middle;
        color: currentColor;
}

.reply-snippet.unread .reply-meta::before {
        color: #28a745;
}

/* 4) Slight indent for reply block */
.reply-snippet {
  margin-left: 2rem;
  margin-top: 1rem;
}

/* 5) Optional hover effect on the item */
.topic-item:hover {
  background-color: rgba(0,0,0,0.03);
}

/* SmartPreview V13 Styling */

/* 1) Avatar: fixed 40×40px */
.topic-meta .avatar img {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 4px;
}

/* 2) Title block flex layout with ellipsis */
.topic-meta {
  display: flex;
  align-items: center;
}
.title-block {
  margin-left: 0.75rem;
  flex: 1;
}
.topic-title {
  display: inline-block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
  font-size: 1rem;
  font-weight: 600;
}

/* 3) “Show more” link styling */
.show-more {
  display: inline-block;
  margin-left: 0.5rem;
  font-size: 0.875rem;
  color: #007bff;
  text-decoration: none;
}
.show-more:hover {
  text-decoration: none;
  opacity: 0.8;
}

/* 4) Reply snippet indent & font scaling */
.reply-snippet {
  margin-left: 2rem;
  margin-top: 1rem;
}
.reply-meta {
  font-size: 0.875rem;
  color: #555;
}
.reply-text {
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

/* 5) Link reset in feed */
.recent-feed a {
  text-decoration: none;
  color: inherit;
}
.recent-feed a:hover {
  text-decoration: none;
}

/* ---------------------------------------------------
   1) Clamp long titles in their flex container
   --------------------------------------------------- */
.title-block {
  /* allow flex child to shrink smaller than its content */
  flex: 1 1 auto;
  min-width: 0;
}

/* apply ellipsis */
.topic-title {
  display: inline-block;  /* allow label and title on one line */
  max-width: 100%;        /* clamp within parent flex item */
  white-space: nowrap;    /* no wrapping */
  overflow: hidden;       /* clip overflow */
  text-overflow: ellipsis;
}

/* ---------------------------------------------------
   2) Excerpt + “Show more” on one line
   --------------------------------------------------- */
/* Excerpt containers back to normal block flow */
.first-post,
.reply-text {
  display: block;
  margin: 0; /* or whatever spacing you had before */
  overflow: hidden;
}

.first-post > a:not(.show-more),
.reply-text > a:not(.show-more) {
  display: block;
  overflow: hidden;
}

.recent-feed .preview-thumb {
  overflow: hidden;
  margin: 0 0 0.5rem;
  pointer-events: none;
}

.recent-feed .preview-thumb img {
  display: block;
  float: none !important;
  position: static !important;
  max-width: 100% !important;
  width: auto !important;
  height: auto !important;
  max-height: 120px;
  object-fit: contain;
  border-radius: 4px;
  pointer-events: none;
}

.recent-feed .first-post blockquote,
.recent-feed .reply-text blockquote,
.recent-feed .first-post .content,
.recent-feed .reply-text .content {
  overflow: hidden;
}

.recent-feed .first-post img:not(.smilies):not(.emoji),
.recent-feed .reply-text img:not(.smilies):not(.emoji) {
  display: block;
  float: none !important;
  position: static !important;
  max-width: 100% !important;
  width: auto !important;
  height: auto !important;
  max-height: 120px;
  margin: 0.35rem 0;
  object-fit: contain;
  border-radius: 4px;
  pointer-events: none;
}

.recent-feed .first-post a img:not(.smilies):not(.emoji),
.recent-feed .reply-text a img:not(.smilies):not(.emoji) {
  max-width: 100% !important;
}

/* “Show more” stays glued to the end of the excerpt */
.show-more {
  display: inline;
  white-space: nowrap;
  margin-left: 0.25rem;
  color: #007bff !important;    /* or your link color */
  text-decoration: none;
}

.show-more:hover {
  opacity: 0.8;
}

/* Always keep the “Show more” link glued to the ellipsis */
.show-more {
  margin-left: 0.25rem;
  white-space: nowrap;    /* never break inside the link */
  display: inline-block;
}

/* === Topic Stats Icons === */
/* Ensure the container and badge both render inline and stay visible */
.topic-stats {
	display: flex;
	align-items: center;
	gap: 1em;
	font-size: 0.875em;
	color: var(--muted-text);
}

.topic-stats .stat {
	display: inline-flex;
	align-items: center;
}

/* Icon styling (you already have this working) */
.topic-stats .stat .icon {
	font-size: 1em;
	margin-right: 0.25em;
	opacity: 0.6;
}

/* New-replies badge: force inline-block, visible background, no off-screen margin */
.topic-stats .stat.new-replies .badge {
	display: inline-block;
	background-color: var(--danger-color, #d9534f); /* fallback to red */
	color: #fff;
	border-radius: 0.5em;
	padding: 0.1em 0.4em;
	font-size: 0.75em;
	line-height: 1;
	margin-left: 0.25em;     /* positive to sit just right of the icon */
	vertical-align: middle;
}
.topic-stats .new-replies .icon {
	color: var(--danger-color);   /* make it your “alert” color */
	opacity: 1;                   /* full opacity */
}
/* Nudge the new-replies badge up slightly */
.topic-stats .stat.new-replies .badge {
	position: relative;
	top: -0.10em;   /* adjust this value up/down to taste */
}
.topic-stats > .new-replies > .icon-gray {
	color: var(--muted-text);
}


/* ==========================================================================
   Desktop horizontal padding
   ========================================================================== */
@media (min-width: 601px) {
	.recent-feed {
		box-sizing: border-box !important;
		padding: 0 !important;
	}
}

/* ==========================================================================
   Mobile adjustments (≤600px)
   ========================================================================== */
@media (max-width: 600px) {
        .recent-feed {
                width: auto !important;
                padding: 0 1rem !important;
                box-sizing: border-box !important;
        }

	.recent-feed .first-post img:not(.smilies):not(.emoji),
	.recent-feed .reply-text img:not(.smilies):not(.emoji),
	.recent-feed .preview-thumb img {
		max-height: 96px;
	}

	.recent-feed .topic-item .topic-header .topic-title {
		/* still 1.2em of the inherited base */
		line-height: 1.3 !important;
	}

	.recent-feed .topic-item .first-post,
	.recent-feed .topic-item .reply-post {
		line-height: 1.5 !important;
	}

}

/* Unread label styling */
.title-line {
    display: flex;
    align-items: baseline;
    font-size: 1.2rem;
    font-weight: bold;
}

.unread-label {
    color: #28a745;
    font-size: inherit;
    font-weight: inherit;
    margin-right: 0.25em;
}

/* --------------------------------------------------------------------------
   SmartPreview view-switch tabs
   -------------------------------------------------------------------------- */
.sp-tabs-wrap {
    margin: 0 auto 1rem;
    max-width: var(--content-width, 100%);
}

.sp-tabs-wrap--top-nav {
	padding: 0 0.15rem;
	box-sizing: border-box;
	clear: both;
}

.sp-view-tabs {
    display: flex;
    font-family: inherit;
    color: inherit;
    border-bottom: 1px solid var(--border-color, #dfe0e4);
}

.sp-view-tabs a {
    flex: 1 0 50%;
    text-align: center;
    padding: 0.5em 0;
    font-size: 1.1rem;
    color: inherit;
    text-decoration: none;
}

.sp-view-tabs a:hover {
    text-decoration: underline;
}

.sp-view-tabs a.active {
    font-weight: bold;
    border-bottom: 2px solid currentColor;
}

@media (max-width: 600px) {
    .sp-view-tabs a {
        flex: 1;
        font-size: 1rem;
    }
}

/* --------------------------------------------------------------------------
   SmartPreview action buttons
   -------------------------------------------------------------------------- */
.sp-start-conversation-wrap {
	margin: 0 auto 0.9rem;
	width: 100%;
	max-width: 100%;
	padding: 0 1rem;
	box-sizing: border-box;
	position: sticky;
	top: var(--sp-sticky-top, 0.25rem);
	z-index: 0;
}

.sp-load-more-wrap {
	margin: 0.9rem 0 0.45rem;
	max-width: 100%;
}

.sp-start-conversation-button,
.sp-load-more-button {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	width: 100%;
	box-sizing: border-box;
	padding: 0.85rem 1rem;
	border-radius: 0.6rem;
	font-weight: 600;
	font-size: 1rem;
	line-height: 1.15;
	text-align: center;
	text-decoration: none;
	color: #D31141;
}

.sp-start-conversation-button:visited,
.sp-load-more-button:visited,
.sp-start-conversation-button:hover,
.sp-load-more-button:hover,
.sp-start-conversation-button:focus,
.sp-load-more-button:focus {
	color: #D31141;
}

.sp-start-conversation-button .icon,
.sp-load-more-button .icon {
	font-size: 0.95em;
	line-height: 1;
	margin: 0;
	flex: 0 0 auto;
}

@media (min-width: 601px) {
	.sp-start-conversation-wrap {
		padding: 0;
	}
}

@media (min-width: 768px) {
	.sp-start-conversation-button,
	.sp-load-more-button {
		gap: 0.45rem;
		padding: 0.72rem 0.95rem;
		font-size: 0.95rem;
	}

	.sp-load-more-wrap {
		margin-top: 0.8rem;
	}
}


.sp-avatar-nav-backdrop {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.35);
	z-index: 30;
}

.sp-avatar-nav-panel {
	position: fixed;
	top: 0;
	left: 0;
	bottom: 0;
	width: min(16rem, 88vw);
	background: #ffffff;
	box-shadow: 4px 0 16px rgba(0, 0, 0, 0.2);
	transform: translateX(-105%);
	transition: transform 0.2s ease;
	z-index: 31;
	padding: 0.85rem;
	box-sizing: border-box;
}

.sp-avatar-nav-panel.is-open {
	transform: translateX(0);
}

.sp-avatar-nav-close {
	border: 0;
	background: transparent;
	cursor: pointer;
	padding: 0.2rem;
	margin: 0 0 0.8rem auto;
	display: block;
}

.sp-avatar-nav-links a {
	display: block;
	padding: 0.62rem 0;
	text-decoration: none;
	color: inherit;
	font-size: 1rem;
	line-height: 1.4;
	font-weight: 500;
}

.sp-avatar-nav-links a.active {
	font-weight: 600;
}

.sp-avatar-nav-links {
	display: flex;
	flex-direction: column;
	min-height: calc(100% - 2rem);
}

.sp-avatar-nav-links__group {
	display: flex;
	flex-direction: column;
}

.sp-avatar-nav-links__group--middle {
	margin-top: 1rem;
}

.sp-avatar-nav-links__group--bottom {
	margin-top: auto;
	padding-top: 1rem;
	border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.sp-avatar-nav-links__notifications {
	display: flex !important;
	align-items: center;
	justify-content: space-between;
}

.sp-avatar-nav-badge {
	margin-left: 0.5rem;
	min-width: 1.25rem;
	height: 1.25rem;
	padding: 0 0.3rem;
	border-radius: 999px;
	background: #d31141;
	color: #ffffff;
	font-size: 0.72rem;
	line-height: 1.25rem;
	font-weight: 600;
	text-align: center;
}

@media (min-width: 768px) {
	.sp-avatar-nav-panel,
	.sp-avatar-nav-backdrop {
		display: none !important;
	}
}

/* --------------------------------------------------------------------------
   SmartPreview back-to-top button
   -------------------------------------------------------------------------- */
.sp-loading-indicator {
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0.75rem 0 1rem;
	color: #D31141;
}

.sp-loading-indicator .icon {
	font-size: 1.2rem;
	line-height: 1;
}

.sp-loading-indicator.is-hidden {
	display: none;
}

/* --------------------------------------------------------------------------
   SmartPreview mobile top reveal dock (Recent page)
   -------------------------------------------------------------------------- */
.sp-top-dock {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 18;
	background-color: #ffffff;
	border-bottom: 1px solid rgba(0, 0, 0, 0.08);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transform: translateY(-100%);
	transition: transform 0.28s ease, opacity 0.28s ease, visibility 0.28s ease;
}

.sp-top-dock.is-visible {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transform: translateY(0);
}

.sp-top-dock__inner {
	display: flex;
	flex-direction: column;
	padding: 0;
}

.sp-top-dock__top {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: space-between;
	min-height: 2.75rem;
	padding: 0.4rem 0.9rem 0.35rem;
	width: 100%;
	box-sizing: border-box;
}

.sp-top-dock__left {
	display: flex;
	align-items: center;
	flex: 0 0 auto;
}

.sp-top-dock__avatar {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.75rem;
	height: 1.75rem;
	border-radius: 999px;
	overflow: hidden;
	background-color: #f2f4f5;
	color: #5b626a;
}

.sp-top-dock__avatar-trigger {
	border: 0;
	cursor: pointer;
	padding: 0;
}

.sp-top-dock__avatar img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 999px;
}

.sp-top-dock__avatar .icon {
	font-size: 0.85rem;
	line-height: 1;
}

.sp-top-dock__center {
	position: absolute;
	left: 50%;
	transform: translateX(-50%);
	text-align: center;
	pointer-events: none;
}

.sp-top-dock__logo {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.25rem;
	height: 1.25rem;
	font-size: 0.8rem;
	line-height: 1;
	color: #1f2328;
}

.sp-top-dock__brand-text {
	display: inline-block;
	font-size: 0.72rem;
	font-weight: 600;
	line-height: 1;
	letter-spacing: 0.02em;
	max-width: 7ch;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.sp-top-dock__brand-logo {
	display: block;
	max-width: 1.9rem;
	max-height: 1.15rem;
	width: auto;
	height: auto;
	object-fit: contain;
}

.sp-top-dock__right {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	flex: 0 0 auto;
}

.sp-top-dock__notifications {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.75rem;
	height: 1.75rem;
	border-radius: 999px;
	background-color: #f2f4f5;
	color: #5b626a;
	text-decoration: none;
	position: relative;
}

.sp-top-dock__notifications-badge {
	position: absolute;
	top: -0.25rem;
	right: -0.35rem;
	min-width: 1rem;
	height: 1rem;
	padding: 0 0.2rem;
	border-radius: 999px;
	background: #d31141;
	color: #ffffff;
	font-size: 0.66rem;
	line-height: 1rem;
	font-weight: 600;
	text-align: center;
}

.sp-top-dock__notifications .icon {
	font-size: 0.85rem;
	line-height: 1;
}

.sp-top-dock__bottom {
	width: 100%;
}

.sp-top-dock__tabs {
	display: flex;
	width: 100%;
}

.sp-top-dock__tab {
	flex: 1 0 50%;
	text-align: center;
	padding: 0.5em 0;
	font-size: 1rem;
	color: inherit;
	text-decoration: none;
	border-bottom: 1px solid transparent;
}

.sp-top-dock__tab:hover {
	text-decoration: underline;
}

.sp-top-dock__tab.is-active {
	font-weight: bold;
	border-bottom-color: currentColor;
	border-bottom-width: 2px;
}

.sp-layout {
	min-width: 0;
}

@media (min-width: 1024px) {
	.sp-layout--with-sidebar {
		display: grid;
		grid-template-columns: minmax(11rem, 14rem) minmax(0, 1fr);
		gap: 1rem;
		align-items: start;
	}

	.sp-layout--with-sidebar .sp-layout__main {
		min-width: 0;
	}

	.sp-layout--with-sidebar .sp-start-conversation-wrap {
		max-width: 100%;
		margin-bottom: 0.9rem;
	}

	.sp-desktop-sidebar {
		position: sticky;
		top: var(--sp-sticky-top, 0.25rem);
		align-self: start;
		min-height: 16rem;
		padding: 0.75rem;
		border: 1px solid var(--border-color, #dfe0e4);
		border-radius: 0.45rem;
		background: rgba(255, 255, 255, 0.95);
		box-sizing: border-box;
	}

	.sp-desktop-sidebar__title {
		margin: 0 0 0.55rem;
		font-size: 0.95rem;
		font-weight: 700;
	}

	.sp-desktop-sidebar__nav {
		display: flex;
		flex-direction: column;
	}

	.sp-desktop-sidebar__nav a {
		display: block;
		padding: 0.6rem 0.75rem;
		text-decoration: none;
		color: inherit;
		font-weight: 500;
	}

	.sp-desktop-sidebar__nav a + a {
		border-top: 1px solid var(--border-color, #dfe0e4);
	}

	.sp-desktop-sidebar__nav a.active {
		font-weight: 700;
	}
}

@media (max-width: 1023px) {
	.sp-desktop-sidebar {
		display: none;
	}
}

@media (max-width: 767px) {
	.sp-start-conversation-wrap {
		transition: top 0.28s ease;
	}

	body.sp-top-dock-visible .sp-start-conversation-wrap {
		top: calc(var(--sp-sticky-top, 0.25rem) + var(--sp-top-dock-height, 0px));
	}
}

.sp-back-to-top {
	position: fixed;
	right: 1rem;
	bottom: var(--sp-back-to-top-bottom, 1rem);
	z-index: 40;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.75rem;
	height: 2.75rem;
	border: 0;
	border-radius: 999px;
	background-color: #D31141;
	color: #ffffff;
	cursor: pointer;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transform: translateY(6px);
	transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
}

.sp-back-to-top .icon {
	font-size: 0.95rem;
	line-height: 1;
}

.sp-back-to-top.is-visible {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transform: translateY(0);
}

.sp-back-to-top:focus-visible {
	outline: 2px solid #ffffff;
	outline-offset: 2px;
}

@media (min-width: 768px) {
	.sp-top-dock {
		display: none !important;
	}

	.sp-back-to-top {
		right: 1.5rem;
		bottom: 1.5rem;
	}
}
