/**
 * Freedomman Theme - Single Post Stylesheet (V1)
 *
 * Implements the approved Single Article design:
 * - Breadcrumbs, High-contrast Article Header, Meta & Social Sharing
 * - Featured Image (16:9 ratio, rounded, responsive)
 * - Optimal Reading Measure (720-780px body width, line-height 1.8)
 * - Quick Summary ("Tóm tắt nhanh") container
 * - Strong Heading Hierarchy (H2 white, H3 cyan accent, scroll-margin-top for sticky header)
 * - Sticky Desktop Sidebar: Dynamic TOC, Related Posts, Workflow CTA placeholder, Explore More
 * - Responsive Adaptations: Single-column Tablet & Mobile, Collapsible Inline TOC + Floating Drawer
 * - Reusable Bottom Related Articles grid
 *
 * @package Freedomman
 * @version 1.0.0
 */

/* ==========================================================================
   1. BREADCRUMBS
   ========================================================================== */
.fm-breadcrumb {
	padding: clamp(16px, 2.5vw, 24px) 0 clamp(12px, 1.5vw, 16px);
}

.fm-breadcrumb-list {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 8px;
	list-style: none;
	margin: 0;
	padding: 0;
	font-size: 13px;
	color: var(--fm-text-muted);
}

.fm-breadcrumb-item {
	display: inline-flex;
	align-items: center;
}

.fm-breadcrumb-link {
	color: var(--fm-text-muted);
	text-decoration: none;
	transition: color var(--fm-transition-micro);
}

.fm-breadcrumb-link:hover {
	color: var(--fm-brand-cyan);
}

.fm-breadcrumb-sep {
	color: var(--fm-border-visible);
	font-size: 11px;
	user-select: none;
}

.fm-breadcrumb-current {
	color: var(--fm-text-secondary);
	max-width: 480px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* ==========================================================================
   2. ARTICLE HEADER
   ========================================================================== */
.fm-article-header-container {
	margin-bottom: clamp(24px, 3.5vw, 40px);
}

.fm-article-header {
	display: flex;
	flex-direction: column;
	max-width: 100%;
}

.fm-article-badge-row {
	margin-bottom: var(--fm-space-3);
}

.fm-article-badge-row .fm-badge {
	font-size: 12px;
	font-weight: var(--fm-weight-semibold);
	padding: 4px 12px;
	border-radius: var(--fm-radius-pill);
	letter-spacing: 0.02em;
}

/* H1 Title */
.fm-article-title {
	font-size: clamp(30px, 4vw, 48px);
	font-weight: var(--fm-weight-extrabold);
	line-height: 1.15;
	color: var(--fm-text-primary);
	margin: 0 0 clamp(16px, 2vw, 20px) 0;
	letter-spacing: -0.02em;
	word-wrap: break-word;
}

/* Subtitle / Excerpt */
.fm-article-intro {
	font-size: clamp(16px, 1.8vw, 18px);
	line-height: 1.6;
	color: var(--fm-text-secondary);
	margin-bottom: clamp(20px, 2.5vw, 28px);
	max-width: 900px;
}

.fm-article-intro p {
	margin: 0;
}

/* Meta & Share Bar */
.fm-article-meta-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 16px;
	padding-bottom: clamp(20px, 2.5vw, 28px);
	border-bottom: 1px solid var(--fm-border-subtle);
	margin-bottom: clamp(24px, 3vw, 36px);
}

.fm-article-meta-left {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
}

.fm-author-avatar-wrap {
	width: 38px;
	height: 38px;
	border-radius: var(--fm-radius-pill);
	overflow: hidden;
	background-color: var(--fm-bg-surface-raised);
	border: 1px solid var(--fm-border-subtle);
	flex-shrink: 0;
}

.fm-author-avatar-wrap img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.fm-meta-details {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 13.5px;
	color: var(--fm-text-muted);
	flex-wrap: wrap;
}

.fm-author-name {
	font-weight: var(--fm-weight-semibold);
	color: var(--fm-text-primary);
}

.fm-meta-divider {
	color: var(--fm-border-visible);
	font-size: 10px;
}

.fm-meta-date,
.fm-meta-time {
	display: inline-flex;
	align-items: center;
	gap: 5px;
}

.fm-meta-date svg,
.fm-meta-time svg {
	color: var(--fm-brand-cyan);
}

/* Share Buttons Area */
.fm-article-share {
	display: inline-flex;
	align-items: center;
	gap: 10px;
}

.fm-share-label {
	font-size: 13px;
	font-weight: var(--fm-weight-medium);
	color: var(--fm-text-muted);
}

.fm-share-btn-group {
	display: inline-flex;
	align-items: center;
	gap: 8px;
}

.fm-share-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	border-radius: var(--fm-radius-pill);
	background-color: var(--fm-bg-surface);
	border: 1px solid var(--fm-border-subtle);
	color: var(--fm-text-secondary);
	text-decoration: none;
	cursor: pointer;
	position: relative;
	transition: background-color var(--fm-transition-micro),
	            border-color var(--fm-transition-micro),
	            color var(--fm-transition-micro),
	            transform var(--fm-transition-micro);
}

