/* Trang chi tiết bài viết — Entra City
 * Lưu ý font: Mona Sans của theme chỉ có 1 weight (200 ExtraLight) nên in đậm bị "faux bold",
 * bài dài đọc mệt. Nội dung bài dùng Montserrat (đã load từ Google Fonts, đủ 100–900 + tiếng Việt).
 * Tiêu đề giữ font thương hiệu (1FTV Eleanor Goenka) nhưng weight 400 vì font chỉ có 1 weight.
 * html gốc = 14px nên dùng px cho cỡ chữ bài viết.
 */

.single__post {
	--ec-red: var(--color-red, #540000);
	--ec-cream: var(--color-yellow, #f0cdab);
	--ec-ink: #2a2522;
	--ec-muted: #7b6f66;
	--ec-line: #eadfd4;
	--ec-soft: #fbf6f1;
	--ec-font: Montserrat, "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	position: relative;
	background: #fff;
}

/* Lớp phủ tối phía trên ảnh để menu (header fixed, trong suốt) luôn đọc được */
.single__post::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 180px;
	background: linear-gradient(180deg, rgba(0, 0, 0, .55), rgba(0, 0, 0, 0));
	pointer-events: none;
	z-index: 1;
}

.single__post-thumbnail {
	display: block;
	height: clamp(360px, 42vw, 560px);
	object-fit: cover;
	object-position: center;
}

/* ---------- Header bài ---------- */
.single__post > .container {
	max-width: 1000px;
	padding-top: 56px !important;
	padding-bottom: 64px !important;
}

.single__post .single__post-title {
	width: 100% !important;
	max-width: 860px;
	margin: 0 auto 18px !important;
	color: var(--ec-red);
	font-family: var(--font-title), Georgia, serif;
	font-size: clamp(28px, 2.9vw, 42px) !important;
	font-weight: 400 !important;
	line-height: 1.28 !important;
	letter-spacing: 0;
	text-wrap: balance;
}

.single__post-meta {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	gap: 8px 12px;
	margin-bottom: 36px !important;
	padding-bottom: 28px;
	border-bottom: 1px solid var(--ec-line);
	color: var(--ec-muted);
	font-family: var(--ec-font);
	font-size: 14px;
	font-weight: 500;
}

.single__post-meta .single__post-cat {
	display: inline-block;
	padding: 5px 12px;
	border-radius: 999px;
	background: var(--ec-soft);
	border: 1px solid var(--ec-cream);
	color: var(--ec-red);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: .06em;
	line-height: 1.2;
	text-transform: uppercase;
}

.single__post-meta .single__post-sep {
	width: 4px;
	height: 4px;
	border-radius: 50%;
	background: currentColor;
	opacity: .5;
}

/* ---------- Nội dung ---------- */
.single__post-detail {
	max-width: 740px;
	margin: 0 auto;
	color: var(--ec-ink);
	font-family: var(--ec-font);
	font-size: 17px;
	font-weight: 400;
	line-height: 1.8;
	overflow-wrap: break-word;
	-webkit-font-smoothing: antialiased;
}

.single__post-detail > *:first-child {
	margin-top: 0;
}

.single__post-detail > *:last-child {
	margin-bottom: 0;
}

.single__post-detail p {
	margin: 0 0 20px;
}

.single__post-detail strong,
.single__post-detail b {
	color: #1c1917;
	font-weight: 600;
}

.single__post-detail em {
	font-style: italic;
}

.single__post-detail .ec-lead {
	margin: 0 0 32px;
	padding: 0 0 0 20px;
	border-left: 3px solid var(--ec-red);
	color: #3b302a;
	font-size: 19px;
	font-weight: 500;
	line-height: 1.7;
}

.single__post-detail .ec-lead strong,
.single__post-detail .ec-lead b {
	font-weight: 500;
}

.single__post-detail h2,
.single__post-detail h3,
.single__post-detail h4 {
	font-family: var(--ec-font);
	letter-spacing: -.005em;
	text-wrap: balance;
}

.single__post-detail h2 {
	margin: 44px 0 16px;
	color: var(--ec-red);
	font-size: 24px;
	font-weight: 700;
	line-height: 1.35;
}

.single__post-detail h2::before {
	content: "";
	display: block;
	width: 36px;
	height: 3px;
	margin-bottom: 14px;
	border-radius: 3px;
	background: var(--ec-cream);
}

.single__post-detail h3 {
	margin: 32px 0 10px;
	color: #3b1d14;
	font-size: 19px;
	font-weight: 700;
	line-height: 1.4;
}

.single__post-detail a {
	color: var(--ec-red);
	font-weight: 500;
	text-decoration: underline;
	text-decoration-color: rgba(84, 0, 0, .3);
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
	transition: text-decoration-color .15s;
}

.single__post-detail a:hover {
	text-decoration-color: currentColor;
}

/* Danh sách */
.single__post-detail ul,
.single__post-detail ol {
	margin: 0 0 24px;
	padding-left: 22px;
}

.single__post-detail li {
	margin-bottom: 8px;
	padding-left: 4px;
}

.single__post-detail li::marker {
	color: var(--ec-red);
	font-weight: 600;
}

/* ---------- Ảnh ---------- */
.single__post-detail figure,
.single__post-detail .ec-figure {
	margin: 32px 0;
}

.single__post-detail img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 10px;
	background: var(--ec-soft);
}

