/**
 * Single Post (Chi Tiết Bài Viết) Stylesheet
 * Scoped strictly to .a-single-post-page to prevent any conflicts with other pages
 *
 * @package Flatsome Child
 */

/* Main Page Container */
.a-single-post-page {
	width: 100%;
	background: #f8fafc;
	min-height: 80vh;
}

.a-single-post-page *,
.a-single-post-page *::before,
.a-single-post-page *::after {
	box-sizing: border-box;
}

.a-single-container {
	max-width: 1240px;
	margin: 0 auto;
	padding: 0px 0px 40px 0px;
}

/* Breadcrumbs */
.a-single-breadcrumbs {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
	font-size: 13.5px;
	color: #64748b;
	margin-bottom: 24px;
	line-height: 1.4;
}

.a-single-breadcrumbs a {
	color: #64748b;
	text-decoration: none;
	transition: color 0.2s ease;
}

.a-single-breadcrumbs a:hover {
	color: #2563eb;
}

.a-single-breadcrumbs .a-bc-sep {
	color: #cbd5e1;
	font-size: 12px;
}

.a-single-breadcrumbs .a-bc-current {
	color: #0f172a;
	font-weight: 500;
	max-width: 480px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* 2-Column Grid Layout */
.a-single-grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 350px;
	gap: 20px;
	align-items: start;
}

/* Left Column: Main Article */
.a-single-main-col {
	min-width: 0;
	width: 100%;
}

.a-single-article {
	background: #ffffff;
	border-radius: 5px;
	border: 1px solid #eef2f6;
	padding: 20px;
	margin-bottom: 30px;
}

/* Article Header */
.a-single-header {
	margin-bottom: 28px;
}

.a-single-title {
	font-family: inherit;
	font-size: clamp(24px, 3.8vw, 36px);
	font-weight: 800;
	line-height: 1.32;
	color: #0f172a;
	margin: 0 0 18px 0;
	letter-spacing: -0.02em;
	word-break: break-word;
}

/* Meta Bar */
.a-single-meta {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 12px;
	padding-bottom: 22px;
	border-bottom: 1px solid #f1f5f9;
	color: #64748b;
	font-size: 13.5px;
}