.fm-share-btn:hover {
	transform: translateY(-2px);
	background-color: var(--fm-bg-surface-raised);
	border-color: var(--fm-brand-cyan);
	color: var(--fm-brand-cyan);
	box-shadow: var(--fm-glow-interactive);
}

.fm-share-fb:hover { color: #1877F2; border-color: #1877F2; }
.fm-share-tw:hover { color: #FFFFFF; border-color: #FFFFFF; }
.fm-share-li:hover { color: #0A66C2; border-color: #0A66C2; }

/* Copy Link Tooltip */
.fm-share-copy {
	background-color: transparent;
	padding: 0;
}

.fm-share-tooltip {
	position: absolute;
	bottom: calc(100% + 8px);
	left: 50%;
	transform: translateX(-50%);
	background-color: var(--fm-bg-surface-raised);
	color: var(--fm-brand-cyan);
	border: 1px solid var(--fm-border-visible);
	font-size: 11px;
	font-weight: var(--fm-weight-medium);
	padding: 4px 8px;
	border-radius: 4px;
	white-space: nowrap;
	opacity: 0;
	pointer-events: none;
	transition: opacity 150ms ease, transform 150ms ease;
	box-shadow: var(--fm-shadow-surface);
	z-index: 10;
}

.fm-share-copy.is-copied .fm-share-tooltip {
	opacity: 1;
	transform: translateX(-50%) translateY(-2px);
}

/* Featured Image */
.fm-article-featured-media {
	width: 100%;
	margin: 0;
	border-radius: var(--fm-radius-lg);
	overflow: hidden;
	background-color: var(--fm-bg-surface);
	border: 1px solid var(--fm-border-subtle);
}

.fm-featured-img {
	width: 100%;
	height: auto;
	aspect-ratio: 16 / 9;
	object-fit: cover;
	display: block;
}

.fm-featured-caption {
	padding: 12px 16px;
	font-size: 13.5px;
	color: var(--fm-text-muted);
	font-style: italic;
	text-align: center;
	background-color: var(--fm-bg-deep);
	border-top: 1px solid var(--fm-border-subtle);
}

/* ==========================================================================
   3. MAIN TWO-COLUMN ARTICLE LAYOUT
   ========================================================================== */
.fm-article-layout-container {
	margin-bottom: clamp(48px, 6vw, 80px);
}

.fm-article-layout {
	display: flex;
	gap: clamp(32px, 4vw, 56px);
	align-items: flex-start;
}

/* Left / Main Column (70-75%) */
.fm-article-main {
	flex: 1 1 0%;
	min-width: 0;
}

/* Right Sidebar (25-30%) */
.fm-article-sidebar {
	flex: 0 0 350px;
	width: 350px;
	min-width: 0;
}

.fm-sidebar-sticky {
	position: sticky;
	top: 90px;
	display: flex;
	flex-direction: column;
	gap: 24px;
}

/* Sidebar Cards */
.fm-sidebar-card {
	background-color: var(--fm-bg-surface);
	border: 1px solid var(--fm-border-subtle);
	border-radius: var(--fm-radius-lg);
	padding: 20px 22px;
	box-shadow: var(--fm-shadow-surface);
}

.fm-sidebar-card-title {
	font-size: 16px;
	font-weight: var(--fm-weight-bold);
	color: var(--fm-text-primary);
	margin: 0 0 16px 0;
	display: flex;
	align-items: center;
	gap: 8px;
}

.fm-sidebar-card-title svg {
	color: var(--fm-brand-cyan);
}

/* ==========================================================================
   4. SIDEBAR COMPONENT 1: TABLE OF CONTENTS (TOC)
   ========================================================================== */
.fm-sidebar-toc-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 6px;
	max-height: calc(100vh - 280px);
	overflow-y: auto;
	scrollbar-width: thin;
	scrollbar-color: var(--fm-border-visible) transparent;
}

.fm-sidebar-toc-list::-webkit-scrollbar {
	width: 4px;
}

.fm-sidebar-toc-list::-webkit-scrollbar-thumb {
	background-color: var(--fm-border-visible);
	border-radius: 4px;
}

.fm-toc-item {
	position: relative;
	transition: color var(--fm-transition-micro);
}

.fm-toc-link {
	display: block;
	font-size: 13.5px;
	line-height: 1.45;
	color: var(--fm-text-secondary);
	text-decoration: none;
	padding: 5px 8px 5px 12px;
	border-left: 2px solid transparent;
	border-radius: 0 4px 4px 0;
	transition: all var(--fm-transition-micro);
}

.fm-toc-level-3 .fm-toc-link {
	padding-left: 24px;
	font-size: 13px;
	color: var(--fm-text-muted);
}

.fm-toc-link:hover {
	color: var(--fm-brand-cyan);
	background-color: rgba(0, 221, 251, 0.05);
}

/* Active State: Highlighted as user scrolls */
.fm-toc-item.is-active > .fm-toc-link {
	color: var(--fm-brand-cyan);
	font-weight: var(--fm-weight-semibold);
	border-left-color: var(--fm-brand-cyan);
	background-color: rgba(0, 221, 251, 0.08);
}

/* ==========================================================================
   5. SIDEBAR COMPONENT 2: RELATED POSTS
   ========================================================================== */
.fm-sidebar-related-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.fm-sidebar-related-link {
	display: flex;
	align-items: center;
	gap: 12px;
	text-decoration: none;
	group: hover;
}

.fm-sidebar-related-thumb {
	width: 68px;
	height: 52px;
	border-radius: var(--fm-radius-sm);
	overflow: hidden;
	background-color: var(--fm-bg-deep);
	flex-shrink: 0;
}

.fm-sidebar-related-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform var(--fm-transition-card);
}

.fm-sidebar-related-link:hover .fm-sidebar-related-thumb img {
	transform: scale(1.06);
}

.fm-sidebar-related-info {
	flex: 1 1 auto;
	min-width: 0;
}

.fm-sidebar-related-title {
	font-size: 13.5px;
	font-weight: var(--fm-weight-semibold);
	line-height: 1.35;
	color: var(--fm-text-primary);
	margin: 0 0 4px 0;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	transition: color var(--fm-transition-micro);
}

.fm-sidebar-related-link:hover .fm-sidebar-related-title {
	color: var(--fm-brand-cyan);
}

.fm-sidebar-related-date {
	font-size: 12px;
	color: var(--fm-text-muted);
}

/* ==========================================================================
   6. SIDEBAR COMPONENT 3: RELATED WORKFLOW CTA (PLACEHOLDER)
   ========================================================================== */
.fm-sidebar-workflow-cta {
	background: linear-gradient(145deg, #09111F 0%, #111A2D 100%);
	border-color: rgba(115, 87, 255, 0.35);
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6), 0 0 20px rgba(115, 87, 255, 0.1);
	position: relative;
	overflow: hidden;
}

.fm-sidebar-workflow-cta::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 2px;
	background: linear-gradient(90deg, #D844FF, #7357FF, #00DDFB);
}

.fm-workflow-badge-row {
	margin-bottom: 10px;
}

.fm-badge-workflow,
.fm-workflow-badge-row .fm-badge {
	background-color: rgba(216, 68, 255, 0.15);
	color: #E268FF;
	border: 1px solid rgba(216, 68, 255, 0.4);
	font-size: 11px;
	font-weight: var(--fm-weight-bold);
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.fm-workflow-cta-title {
	font-size: 16px;
	font-weight: var(--fm-weight-bold);
	line-height: 1.3;
	color: var(--fm-text-primary);
	margin: 0 0 6px 0;
}

.fm-workflow-cta-desc {
	font-size: 12.5px;
	line-height: 1.5;
	color: var(--fm-text-muted);
	margin: 0 0 12px 0;
}

.fm-workflow-cta-meta {
	display: flex;
	align-items: center;
	gap: 12px;
	font-size: 12px;
	color: var(--fm-text-secondary);
	margin-bottom: 16px;
}

.fm-workflow-meta-item {
	display: inline-flex;
	align-items: center;
	gap: 5px;
}

.fm-workflow-meta-item svg {
	color: var(--fm-brand-cyan);
}

.fm-workflow-cta-footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding-top: 12px;
	border-top: 1px solid var(--fm-border-subtle);
}

.fm-workflow-price {
	font-size: 17px;
	font-weight: var(--fm-weight-extrabold);
	color: #FFB547;
}

.fm-btn-workflow-cta {
	min-height: 38px;
	padding: 0 16px;
	font-size: 13px;
	font-weight: var(--fm-weight-semibold);
}

/* ==========================================================================
   7. SIDEBAR COMPONENT 4: EXPLORE MORE
   ========================================================================== */
.fm-sidebar-explore-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.fm-sidebar-explore-link {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 10px 12px;
	border-radius: var(--fm-radius-sm);
	color: var(--fm-text-secondary);
	text-decoration: none;
	font-size: 13.5px;
	background-color: var(--fm-bg-deep);
	border: 1px solid var(--fm-border-subtle);
	transition: background-color var(--fm-transition-micro),
	            border-color var(--fm-transition-micro),
	            color var(--fm-transition-micro),
	            transform var(--fm-transition-micro);
}

.fm-sidebar-explore-link:hover {
	background-color: var(--fm-bg-surface-raised);
	border-color: var(--fm-border-visible);
	color: var(--fm-brand-cyan);
	transform: translateX(2px);
}

.fm-explore-icon-wrap {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: var(--fm-brand-cyan);
}

.fm-explore-text {
	flex: 1 1 auto;
	font-weight: var(--fm-weight-medium);
}

.fm-explore-arrow {
	color: var(--fm-text-muted);
	font-size: 13px;
	transition: transform var(--fm-transition-micro);
}

.fm-sidebar-explore-link:hover .fm-explore-arrow {
	transform: translateX(3px);
	color: var(--fm-brand-cyan);
}

/* ==========================================================================
   8. ARTICLE BODY — READABLE TYPOGRAPHY & MEASURE (720-780px)
   ========================================================================== */
.fm-article-body {
	max-width: 760px;
	font-size: clamp(16.5px, 1.25vw, 18px);
	line-height: 1.8;
	color: var(--fm-text-secondary);
	word-wrap: break-word;
}

/* Headings within Article Body */
.fm-article-body h2,
.fm-article-body h3,
.fm-article-body h4 {
	color: var(--fm-text-primary);
	font-weight: var(--fm-weight-bold);
	line-height: 1.25;
	scroll-margin-top: 100px; /* Offset for sticky header */
}

.fm-article-body h2 {
	font-size: clamp(24px, 2.5vw, 30px);
	margin-top: clamp(40px, 5vw, 56px);
	margin-bottom: 18px;
	padding-bottom: 10px;
	border-bottom: 1px solid var(--fm-border-subtle);
}

.fm-article-body h3 {
	font-size: clamp(19px, 1.8vw, 22px);
	color: #38BDF8; /* Restrained Cyan Accent as shown in approved mockup */
	margin-top: clamp(28px, 3.5vw, 38px);
	margin-bottom: 14px;
}

.fm-article-body h4 {
	font-size: 17px;
	margin-top: 24px;
	margin-bottom: 10px;
}

.fm-article-body p {
	margin: 0 0 24px 0;
}

.fm-article-body a {
	color: var(--fm-brand-cyan);
	text-decoration: underline;
	text-underline-offset: 3px;
	transition: color var(--fm-transition-micro);
}

.fm-article-body a:hover {
	color: #38BDF8;
	text-decoration-thickness: 2px;
}

.fm-article-body strong {
	color: var(--fm-text-primary);
	font-weight: var(--fm-weight-bold);
}

.fm-article-body em {
	font-style: italic;
	color: var(--fm-text-secondary);
}

/* Lists */
.fm-article-body ul,
.fm-article-body ol {
	margin: 0 0 26px 0;
	padding-left: 24px;
}

.fm-article-body li {
	margin-bottom: 10px;
	line-height: 1.7;
}

.fm-article-body li::marker {
	color: var(--fm-brand-cyan);
}

/* Blockquote */
.fm-article-body blockquote {
	margin: 32px 0;
	padding: 18px 24px;
	background-color: var(--fm-bg-surface);
	border-left: 4px solid var(--fm-brand-cyan);
	border-radius: 0 var(--fm-radius-md) var(--fm-radius-md) 0;
	color: var(--fm-text-primary);
	font-style: italic;
}

.fm-article-body blockquote p:last-child {
	margin-bottom: 0;
}

/* Code & Preformatted */
.fm-article-body code {
	font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
	font-size: 0.88em;
	padding: 2px 6px;
	background-color: var(--fm-bg-deep);
	border: 1px solid var(--fm-border-subtle);
	border-radius: 4px;
	color: #38BDF8;
}

.fm-article-body pre {
	margin: 28px 0;
	padding: 18px 20px;
	background-color: #02060D;
	border: 1px solid var(--fm-border-visible);
	border-radius: var(--fm-radius-md);
	overflow-x: auto;
	font-size: 14px;
	line-height: 1.6;
}

.fm-article-body pre code {
	padding: 0;
	background: none;
	border: none;
	color: #E2E8F0;
}

/* Figures & Images in Content */
.fm-article-body figure {
	margin: 36px 0;
}

.fm-article-body img {
	max-width: 100%;
	height: auto;
	border-radius: var(--fm-radius-md);
	display: block;
	border: 1px solid var(--fm-border-subtle);
}

.fm-article-body figcaption {
	padding-top: 10px;
	font-size: 13px;
	color: var(--fm-text-muted);
	text-align: center;
	font-style: italic;
}

/* Tables */
.fm-article-body table {
	width: 100%;
	margin: 28px 0;
	border-collapse: collapse;
	font-size: 14.5px;
	border: 1px solid var(--fm-border-subtle);
	border-radius: var(--fm-radius-md);
	overflow: hidden;
}

.fm-article-body th,
.fm-article-body td {
	padding: 12px 16px;
	text-align: left;
	border-bottom: 1px solid var(--fm-border-subtle);
}

.fm-article-body th {
	background-color: var(--fm-bg-surface-raised);
	color: var(--fm-text-primary);
	font-weight: var(--fm-weight-semibold);
}

.fm-article-body tr:last-child td {
	border-bottom: none;
}

/* ==========================================================================
   9. QUICK SUMMARY BOX ("TÓM TẮT NHANH")
   ========================================================================== */
.fm-quick-summary {
	background-color: var(--fm-bg-surface);
	border: 1px solid rgba(0, 221, 251, 0.28);
	border-radius: var(--fm-radius-lg);
	padding: clamp(20px, 3vw, 28px);
	margin: clamp(24px, 3vw, 36px) 0;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 0 15px rgba(0, 221, 251, 0.08);
	position: relative;
	overflow: hidden;
}

.fm-quick-summary::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 2px;
	background: linear-gradient(90deg, #00DDFB, #2788FF);
}

.fm-summary-header {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 16px;
}

.fm-summary-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border-radius: var(--fm-radius-pill);
	background-color: rgba(0, 221, 251, 0.15);
	color: var(--fm-brand-cyan);
	flex-shrink: 0;
}