.single__post-detail figcaption,
.single__post-detail .ec-caption-center {
	margin: 10px auto 0;
	max-width: 620px;
	color: var(--ec-muted);
	font-size: 14px;
	font-style: normal;
	line-height: 1.55;
	text-align: center;
}

.single__post-detail .ec-gallery {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px;
	margin: 32px 0 0;
}

.single__post-detail .ec-gallery + :not(.ec-caption-center) {
	margin-top: 32px;
}

.single__post-detail .ec-gallery .ec-figure,
.single__post-detail .ec-gallery figure {
	margin: 0;
}

.single__post-detail .ec-gallery img {
	aspect-ratio: 4 / 3;
	object-fit: cover;
}

/* Gallery số lẻ: ảnh đầu full width */
.single__post-detail .ec-gallery > :first-child:nth-last-child(odd):not(:only-child) {
	grid-column: 1 / -1;
}

.single__post-detail .ec-gallery > :first-child:nth-last-child(odd):not(:only-child) img {
	aspect-ratio: 16 / 9;
}

.single__post-detail .ec-gallery + .ec-caption-center {
	margin-bottom: 32px;
}

/* ---------- Trích dẫn ---------- */
.single__post-detail blockquote {
	position: relative;
	margin: 36px 0;
	padding: 24px 28px 22px 64px;
	border: 0;
	border-radius: 12px;
	background: var(--ec-soft);
	color: #3b302a;
	font-size: 18px;
	font-style: italic;
	font-weight: 500;
	line-height: 1.65;
}

.single__post-detail blockquote::before {
	content: "\201C";
	position: absolute;
	top: 14px;
	left: 20px;
	color: var(--ec-red);
	font-family: Georgia, serif;
	font-size: 56px;
	font-style: normal;
	line-height: 1;
	opacity: .35;
}

.single__post-detail blockquote p {
	margin-bottom: 10px;
}

.single__post-detail blockquote p:last-of-type {
	margin-bottom: 0;
}

.single__post-detail blockquote cite {
	display: block;
	margin-top: 12px;
	color: var(--ec-muted);
	font-size: 14px;
	font-style: normal;
	font-weight: 600;
}

.single__post-detail blockquote cite::before {
	content: "— ";
}

/* ---------- Bảng thông số ---------- */
.single__post-detail table {
	width: 100%;
	margin: 28px 0 32px;
	border-collapse: separate;
	border-spacing: 0;
	overflow: hidden;
	border: 1px solid var(--ec-line);
	border-radius: 12px;
	font-size: 15px;
	line-height: 1.6;
}

.single__post-detail table caption {
	caption-side: top;
	padding: 0 0 10px;
	color: var(--ec-red);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: .06em;
	text-align: left;
	text-transform: uppercase;
}

.single__post-detail th,
.single__post-detail td {
	padding: 12px 16px;
	border-bottom: 1px solid var(--ec-line);
	vertical-align: top;
	text-align: left;
}

.single__post-detail tr:last-child th,
.single__post-detail tr:last-child td {
	border-bottom: 0;
}

.single__post-detail .ec-facts th {
	width: 32%;
	background: var(--ec-soft);
	color: #5a3526;
	font-weight: 600;
}

.single__post-detail .ec-facts td {
	color: var(--ec-ink);
}

/* ---------- Timeline ---------- */
.single__post-detail .ec-timeline {
	position: relative;
	margin: 24px 0 32px;
	padding: 0;
	list-style: none;
}

.single__post-detail .ec-timeline::before {
	content: "";
	position: absolute;
	top: 10px;
	bottom: 10px;
	left: 6px;
	width: 2px;
	background: var(--ec-line);
}

.single__post-detail .ec-timeline li {
	position: relative;
	margin-bottom: 20px;
	padding-left: 32px;
}

.single__post-detail .ec-timeline li:last-child {
	margin-bottom: 0;
}