.a-meta-item {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.a-meta-author {
	color: #1e293b;
	font-weight: 600;
}

.a-meta-avatar {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	object-fit: cover;
	border: 1.5px solid #e2e8f0;
}

.a-meta-icon {
	width: 14px;
	height: 14px;
	stroke: #64748b;
	flex-shrink: 0;
}

.a-meta-divider {
	color: #cbd5e1;
	font-size: 12px;
}

/* Hero / Featured Image */
.a-single-featured-image {
	position: relative;
	border-radius: 5px;
	overflow: hidden;
	margin-bottom: 10px;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
	background: #0f172a;
}

.a-featured-img {
	width: 100%;
	max-height: 500px;
	object-fit: cover;
	display: block;
}

.a-featured-caption {
	padding: 8px 14px;
	font-size: 13px;
	font-style: italic;
	color: #94a3b8;
	text-align: center;
	background: #f8fafc;
	border-top: 1px solid #f1f5f9;
}

/* Article Content Typography */
.a-single-entry-content {
	font-size: 16.5px;
	line-height: 1.85;
	color: #334155;
	word-break: break-word;
}

.a-single-entry-content>*:first-child {
	margin-top: 0;
}

.a-single-entry-content p {
	margin-bottom: 22px;
	line-height: 1.85;
	color: #334155;
}

.a-single-entry-content h1,
.a-single-entry-content h2,
.a-single-entry-content h3,
.a-single-entry-content h4,
.a-single-entry-content h5,
.a-single-entry-content h6 {
	color: #0f172a;
	font-family: inherit;
	line-height: 1.35;
	letter-spacing: -0.01em;
}

.a-single-entry-content h2 {
	font-size: 24px;
	font-weight: 700;
	margin-top: 38px;
	margin-bottom: 18px;
	border-left: 4px solid #2563eb;
	padding-left: 14px;
}

.a-single-entry-content h3 {
	font-size: 20px;
	font-weight: 600;
	margin-top: 30px;
	margin-bottom: 14px;
}

.a-single-entry-content h4 {
	font-size: 17px;
	font-weight: 600;
	margin-top: 24px;
	margin-bottom: 12px;
}

.a-single-entry-content a {
	color: #2563eb;
	text-decoration: underline;
	text-underline-offset: 3px;
	transition: color 0.2s ease;
}

.a-single-entry-content a:hover {
	color: #1d4ed8;
}

.a-single-entry-content blockquote {
	margin: 28px 0;
	padding: 20px 24px;
	background: #f8fafc;
	border-left: 4px solid #2563eb;
	border-radius: 0 12px 12px 0;
	font-style: italic;
	font-size: 16.5px;
	color: #1e293b;
	line-height: 1.75;
}

.a-single-entry-content blockquote p:last-child {
	margin-bottom: 0;
}

.a-single-entry-content ul,
.a-single-entry-content ol {
	margin-bottom: 22px;
	padding-left: 26px;
	line-height: 1.8;
}

.a-single-entry-content li {
	margin-bottom: 8px;
}

.a-single-entry-content img {
	max-width: 100%;
	height: auto;
	border-radius: 10px;
	margin: 20px 0;
}

.a-single-entry-content table {
	width: 100%;
	border-collapse: collapse;
	margin: 26px 0;
	font-size: 15px;
}

.a-single-entry-content table th,
.a-single-entry-content table td {
	padding: 12px 16px;
	border: 1px solid #e2e8f0;
	text-align: left;
}

.a-single-entry-content table th {
	background: #f8fafc;
	font-weight: 600;
	color: #0f172a;
}

/* Tags Box */
.a-single-tags {
	margin-top: 36px;
	padding-top: 22px;
	border-top: 1px solid #f1f5f9;
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
}

.a-tags-label {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 13.5px;
	font-weight: 600;
	color: #64748b;
	margin-right: 4px;
}

.a-tags-label svg {
	width: 15px;
	height: 15px;
}

.a-single-tags a {
	display: inline-block;
	background: #f1f5f9;
	color: #475569;
	font-size: 12.5px;
	font-weight: 500;
	padding: 5px 12px;
	border-radius: 6px;
	text-decoration: none;
	transition: all 0.2s ease;
}

.a-single-tags a:hover {
	background: #2563eb;
	color: #ffffff;
}

/* Social Share Bar */
.a-single-share-box {
	padding: 16px 20px;
	background: #f8fafc;
	border-radius: 5px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 12px;
}

.a-share-title {
	font-size: 14px;
	font-weight: 600;
	color: #1e293b;
}

.a-share-links {
	display: flex;
	align-items: center;
	gap: 10px;
}

.a-share-btn {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: #ffffff;
	border: none;
	cursor: pointer;
	text-decoration: none;
	transition: transform 0.2s ease, opacity 0.2s ease;
}

.a-share-btn:hover {
	transform: translateY(-2px);
	opacity: 0.9;
	color: #ffffff;
}

.a-share-btn svg {
	width: 17px;
	height: 17px;
}

.a-share-btn.fb {
	background: #1877f2;
}

.a-share-btn.in {
	background: #0a66c2;
}

/* Author Box */
.a-single-author-card {
	margin-top: 36px;
	padding: 24px 28px;
	background: #f8fafc;
	border: 1px solid #eef2f6;
	border-radius: 14px;
	display: flex;
	align-items: center;
	gap: 20px;
}

.a-author-avatar-wrap {
	flex-shrink: 0;
}

.a-author-avatar {
	width: 64px;
	height: 64px;
	border-radius: 50%;
	object-fit: cover;
	border: 3px solid #ffffff;
	box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
	display: block;
}

.a-author-info {
	flex: 1;
	min-width: 0;
}

.a-author-tag {
	font-size: 11.5px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: #2563eb;
	display: block;
	margin-bottom: 3px;
}

.a-author-heading {
	margin: 0 0 6px 0;
	font-size: 17px;
	font-weight: 700;
	color: #0f172a;
}

.a-author-bio {
	margin: 0;
	font-size: 13.5px;
	color: #64748b;
	line-height: 1.5;
}

/* Prev / Next Navigation Cards */
.a-single-nav-cards {
	margin-top: 32px;
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
}

.a-nav-card {
	padding: 18px 20px;
	border-radius: 5px;
	border: 1px solid #e2e8f0;
	background: #ffffff;
	text-decoration: none !important;
	display: flex;
	flex-direction: column;
	justify-content: center;
	transition: all 0.25s ease;
}

.a-nav-card.next {
	text-align: right;
}

.a-nav-card:hover {
	border-color: #2563eb;
}

.a-nav-direction {
	font-size: 12px;
	font-weight: 700;
	color: #2563eb;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	margin-bottom: 4px;
}

.a-nav-title {
	font-size: 14px;
	font-weight: 600;
	color: #1e293b;
	line-height: 1.4;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.a-nav-card:hover .a-nav-title {
	color: #2563eb;
}

/* Comments Section */
.a-single-comments {
	margin-top: 20px;
	padding-top: 20px;
	border-top: 1px solid #eef2f6;
}

/* Right Column: Sidebar */
.a-single-sidebar-col {
	width: 100%;
}

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

/* Sidebar Recent Posts Widget (Dark Tech Signature Widget) */
.a-sidebar-recent-posts {
	background: #ffffff;
	border-radius: 5px;
	border: 1px solid #eef2f6;
	padding: 22px 20px;
	width: 100%;
}

.a-sidebar-widget-header {
	margin-bottom: 12px;
}

.a-sidebar-widget-title {
	margin: 0;
	padding: 0;
	font-family: inherit;
	font-size: 15px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: #3b82f6;
	line-height: 1.3;
}

.a-sidebar-post-list {
	display: flex;
	flex-direction: column;
	width: 100%;
}

.a-sidebar-post-item {
	display: flex;
	flex-direction: row;
	align-items: flex-start;
	gap: 12px;
	padding: 12px 0;
	border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.a-sidebar-post-item:first-child {
	padding-top: 4px;
}

.a-sidebar-post-thumb {
	flex: 0 0 88px;
	width: 88px;
	height: 58px;
	border-radius: 4px;
	overflow: hidden;
	background: #0d1527;
	position: relative;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

.a-sidebar-post-thumb a {
	display: block;
	width: 100%;
	height: 100%;
}

.a-sidebar-thumb-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.35s ease, filter 0.35s ease;
}

.a-sidebar-post-item:hover .a-sidebar-thumb-img {
	transform: scale(1.06);
	filter: brightness(1.08);
}

.a-sidebar-thumb-fallback {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(135deg, #0d1527 0%, #152238 100%);
	color: #475569;
}

.a-sidebar-thumb-fallback svg {
	width: 22px;
	height: 22px;
	stroke: currentColor;
	opacity: 0.6;
}

.a-sidebar-post-info {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 5px;
}

.a-sidebar-post-title {
	margin: 0;
	padding: 0;
	font-family: inherit;
	font-size: 13.5px;
	font-weight: 600;
	line-height: 1.38;
}

.a-sidebar-post-title a {
	color: #000;
	text-decoration: none !important;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	text-overflow: ellipsis;
	word-break: break-word;
	transition: color 0.2s ease;
}

.a-sidebar-post-item:hover .a-sidebar-post-title a {
	color: #60a5fa;
}

.a-sidebar-post-date {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	font-size: 11.5px;
	color: #64748b;
	line-height: 1;
}

.a-sidebar-calendar-icon {
	width: 12px;
	height: 12px;
	stroke: #64748b;
	flex-shrink: 0;
}

.a-sidebar-widget-footer {
	margin-top: 4px;
	padding-top: 14px;
	border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.a-sidebar-view-all {
	display: flex;
	align-items: center;
	justify-content: space-between;
	text-decoration: none !important;
	color: #3b82f6;
	font-size: 14px;
	font-weight: 700;
	letter-spacing: 0.5px;
	text-transform: none;
	line-height: 1;
	transition: color 0.2s ease;
}

.a-sidebar-view-all:hover {
	color: #60a5fa;
}

.a-sidebar-view-all svg {
	width: 13px;
	height: 13px;
	stroke: currentColor;
	transition: transform 0.25s ease;
}

.a-sidebar-view-all:hover svg {
	transform: translateX(4px);
}

.a-sidebar-empty {
	padding: 16px 0;
	font-size: 13px;
	color: #64748b;
	text-align: center;
	margin: 0;
}

/* Categories Widget */
.a-sidebar-categories {
	background: #ffffff;
	border-radius: 5px;
	border: 1px solid #eef2f6;
	padding: 22px 20px;
}

.a-sidebar-categories .a-sidebar-widget-title {
	color: #0f172a;
	padding-bottom: 10px;
}

.a-sidebar-cat-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.a-sidebar-cat-item {
	margin: 0;
	padding: 0;
	border-bottom: 1px dashed #e2e8f0;
}

.a-sidebar-cat-item:last-child {
	border-bottom: none;
}

.a-sidebar-cat-item a {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 11px 4px;
	text-decoration: none !important;
	color: #334155;
	font-size: 16px;
	font-weight: 500;
	transition: all 0.2s ease;
}

.a-sidebar-cat-item a:hover {
	color: #2563eb;
}

.a-cat-count {
	background: #f1f5f9;
	color: #64748b;
	font-size: 11.5px;
	font-weight: 600;
	padding: 2px 8px;
	border-radius: 12px;
	transition: all 0.2s ease;
}

.a-sidebar-cat-item a:hover .a-cat-count {
	background: #2563eb;
	color: #ffffff;
}

/* ====================================================
   EXCERPT / SA-PÔ TÓM TẮT BÀI VIẾT
   ==================================================== */
.a-single-excerpt {
	background: #f8fafc;
	border-left: 4px solid var(--primary-color, #2563eb);
	border-radius: 0 10px 10px 0;
	padding: 18px 22px;
	margin-bottom: 28px;
	font-size: 16.5px;
	font-weight: 500;
	line-height: 1.7;
	color: #1e293b;
}

.a-single-excerpt p:last-child {
	margin-bottom: 0;
}

/* ====================================================
   TABLE OF CONTENTS (MỤC LỤC BÀI VIẾT)
   ==================================================== */
.a-toc-box {
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	padding: 18px 22px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.a-toc-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding-bottom: 12px;
	border-bottom: 1px dashed #cbd5e1;
}

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

.a-toc-icon {
	width: 18px;
	height: 18px;
	stroke: var(--primary-color, #2563eb);
}

.a-toc-title {
	font-size: 15px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: #0f172a;
}

.a-toc-toggle-btn {
	background: #ffffff;
	border: 1px solid #e2e8f0;
	width: 40px;
	height: 32px;
	padding: 0;
	border-radius: 8px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	color: #64748b;
	transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
	margin: 0px !important;
}

.a-toc-toggle-btn:hover {
	color: var(--primary-color, #2563eb);
	border-color: var(--primary-color, #2563eb);
	background: #f8fafc;
	transform: translateY(-1px);
	box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
}

.a-toc-toggle-icon {
	width: 16px;
	height: 16px;
	stroke: currentColor;
	transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
	transform: rotate(180deg);
	/* Mặc định đang mở: mũi tên hướng lên */
}

/* Khi đang thu gọn (aria-expanded="false"): mũi tên hướng xuống */
.a-toc-toggle-btn[aria-expanded="false"] .a-toc-toggle-icon {
	transform: rotate(0deg);
}

.a-toc-list-wrap {
	margin-top: 14px;
}

.a-toc-list {
	margin: 0 !important;
	padding-left: 20px !important;
	list-style: decimal !important;
}

.a-toc-item {
	margin-bottom: 8px !important;
	line-height: 1.5;
}

.a-toc-item:last-child {
	margin-bottom: 0 !important;
}

.a-toc-item a {
	color: #334155 !important;
	text-decoration: none !important;
	font-size: 14.5px;
	font-weight: 500;
	transition: color 0.2s ease;
}

.a-toc-item a:hover {
	color: var(--primary-color, #2563eb) !important;
	text-decoration: underline !important;
}

.a-toc-h3 {
	margin-left: 20px !important;
	list-style: circle !important;
}

.a-toc-h3 a {
	font-size: 13.5px;
	color: #64748b !important;
}

/* ====================================================
   BÀI VIẾT CÙNG CHỦ ĐỀ (RELATED POSTS)
   ==================================================== */
.a-single-related-section {
	margin-top: 48px;
	padding-top: 36px;
	border-top: 2px solid #f1f5f9;
}

.a-related-header {
	margin-bottom: 22px;
}

.a-related-title {
	font-size: 22px;
	font-weight: 700;
	color: #0f172a;
	margin: 0 0 6px 0;
	letter-spacing: -0.01em;
}

.a-related-subtitle {
	font-size: 14px;
	color: #64748b;
	margin: 0;
}

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

.a-related-card {
	background: #ffffff;
	border: 1px solid #eef2f6;
	border-radius: 12px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	text-decoration: none !important;
	transition: all 0.25s ease;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.a-related-card:hover {
	border-color: var(--primary-color, #2563eb);
	box-shadow: 0 8px 24px rgba(37, 99, 235, 0.08);
	transform: translateY(-3px);
}

.a-related-thumb-wrap {
	position: relative;
	width: 100%;
	padding-top: 60%;
	background: #0f172a;
	overflow: hidden;
}

.a-related-thumb-img {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.3s ease;
}

.a-related-card:hover .a-related-thumb-img {
	transform: scale(1.05);
}

.a-related-thumb-fallback {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: #f1f5f9;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #cbd5e1;
}

.a-related-thumb-fallback svg {
	width: 32px;
	height: 32px;
}

.a-related-body {
	padding: 16px;
	display: flex;
	flex-direction: column;
	flex: 1;
}

.a-related-meta-top {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 12px;
	color: #94a3b8;
	margin-bottom: 8px;
}

.a-related-cat {
	color: var(--primary-color, #2563eb);
	font-weight: 600;
	text-transform: uppercase;
	font-size: 11px;
	letter-spacing: 0.3px;
}

.a-related-post-title {
	font-size: 14.5px;
	font-weight: 600;
	color: #0f172a;
	line-height: 1.45;
	margin: 0;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	transition: color 0.2s ease;
}

.a-related-card:hover .a-related-post-title {
	color: var(--primary-color, #2563eb);
}

@media (max-width: 768px) {
	.a-related-grid {
		grid-template-columns: 1fr;
	}
}

/* Responsive */
@media (max-width: 992px) {
	.a-single-grid {
		grid-template-columns: 1fr;
		gap: 36px;
	}

	.a-single-sidebar-inner {
		position: static;
	}

	.a-single-article {
		padding: 30px 24px;
	}
}

@media (max-width: 576px) {
	.a-single-container {
		padding: 0px 14px 20px 14px;
	}

	.a-single-article {
		padding: 22px 16px;
		border-radius: 12px;
	}

	.a-single-title {
		font-size: 22px;
	}

	.a-single-meta {
		font-size: 12.5px;
		gap: 8px;
	}

	.a-single-nav-cards {
		grid-template-columns: 1fr;
	}

	.a-nav-card.next {
		text-align: left;
	}

	.a-single-author-card {
		flex-direction: column;
		text-align: center;
		padding: 20px 16px;
	}

	.a-single-breadcrumbs .a-bc-current {
		max-width: 180px;
	}
}