.fm-summary-title {
	font-size: 18px;
	font-weight: var(--fm-weight-bold);
	color: var(--fm-brand-cyan);
	margin: 0;
}

.fm-summary-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.fm-summary-list li {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	font-size: 15px;
	line-height: 1.55;
	color: var(--fm-text-primary);
	margin-bottom: 0;
}

.fm-summary-check {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 18px;
	height: 18px;
	border-radius: var(--fm-radius-pill);
	background-color: rgba(0, 221, 251, 0.2);
	color: var(--fm-brand-cyan);
	flex-shrink: 0;
	margin-top: 3px;
}

/* ==========================================================================
   10. ARTICLE FOOTER (TAGS, SHARE, AUTHOR BOX)
   ========================================================================== */
.fm-article-footer {
	margin-top: clamp(40px, 5vw, 60px);
	padding-top: clamp(24px, 3vw, 36px);
	border-top: 1px solid var(--fm-border-subtle);
	max-width: 760px;
}

/* Tags */
.fm-article-tags {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px 12px;
	margin-bottom: 24px;
}

.fm-tags-label {
	font-size: 13.5px;
	font-weight: var(--fm-weight-semibold);
	color: var(--fm-text-muted);
}

.fm-tags-list {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.fm-tag-pill {
	display: inline-block;
	padding: 4px 10px;
	border-radius: var(--fm-radius-pill);
	background-color: var(--fm-bg-surface);
	border: 1px solid var(--fm-border-subtle);
	font-size: 12.5px;
	color: var(--fm-text-secondary);
	text-decoration: none;
	transition: all var(--fm-transition-micro);
}

.fm-tag-pill:hover {
	color: var(--fm-brand-cyan);
	border-color: var(--fm-brand-cyan);
	background-color: var(--fm-bg-surface-raised);
}

/* Bottom Share */
.fm-article-bottom-share {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 14px;
	padding: 16px 20px;
	background-color: var(--fm-bg-surface);
	border: 1px solid var(--fm-border-subtle);
	border-radius: var(--fm-radius-md);
	margin-bottom: clamp(32px, 4vw, 44px);
}

.fm-bottom-share-title {
	font-size: 14px;
	font-weight: var(--fm-weight-semibold);
	color: var(--fm-text-primary);
}

/* Author Box */
.fm-author-box {
	display: flex;
	align-items: flex-start;
	gap: 20px;
	padding: clamp(20px, 3vw, 28px);
	background-color: var(--fm-bg-surface);
	border: 1px solid var(--fm-border-subtle);
	border-radius: var(--fm-radius-lg);
	box-shadow: var(--fm-shadow-surface);
}

.fm-author-box-avatar {
	width: 64px;
	height: 64px;
	border-radius: var(--fm-radius-pill);
	overflow: hidden;
	background-color: var(--fm-bg-deep);
	border: 2px solid var(--fm-border-visible);
	flex-shrink: 0;
}

.fm-author-box-avatar img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.fm-author-box-info {
	flex: 1 1 auto;
}

.fm-author-box-role {
	display: inline-block;
	font-size: 11.5px;
	font-weight: var(--fm-weight-semibold);
	color: var(--fm-brand-cyan);
	text-transform: uppercase;
	letter-spacing: 0.04em;
	margin-bottom: 2px;
}

.fm-author-box-name {
	font-size: 17px;
	font-weight: var(--fm-weight-bold);
	color: var(--fm-text-primary);
	margin: 0 0 6px 0;
}

.fm-author-box-bio {
	font-size: 14px;
	line-height: 1.6;
	color: var(--fm-text-secondary);
	margin: 0;
}

/* ==========================================================================
   11. BOTTOM RELATED ARTICLES GRID (MATCHING DESIGN LOCK)
   ========================================================================== */
.fm-related-posts-section {
	padding-top: clamp(32px, 4vw, 48px);
	padding-bottom: clamp(48px, 6vw, 72px);
	border-top: 1px solid var(--fm-border-subtle);
}

.fm-related-posts-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 20px;
}

