/* ========================================================================
 * Chi tiết bài viết (single.php)
 * Khung 1126px: cột nội dung 70% + cột bài liên quan 30%, cách nhau 70px.
 * ====================================================================== */

.post-layout {
	--post-gap: 70px;

	display: grid;
	grid-template-columns: minmax(0, 7fr) minmax(0, 3fr);
	align-items: start;
	gap: var(--post-gap);
	width: min(100% - 2 * var(--page-gutter), 1126px);
	margin-inline: auto;
	padding-block: var(--space-xl) var(--section-space);
}

/* ------------------------------------------------------------------------
 * Cột trái: bài viết
 * ---------------------------------------------------------------------- */
.post__head {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: var(--space-xs);
}

.post__tag {
	padding: 0.3em 2.5em 0.3em 0.6em;
	background: linear-gradient(90deg, var(--color-heading) 55%, transparent);
	color: var(--color-white);
	font-size: var(--fs-xs);
	font-weight: var(--fw-bold);
	letter-spacing: 0.03em;
	text-transform: uppercase;
	transition: filter var(--duration) var(--ease);
}

.post__tag:hover {
	filter: brightness(1.08);
}

.post__title {
	font-family: var(--font-body);
	font-size: clamp(1.625rem, 1.0536rem + 0.8929vw, 2.25rem); /* 26 → 36 */
	font-weight: var(--fw-bold);
	line-height: 1.25;
}

.post__date {
	color: var(--color-gray-light);
	font-size: var(--fs-sm);
}

.post__date::before {
	content: "◆ ";
}

.post__thumb {
	margin: var(--space-md) 0 0;
	overflow: hidden;
	border-radius: var(--radius-lg);
}

.post__thumb-img {
	width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
}

/* Nội dung bài (trình soạn thảo WordPress) */
.post__content {
	margin-top: var(--space-md);
	color: var(--color-brown-dark);
	font-size: var(--fs-md);
	font-weight: var(--fw-regular);
	line-height: 1.7;
	overflow-wrap: break-word;
}

.post__content > * + * {
	margin-top: 1em;
}

.post__content :is(p, ul, ol, figure, blockquote) {
	margin-bottom: 0;
}

.post__content :is(h2, h3, h4) {
	margin-top: 1.6em;
	font-family: var(--font-body);
	font-weight: var(--fw-bold);
	line-height: 1.3;
}

.post__content h2 {
	font-size: 1.4em;
}

.post__content h3 {
	font-size: 1.2em;
}

.post__content h4 {
	font-size: 1.05em;
}

.post__content strong {
	font-weight: var(--fw-semibold);
}

.post__content a {
	color: var(--color-heading);
	text-decoration: underline;
	text-underline-offset: 0.15em;
}

.post__content :is(ul, ol) {
	padding-left: 1.4em;
}

.post__content li + li {
	margin-top: 0.35em;
}

.post__content li::marker {
	color: var(--color-heading);
}

.post__content blockquote {
	margin-inline: 0;
	padding: 0.2em 0 0.2em 1.2em;
	border-left: 3px solid var(--color-heading);
	font-style: italic;
}

.post__content figure {
	margin-inline: 0;
}

.post__content img {
	max-width: 100%;
	height: auto;
	margin-inline: auto;
	border-radius: var(--radius-sm);
}

.post__content figcaption {
	margin-top: 0.6em;
	color: var(--color-gray);
	font-size: var(--fs-sm);
	font-style: italic;
	line-height: 1.5;
	text-align: center;
}

.post__content table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.9em;
}

.post__content :is(th, td) {
	padding: 0.5em 0.75em;
	border: 1px solid #ecd2c2;
	text-align: left;
}

/* ------------------------------------------------------------------------
 * Cột phải: bài cùng danh mục (dính theo khi cuộn)
 * ---------------------------------------------------------------------- */
.post-aside {
	position: sticky;
	top: calc(var(--header-height) + var(--wp-admin--admin-bar--height, 0px) + 1rem);
}

.post-aside__title {
	padding-bottom: 0.6em;
	border-bottom: 2px solid var(--color-heading);
	font-family: var(--font-body);
	font-size: var(--fs-lg);
	font-weight: var(--fw-bold);
	text-transform: uppercase;
}

.post-aside__list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.post-aside__list li {
	border-bottom: 1px solid #ecd2c2;
}

.post-aside__item {
	display: grid;
	grid-template-columns: 6.5rem minmax(0, 1fr);
	align-items: start;
	gap: 0.875rem;
	padding-block: 1rem;
}

.post-aside__media {
	aspect-ratio: 4 / 3;
	overflow: hidden;
	border-radius: var(--radius-sm);
	background: #f6efe9;
}

.post-aside__image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 600ms var(--ease);
}

.post-aside__item:hover .post-aside__image {
	transform: scale(1.06);
}

.post-aside__body {
	display: flex;
	flex-direction: column;
	gap: 0.35em;
}

.post-aside__name {
	display: -webkit-box;
	overflow: hidden;
	color: var(--color-brown-dark);
	font-size: var(--fs-sm);
	font-weight: var(--fw-semibold);
	line-height: 1.4;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
	transition: color var(--duration) var(--ease);
}

.post-aside__item:hover .post-aside__name {
	color: var(--color-heading);
}

.post-aside__date {
	color: var(--color-gray-light);
	font-size: var(--fs-xs);
}

/* ------------------------------------------------------------------------
 * Dưới 1024px: một cột, danh sách bài nằm dưới nội dung
 * ---------------------------------------------------------------------- */
@media (max-width: 1023.98px) {
	.post-layout {
		grid-template-columns: minmax(0, 1fr);
		gap: var(--space-2xl);
	}

	.post-aside {
		position: static;
	}
}

@media (max-width: 599.98px) {
	.post-layout {
		width: calc(100% - 2rem);
	}
}