.single__post-detail .ec-timeline li::before {
	content: "";
	position: absolute;
	top: 8px;
	left: 0;
	width: 14px;
	height: 14px;
	border: 3px solid #fff;
	border-radius: 50%;
	background: var(--ec-red);
	box-shadow: 0 0 0 1.5px var(--ec-cream);
}

.single__post-detail .ec-timeline__date {
	display: block;
	margin-bottom: 2px;
	color: var(--ec-red);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: .06em;
	text-transform: uppercase;
}

/* ---------- Ghi chú + nguồn ---------- */
.single__post-detail .ec-note {
	margin: 28px 0;
	padding: 16px 20px;
	border-radius: 10px;
	background: var(--ec-soft);
	color: #5a4a3c;
	font-size: 15px;
	line-height: 1.65;
}

.single__post-detail .ec-source {
	margin-top: 40px;
	padding-top: 18px;
	border-top: 1px solid var(--ec-line);
	color: var(--ec-muted);
	font-size: 14px;
	font-style: normal;
	line-height: 1.6;
}

.single__post-detail .ec-source a {
	font-weight: 500;
}

/* ---------- Tablet ---------- */
@media (max-width: 991px) {
	.single__post-thumbnail {
		height: clamp(300px, 52vw, 460px);
	}

	.single__post > .container {
		padding-top: 40px !important;
		padding-bottom: 48px !important;
	}
}

/* ---------- Mobile ---------- */
@media (max-width: 767px) {
	.single__post::before {
		height: 140px;
	}

	.single__post-thumbnail {
		height: 300px;
	}

	.single__post > .container {
		padding-left: 20px;
		padding-right: 20px;
		padding-top: 28px !important;
		padding-bottom: 40px !important;
	}

	.single__post .single__post-title {
		margin-bottom: 14px !important;
		font-size: 26px !important;
		line-height: 1.3 !important;
		text-align: left !important;
	}

	.single__post-meta {
		justify-content: flex-start;
		margin-bottom: 24px !important;
		padding-bottom: 20px;
		font-size: 13px;
	}

	.single__post-detail {
		font-size: 16px;
		line-height: 1.75;
	}

	.single__post-detail p {
		margin-bottom: 18px;
	}

	.single__post-detail .ec-lead {
		margin-bottom: 26px;
		padding-left: 14px;
		font-size: 17px;
		line-height: 1.65;
	}

	.single__post-detail h2 {
		margin-top: 36px;
		font-size: 20px;
	}

	.single__post-detail h2::before {
		margin-bottom: 12px;
	}

	.single__post-detail h3 {
		margin-top: 26px;
		font-size: 17px;
	}

	.single__post-detail figure,
	.single__post-detail .ec-figure {
		margin: 24px 0;
	}

	/* Ảnh tràn sát mép màn hình cho cảm giác rộng */
	.single__post-detail > figure,
	.single__post-detail > .ec-figure,
	.single__post-detail > .ec-gallery {
		margin-left: -20px;
		margin-right: -20px;
	}

	.single__post-detail > figure img,
	.single__post-detail > .ec-figure img,
	.single__post-detail > .ec-gallery img {
		border-radius: 0;
	}

	.single__post-detail > figure figcaption,
	.single__post-detail > .ec-figure figcaption {
		padding: 0 20px;
	}

	.single__post-detail .ec-gallery {
		gap: 4px;
	}

	.single__post-detail figcaption,
	.single__post-detail .ec-caption-center {
		font-size: 13px;
	}

	.single__post-detail blockquote {
		margin: 28px 0;
		padding: 20px 18px 18px 46px;
		font-size: 16px;
	}

	.single__post-detail blockquote::before {
		top: 12px;
		left: 12px;
		font-size: 44px;
	}

	.single__post-detail table {
		font-size: 14px;
	}

	.single__post-detail th,
	.single__post-detail td {
		padding: 10px 12px;
	}

	.single__post-detail .ec-facts th {
		width: 38%;
	}
}

@media (max-width: 480px) {
	/* Bảng thông số xếp dọc: nhãn trên, giá trị dưới */
	.single__post-detail .ec-facts,
	.single__post-detail .ec-facts tbody,
	.single__post-detail .ec-facts tr,
	.single__post-detail .ec-facts th,
	.single__post-detail .ec-facts td {
		display: block;
		width: 100%;
	}

	.single__post-detail .ec-facts th {
		padding: 10px 14px 2px;
		border-bottom: 0;
		background: transparent;
		color: var(--ec-muted);
		font-size: 12px;
		font-weight: 600;
		letter-spacing: .05em;
		text-transform: uppercase;
	}

	.single__post-detail .ec-facts td {
		padding: 0 14px 10px;
		font-weight: 500;
	}

	.single__post-detail .ec-facts tr:not(:last-child) td {
		border-bottom: 1px solid var(--ec-line);
	}
}