/* ==========================================================================
   12. TABLET & MOBILE TOC (INLINE DETAILS + FLOATING DRAWER)
   ========================================================================== */
/* Inline Collapsible Details (Near top on narrow screens) */
.fm-mobile-toc-details {
	display: none; /* Shown only on <= 1023px */
	background-color: var(--fm-bg-surface);
	border: 1px solid var(--fm-border-subtle);
	border-radius: var(--fm-radius-md);
	margin-bottom: 24px;
	overflow: hidden;
}

.fm-mobile-toc-summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 18px;
	cursor: pointer;
	font-size: 15px;
	font-weight: var(--fm-weight-semibold);
	color: var(--fm-text-primary);
	user-select: none;
	list-style: none;
}

.fm-mobile-toc-summary::-webkit-details-marker {
	display: none;
}

.fm-mobile-toc-title {
	display: inline-flex;
	align-items: center;
	gap: 8px;
}

.fm-mobile-toc-title svg {
	color: var(--fm-brand-cyan);
}

.fm-mobile-toc-chevron {
	color: var(--fm-text-muted);
	font-size: 14px;
	transition: transform var(--fm-transition-micro);
}

.fm-mobile-toc-details[open] .fm-mobile-toc-chevron {
	transform: rotate(180deg);
}

.fm-mobile-toc-content {
	padding: 0 18px 16px;
	border-top: 1px solid var(--fm-border-subtle);
}

.fm-mobile-toc-list {
	list-style: none;
	margin: 12px 0 0 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

/* Floating Bottom Button for Tablet & Mobile */
.fm-floating-toc-wrapper {
	display: none; /* Shown on <= 1023px */
	position: fixed;
	bottom: 24px;
	left: 50%;
	transform: translateX(-50%);
	z-index: 990;
}

.fm-floating-toc-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 20px;
	border-radius: var(--fm-radius-pill);
	background: var(--fm-bg-surface-raised);
	border: 1px solid var(--fm-brand-cyan);
	color: var(--fm-brand-cyan);
	font-family: var(--fm-font-primary);
	font-size: 13.5px;
	font-weight: var(--fm-weight-semibold);
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.7), var(--fm-glow-interactive);
	cursor: pointer;
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	transition: transform var(--fm-transition-micro),
	            background-color var(--fm-transition-micro);
}

.fm-floating-toc-btn:active {
	transform: scale(0.96);
}

/* Floating TOC Slide-up Drawer */
.fm-floating-toc-drawer {
	position: fixed;
	inset: 0;
	z-index: 1000;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	opacity: 0;
	pointer-events: none;
	transition: opacity var(--fm-transition-ui);
}

.fm-floating-toc-drawer.is-open {
	opacity: 1;
	pointer-events: auto;
}

.fm-drawer-backdrop {
	position: absolute;
	inset: 0;
	background-color: rgba(2, 6, 13, 0.75);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
}

.fm-drawer-panel {
	position: relative;
	width: 100%;
	max-height: 80vh;
	background-color: var(--fm-bg-surface-raised);
	border-top: 1px solid var(--fm-border-visible);
	border-radius: var(--fm-radius-xl) var(--fm-radius-xl) 0 0;
	display: flex;
	flex-direction: column;
	transform: translateY(100%);
	transition: transform var(--fm-transition-card);
	box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.8);
}

.fm-floating-toc-drawer.is-open .fm-drawer-panel {
	transform: translateY(0);
}

.fm-drawer-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 20px;
	border-bottom: 1px solid var(--fm-border-subtle);
}

.fm-drawer-title {
	font-size: 16px;
	font-weight: var(--fm-weight-bold);
	color: var(--fm-text-primary);
	margin: 0;
	display: flex;
	align-items: center;
	gap: 8px;
}

.fm-drawer-title svg {
	color: var(--fm-brand-cyan);
}

.fm-drawer-close-btn {
	background: none;
	border: none;
	color: var(--fm-text-muted);
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	padding: 4px 8px;
	border-radius: 4px;
}

.fm-drawer-close-btn:hover {
	color: var(--fm-text-primary);
}

.fm-drawer-body {
	padding: 16px 20px 32px;
	overflow-y: auto;
}

.fm-drawer-toc-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.fm-drawer-toc-link {
	display: block;
	padding: 8px 12px;
	font-size: 14.5px;
	color: var(--fm-text-secondary);
	text-decoration: none;
	border-radius: var(--fm-radius-sm);
	transition: background-color var(--fm-transition-micro);
}

.fm-toc-level-3 .fm-drawer-toc-link {
	padding-left: 24px;
	font-size: 13.5px;
	color: var(--fm-text-muted);
}

.fm-drawer-toc-link:hover,
.fm-toc-item.is-active > .fm-drawer-toc-link {
	color: var(--fm-brand-cyan);
	background-color: rgba(0, 221, 251, 0.08);
}

/* ==========================================================================
   13. RESPONSIVE BREAKPOINTS
   ========================================================================== */

/* Tablet & Mobile (<= 1023px) */
@media (max-width: 1023px) {
	.fm-article-layout {
		flex-direction: column;
		gap: 0;
	}

	.fm-article-main {
		width: 100%;
		max-width: 100%;
	}

	.fm-article-body {
		max-width: 100%;
	}

	.fm-article-footer {
		max-width: 100%;
	}

	/* Hide Desktop Sidebar */
	.fm-article-sidebar {
		display: none;
	}

	/* Show Inline Collapsible TOC Near Article Beginning */
	.fm-mobile-toc-details {
		display: block;
		background-color: var(--fm-bg-surface);
		border: 1px solid var(--fm-border-subtle);
		border-radius: var(--fm-radius-md);
		margin: 20px 0 28px;
		overflow: hidden;
	}

	.fm-mobile-toc-summary {
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 13px 16px;
		cursor: pointer;
		font-size: 15px;
		font-weight: var(--fm-weight-bold);
		color: var(--fm-text-primary);
		user-select: none;
		list-style: none;
		background-color: var(--fm-bg-surface-raised);
	}

	.fm-mobile-toc-summary::-webkit-details-marker {
		display: none;
	}

	.fm-mobile-toc-title {
		display: inline-flex;
		align-items: center;
		gap: 8px;
		color: var(--fm-text-primary);
	}

	.fm-mobile-toc-title svg {
		color: var(--fm-brand-cyan);
	}

	.fm-mobile-toc-chevron {
		color: var(--fm-text-muted);
		font-size: 14px;
		transition: transform var(--fm-transition-micro);
	}

	.fm-mobile-toc-details[open] .fm-mobile-toc-chevron {
		transform: rotate(180deg);
	}

	.fm-mobile-toc-content {
		padding: 10px 16px 14px;
		border-top: 1px solid var(--fm-border-subtle);
		background-color: var(--fm-bg-surface);
	}

	.fm-mobile-toc-list {
		list-style: none;
		margin: 0;
		padding: 0;
		display: flex;
		flex-direction: column;
		gap: 6px;
	}

	.fm-mobile-toc-list .fm-toc-link {
		display: block;
		padding: 8px 10px;
		font-size: 14px;
		line-height: 1.4;
		color: var(--fm-text-secondary);
		text-decoration: none;
		border-radius: var(--fm-radius-xs);
		transition: all var(--fm-transition-micro);
	}

	.fm-mobile-toc-list .fm-toc-level-3 .fm-toc-link {
		padding-left: 20px;
		font-size: 13px;
		color: var(--fm-text-muted);
	}

	.fm-mobile-toc-list .fm-toc-link:hover,
	.fm-mobile-toc-list .fm-toc-link:active {
		color: var(--fm-brand-cyan);
		background-color: rgba(0, 221, 251, 0.08);
	}

	/* Disable floating drawer on tablet/mobile: clean native inline details is preferred */
	.fm-floating-toc-wrapper,
	.fm-floating-toc-drawer {
		display: none !important;
	}

	/* Related Posts Grid: 2 columns on Tablet */
	.fm-related-posts-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 16px;
	}
}

/* Mobile (<= 767px) - Post Detail Mobile V1 */
@media (max-width: 767px) {
	/* Horizontal overflow prevention across all major containers */
	.fm-single-article,
	.fm-article-header-container,
	.fm-article-layout-container,
	.fm-article-main,
	.fm-article-body {
		width: 100%;
		max-width: 100vw;
		overflow-x: clip;
		box-sizing: border-box;
	}

	/* Breadcrumb: prioritize Trang chủ > Bài viết > Category, omit long title */
	.fm-breadcrumb {
		padding: 12px 0 10px;
	}

	.fm-breadcrumb-list {
		display: flex;
		align-items: center;
		flex-wrap: nowrap;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
		font-size: 12px;
		gap: 6px;
	}

	.fm-breadcrumb-list .fm-breadcrumb-sep:last-of-type,
	.fm-breadcrumb-current {
		display: none !important;
	}

	.fm-article-header-container {
		margin-bottom: 20px;
	}

	/* Compact Category Badge */
	.fm-article-badge-row {
		margin-bottom: 10px;
	}

	.fm-article-badge-row .fm-badge {
		font-size: 11px;
		padding: 3px 10px;
		font-weight: 600;
	}

	/* Mobile H1: 30–34px, line-height 1.15, natural wrapping, width 100% */
	.fm-article-title {
		font-size: clamp(30px, 7.5vw, 34px);
		line-height: 1.15;
		letter-spacing: -0.015em;
		word-wrap: break-word;
		overflow-wrap: break-word;
		hyphens: manual;
		width: 100%;
		max-width: 100%;
		margin: 0 0 14px 0;
	}

	/* Compact Excerpt: 16–17px, line-height ~1.7 */
	.fm-article-intro {
		font-size: 16px;
		line-height: 1.7;
		color: var(--fm-text-secondary);
		margin-bottom: 18px;
		max-width: 100%;
	}

	/* Metadata & Share Bar: Clean rows */
	.fm-article-meta-bar {
		display: flex;
		flex-direction: column;
		align-items: stretch;
		gap: 12px;
		padding-bottom: 14px;
		margin-bottom: 18px;
	}

	.fm-article-meta-left {
		display: flex;
		align-items: center;
		gap: 10px;
		flex-wrap: wrap;
	}

	.fm-author-avatar-wrap {
		width: 36px;
		height: 36px;
		flex-shrink: 0;
	}

	.fm-meta-details {
		display: flex;
		align-items: center;
		flex-wrap: wrap;
		gap: 6px 8px;
		font-size: 13px;
	}

	.fm-author-name {
		font-size: 14px;
		font-weight: 600;
	}

	.fm-meta-date,
	.fm-meta-time {
		font-size: 12.5px;
	}

	/* Compact Share Row: "Chia sẻ" + icons */
	.fm-article-share {
		display: flex;
		align-items: center;
		justify-content: flex-start;
		gap: 10px;
		padding-top: 10px;
		border-top: 1px solid var(--fm-border-subtle);
		width: 100%;
	}

	.fm-share-label {
		font-size: 12.5px;
		color: var(--fm-text-muted);
		flex-shrink: 0;
	}

	.fm-share-btn-group {
		display: inline-flex;
		align-items: center;
		gap: 8px;
	}

	.fm-share-btn {
		width: 34px;
		height: 34px;
	}

	/* Featured Image: 100% width, 16:9 ratio, consistent radius */
	.fm-article-featured-media {
		width: 100%;
		max-width: 100%;
		margin: 0;
		border-radius: var(--fm-radius-md);
		overflow: hidden;
		box-sizing: border-box;
	}

	.fm-featured-img {
		width: 100%;
		height: auto;
		aspect-ratio: 16 / 9;
		object-fit: cover;
		display: block;
	}

	.fm-featured-caption {
		font-size: 12px;
		padding: 8px 12px;
	}

	/* Quick Summary Container */
	.fm-quick-summary {
		padding: 16px 18px;
		margin: 20px 0;
		box-sizing: border-box;
		border-radius: var(--fm-radius-md);
	}

	.fm-summary-title {
		font-size: 16.5px;
	}

	.fm-summary-list {
		gap: 10px;
	}

	.fm-summary-list li {
		font-size: 14px;
		line-height: 1.5;
	}

	/* Article Body Typography (16–17px, line-height 1.75–1.85, width 100%) */
	.fm-article-body {
		font-size: 16.5px;
		line-height: 1.8;
		width: 100%;
		max-width: 100%;
		box-sizing: border-box;
	}

	.fm-article-body p {
		font-size: 16.5px;
		line-height: 1.8;
		margin: 0 0 20px 0;
		word-break: break-word;
		overflow-wrap: break-word;
	}

	.fm-article-body h2 {
		font-size: clamp(22px, 5.5vw, 24px);
		line-height: 1.25;
		margin-top: 32px;
		margin-bottom: 12px;
		scroll-margin-top: 76px;
		word-break: break-word;
		overflow-wrap: break-word;
	}

	.fm-article-body h3 {
		font-size: clamp(18px, 4.5vw, 20px);
		line-height: 1.3;
		margin-top: 24px;
		margin-bottom: 10px;
		scroll-margin-top: 76px;
		word-break: break-word;
		overflow-wrap: break-word;
	}

	.fm-article-body h4 {
		font-size: 16px;
		margin-top: 20px;
		margin-bottom: 8px;
		scroll-margin-top: 76px;
	}

	.fm-article-body ul,
	.fm-article-body ol {
		margin: 0 0 20px 0;
		padding-left: 20px;
		box-sizing: border-box;
	}

	.fm-article-body li {
		margin-bottom: 8px;
		line-height: 1.7;
	}

	.fm-article-body blockquote {
		margin: 20px 0;
		padding: 14px 16px;
		font-size: 15px;
		line-height: 1.6;
		box-sizing: border-box;
	}

	/* Responsive Table: Internal horizontal scroll preventing page overflow */
	.fm-article-body table {
		display: block;
		width: 100%;
		max-width: 100%;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
		word-break: normal;
		margin: 20px 0;
		font-size: 13.5px;
		box-sizing: border-box;
	}

	.fm-article-body th,
	.fm-article-body td {
		padding: 8px 10px;
		white-space: nowrap;
	}

	/* Responsive Code Blocks: Internal scroll */
	.fm-article-body pre {
		width: 100%;
		max-width: 100%;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
		box-sizing: border-box;
		padding: 14px 16px;
		margin: 20px 0;
		font-size: 13px;
		line-height: 1.55;
	}

	.fm-article-body code {
		word-break: break-word;
		overflow-wrap: break-word;
	}

	.fm-article-body pre code {
		word-break: normal;
		white-space: pre;
	}

	.fm-article-body figure {
		margin: 20px 0;
		max-width: 100%;
	}

	.fm-article-body img {
		max-width: 100%;
		height: auto;
		box-sizing: border-box;
	}

	/* Article Footer Components */
	.fm-article-footer {
		margin-top: 32px;
		padding-top: 20px;
	}

	.fm-article-tags {
		gap: 6px 8px;
		margin-bottom: 20px;
	}

	.fm-tag-pill {
		font-size: 12px;
		padding: 3px 8px;
	}

	.fm-article-bottom-share {
		flex-direction: column;
		align-items: flex-start;
		gap: 10px;
		padding: 12px 14px;
		margin-bottom: 24px;
	}

	.fm-bottom-share-title {
		font-size: 13px;
	}

	/* Author Box Mobile: Clean centered card */
	.fm-author-box {
		flex-direction: column;
		align-items: center;
		text-align: center;
		gap: 12px;
		padding: 18px 16px;
		border-radius: var(--fm-radius-md);
		box-sizing: border-box;
	}

	.fm-author-box-avatar {
		width: 56px;
		height: 56px;
	}

	.fm-author-box-name {
		font-size: 16px;
		margin-bottom: 4px;
	}

	.fm-author-box-bio {
		font-size: 13.5px;
		line-height: 1.55;
	}

	/* Related Posts Section on Mobile: Smooth horizontal swipe */
	.fm-related-posts-section {
		padding-top: 28px;
		padding-bottom: 40px;
	}

	.fm-related-posts-section .fm-section-header {
		margin-bottom: 16px;
	}

	.fm-related-posts-grid {
		display: flex;
		overflow-x: auto;
		scroll-snap-type: x mandatory;
		gap: 14px;
		padding-bottom: 12px;
		-webkit-overflow-scrolling: touch;
	}

	.fm-related-posts-grid .fm-post-card {
		flex: 0 0 260px;
		scroll-snap-align: start;
	}
}

/* Small Mobile (<= 479px, e.g. 375px - 430px) */
@media (max-width: 479px) {
	.fm-article-title {
		font-size: 30px;
		line-height: 1.15;
	}

	.fm-meta-details {
		font-size: 12.5px;
		gap: 5px 6px;
	}

	.fm-related-posts-grid .fm-post-card {
		flex: 0 0 250px;
	}
}
