/**
 * Giao diện blog VCE — Lớp 4.
 * Mọi giá trị thị giác lấy từ biến trong vce-theme.css.
 * Tiền tố vv- và khai báo tường minh để RealHome/BetterDocs không đá vào.
 */

/* ================= Archive ================= */

.vv-archive {
	background: var(--vv-surface-alt);
	padding: var(--vv-gap-xl) var(--vv-gap);
}

.vv-archive__inner {
	max-width: var(--vv-maxw);
	margin: 0 auto;
}

.vv-archive__head {
	margin: 0 0 var(--vv-gap-lg);
}

.vv-archive__title {
	font-size: var(--vv-fs-xl) !important;
	line-height: var(--vv-lh-tight) !important;
	font-weight: 800 !important;
	color: var(--vv-ink) !important;
	margin: 0 !important;
	padding: 0 !important;
	text-transform: none !important;
}

.vv-archive__desc {
	font-size: var(--vv-fs-base);
	line-height: var(--vv-lh);
	color: var(--vv-ink-soft);
	margin-top: var(--vv-gap-sm);
	max-width: 72ch;
}

/* ================= Hero ================= */

.vv-hero {
	margin: 0 0 var(--vv-gap-lg);
}

.vv-hero__link {
	display: grid;
	grid-template-columns: 1.15fr 1fr;
	background: var(--vv-surface);
	border: 1px solid var(--vv-line);
	border-radius: var(--vv-radius-lg);
	overflow: hidden;
	text-decoration: none !important;
	box-shadow: var(--vv-shadow);
}

.vv-hero__img {
	display: block;
	min-height: 280px;
	background-size: cover;
	background-position: center;
	background-color: var(--vv-surface-alt);
}

.vv-hero__body {
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: var(--vv-gap-xs);
	padding: var(--vv-gap-lg);
}

.vv-hero__eyebrow {
	display: inline-block;
	align-self: flex-start;
	font-size: var(--vv-fs-xs);
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--vv-accent);
	background: var(--vv-accent-soft);
	border-radius: var(--vv-radius-pill);
	padding: 3px 10px;
}

.vv-hero__title {
	font-size: var(--vv-fs-lg);
	line-height: var(--vv-lh-tight);
	font-weight: 800;
	color: var(--vv-ink);
}

.vv-hero__excerpt {
	font-size: var(--vv-fs-base);
	line-height: var(--vv-lh);
	color: var(--vv-ink-soft);
}

.vv-hero__meta {
	font-size: var(--vv-fs-sm);
	color: var(--vv-ink-mute);
	margin-top: var(--vv-gap-xs);
}

/* ================= Filter ================= */

.vv-filter {
	display: flex;
	flex-direction: column;
	gap: var(--vv-gap-sm);
	margin: 0 0 var(--vv-gap-lg);
}

.vv-filter__row {
	display: flex;
	align-items: baseline;
	gap: var(--vv-gap-sm);
	flex-wrap: wrap;
}

.vv-filter__label {
	flex: 0 0 auto;
	font-size: var(--vv-fs-xs);
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--vv-ink-mute);
	min-width: 68px;
}

.vv-filter__chips {
	display: flex;
	flex-wrap: wrap;
	gap: var(--vv-gap-xs);
}

.vv-chip {
	display: inline-block;
	font-size: var(--vv-fs-sm) !important;
	line-height: 1.2 !important;
	padding: 6px 12px;
	border-radius: var(--vv-radius-pill);
	border: 1px solid var(--vv-line);
	background: var(--vv-surface);
	color: var(--vv-ink-soft) !important;
	text-decoration: none !important;
}

.vv-chip:hover {
	border-color: var(--vv-line-strong);
}

.vv-chip.is-active {
	background: var(--vv-accent);
	border-color: var(--vv-accent);
	color: var(--vv-accent-ink) !important;
}

/* ================= Grid ================= */

.vv-grid {
	display: grid;
	grid-template-columns: repeat(var(--vv-cols), minmax(0, 1fr));
	gap: var(--vv-gap);
}

.vv-card {
	display: flex;
	flex-direction: column;
	background: var(--vv-surface);
	border: 1px solid var(--vv-line);
	border-radius: var(--vv-radius);
	overflow: hidden;
	text-decoration: none !important;
	color: var(--vv-ink) !important;
}

.vv-card:hover {
	border-color: var(--vv-line-strong);
	box-shadow: var(--vv-shadow);
}

.vv-card__img {
	display: block;
	width: 100%;
	padding-top: 56%;
	background-size: cover;
	background-position: center;
	background-color: var(--vv-surface-alt);
}

.vv-card__img.is-empty {
	background-image: linear-gradient(135deg, var(--vv-surface-alt), var(--vv-line));
}

.vv-card__body {
	display: flex;
	flex-direction: column;
	gap: var(--vv-gap-xs);
	padding: var(--vv-gap);
	flex: 1 1 auto;
}

.vv-card__title {
	font-size: var(--vv-fs-md);
	line-height: var(--vv-lh-tight);
	font-weight: 700;
}

.vv-card__excerpt {
	font-size: var(--vv-fs-sm);
	line-height: var(--vv-lh);
	color: var(--vv-ink-soft);
}

.vv-card__meta {
	font-size: var(--vv-fs-xs);
	color: var(--vv-ink-mute);
	margin-top: auto;
	padding-top: var(--vv-gap-xs);
}

.vv-empty {
	font-size: var(--vv-fs-base) !important;
	color: var(--vv-ink-mute) !important;
	padding: var(--vv-gap-lg);
	text-align: center;
	border: 1px dashed var(--vv-line);
	border-radius: var(--vv-radius);
}

/* ================= TOC ================= */
/* v3.27.0 — thiết kế lại: bỏ dạng danh sách trần, thêm số thứ tự dạng
   huy hiệu tròn cho H2, gạch nối nhỏ cho H3, hiệu ứng hover trượt nhẹ +
   đổi nền + đổi màu huy hiệu. Nhãn đổi từ "Nội dung bài viết" (dễ hiểu
   nhầm là nội dung chính) sang "Mục lục" ở PHP (class-vce-layout.php). */

.vv-toc {
	position: relative;
	background: var(--vv-surface-alt);
	border: 1px solid var(--vv-line);
	border-radius: var(--vv-radius-lg, 14px);
	padding: var(--vv-gap) var(--vv-gap-lg) var(--vv-gap-lg);
	margin: 0 0 var(--vv-gap-lg);
	overflow: hidden;
}

/* Vạch màu mảnh phía trên — dấu hiệu nhận diện nhanh, cùng ngôn ngữ thị
   giác với .vce-sources (vạch trái) nhưng đặt trên đầu vì đây là khối mở
   bài, không phải chú thích cuối bài. */
.vv-toc::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 3px;
	background: linear-gradient(90deg, var(--vv-accent, #0f7b56), transparent);
}

.vv-toc__head {
	display: flex;
	align-items: center;
	gap: 7px;
	font-size: var(--vv-fs-xs);
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--vv-accent, #0f7b56);
	margin-bottom: var(--vv-gap-sm);
	padding-top: 2px;
}

.vv-toc__head::before {
	content: "";
	flex: 0 0 auto;
	width: 13px;
	height: 13px;
	border-radius: 3px;
	background:
		linear-gradient(currentColor, currentColor) 0 2px / 100% 2px no-repeat,
		linear-gradient(currentColor, currentColor) 0 7px / 70% 2px no-repeat,
		linear-gradient(currentColor, currentColor) 0 12px / 85% 2px no-repeat;
	opacity: .85;
}

.vv-toc__list {
	list-style: none !important;
	counter-reset: vvtoc;
	margin: 0 !important;
	padding: 0 !important;
	display: flex;
	flex-direction: column;
	gap: 1px;
}

.vv-toc__item {
	list-style: none !important;
	counter-increment: vvtoc;
	margin: 0 !important;
	padding: 0 !important;
	font-size: var(--vv-fs-base) !important;
	line-height: 1.45 !important;
}

.vv-toc__item a {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 7px 10px !important;
	margin: 0 -10px !important;
	border-radius: var(--vv-radius-sm, 8px);
	color: var(--vv-ink-soft) !important;
	text-decoration: none !important;
	transition: background-color .15s ease, color .15s ease, transform .15s ease;
}

/* Huy hiệu số thứ tự — chỉ mục H2 (nội dung chính), rỗng cho H3. */
.vv-toc__item--h2 > a > .vv-toc__marker {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: var(--vv-surface, #fff);
	border: 1.5px solid var(--vv-line-strong, #b9c2cc);
	color: var(--vv-ink-mute);
	font-size: 11.5px !important;
	font-weight: 700;
	transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.vv-toc__item--h2 > a > .vv-toc__marker::before {
	content: counter(vvtoc);
}

.vv-toc__item--h3 {
	padding-left: 30px !important;
	font-size: var(--vv-fs-sm) !important;
}

/* H3 dùng gạch nối nhỏ thay vì số — tránh rối mắt với 2 dãy số chồng nhau. */
.vv-toc__item--h3 > a > .vv-toc__marker {
	flex: 0 0 auto;
	width: 12px;
	height: 1.5px;
	background: var(--vv-line-strong, #b9c2cc);
	transition: background-color .15s ease, width .15s ease;
}

.vv-toc__item a:hover,
.vv-toc__item.is-current a {
	background: var(--vv-surface, #fff);
	color: var(--vv-accent) !important;
	transform: translateX(3px);
}

.vv-toc__item a:hover > .vv-toc__marker,
.vv-toc__item.is-current a > .vv-toc__marker {
	border-color: var(--vv-accent, #0f7b56);
	background: var(--vv-accent, #0f7b56);
	color: #fff;
}

.vv-toc__item--h3 a:hover > .vv-toc__marker,
.vv-toc__item--h3.is-current a > .vv-toc__marker {
	background: var(--vv-accent, #0f7b56);
	width: 18px;
}

.vv-toc__item.is-current a {
	font-weight: 700 !important;
}

/* Mục "Nguồn tham khảo" trong mục lục không phải nội dung chính của bài —
   tách bằng vạch mảnh phía trên, chữ nhạt hơn, không đánh số cùng dãy với
   các mục nội dung thật. */
.vv-toc__item--meta {
	margin-top: var(--vv-gap-sm) !important;
	padding-top: calc(var(--vv-gap-sm) + 6px) !important;
	border-top: 1px dashed var(--vv-line);
	counter-increment: none;
}

.vv-toc__item--meta > a > .vv-toc__marker {
	display: none;
}

.vv-toc__item--meta a {
	color: var(--vv-ink-mute) !important;
	font-size: var(--vv-fs-sm) !important;
	padding-left: 4px !important;
}

.vv-toc__item--meta a:hover {
	transform: none;
	background: transparent;
	color: var(--vv-accent) !important;
}

@media (prefers-reduced-motion: reduce) {
	.vv-toc__item a,
	.vv-toc__item a > .vv-toc__marker {
		transition: none;
	}
}

/* ================= Thanh tiến độ đọc ================= */

.vv-progress {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	height: var(--vv-progress-h);
	background: transparent;
	z-index: 9999;
	pointer-events: none;
}

.vv-progress__bar {
	display: block;
	height: 100%;
	width: 0;
	background: var(--vv-accent);
	transition: width .08s linear;
}

/* ================= Share ================= */

.vv-share {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: var(--vv-gap-sm);
	margin: var(--vv-gap-lg) 0 0;
	padding-top: var(--vv-gap);
	border-top: 1px solid var(--vv-line);
}

.vv-share__label {
	font-size: var(--vv-fs-xs);
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--vv-ink-mute);
}

.vv-share__btn {
	font-size: var(--vv-fs-sm) !important;
	line-height: 1.2 !important;
	padding: 7px 14px;
	border-radius: var(--vv-radius-pill);
	border: 1px solid var(--vv-line);
	background: var(--vv-surface);
	color: var(--vv-ink-soft) !important;
	text-decoration: none !important;
	cursor: pointer;
}

.vv-share__btn:hover {
	border-color: var(--vv-line-strong);
}

.vv-share__btn--zalo {
	border-color: #0068ff;
	color: #0068ff !important;
}

.vv-share__btn--fb {
	border-color: #1877f2;
	color: #1877f2 !important;
}

/* ================= Hub ================= */

.vv-hub {
	margin: 0 0 var(--vv-gap-lg);
	background: var(--vv-surface);
	border: 1px solid var(--vv-line);
	border-radius: var(--vv-radius);
	padding: var(--vv-gap) var(--vv-gap-lg) var(--vv-gap-lg);
}

.vv-hub__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: var(--vv-gap-sm);
	margin-bottom: var(--vv-gap-sm);
}

.vv-hub__title {
	font-size: var(--vv-fs-lg) !important;
	line-height: var(--vv-lh-tight) !important;
	font-weight: 800 !important;
	color: var(--vv-ink) !important;
	margin: 0 !important;
	padding: 0 !important;
	text-transform: none !important;
}

.vv-hub__count {
	font-size: var(--vv-fs-xs);
	color: var(--vv-ink-mute);
	white-space: nowrap;
}

.vv-hub__list {
	list-style: none !important;
	margin: 0 !important;
	padding: 0 !important;
	counter-reset: vvhub;
}

.vv-hub__item {
	list-style: none !important;
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: var(--vv-gap);
	padding: var(--vv-gap-sm) 0 !important;
	margin: 0 !important;
	border-bottom: 1px solid var(--vv-line);
	font-size: var(--vv-fs-base) !important;
	line-height: 1.45 !important;
}

.vv-hub__item:last-child {
	border-bottom: 0;
}

.vv-hub__item a {
	color: var(--vv-ink) !important;
	text-decoration: none !important;
}

.vv-hub__item a:hover {
	color: var(--vv-accent) !important;
}

.vv-hub__date {
	flex: 0 0 auto;
	font-size: var(--vv-fs-xs);
	color: var(--vv-ink-mute);
}

/* ================= Responsive ================= */

@media (max-width: 1024px) {
	:root {
		--vv-cols: 2;
	}
}

@media (max-width: 700px) {
	:root {
		--vv-cols: 1;
		--vv-fs-xl: 24px;
		--vv-fs-lg: 19px;
	}

	.vv-archive {
		padding: var(--vv-gap-lg) var(--vv-gap-sm);
	}

	.vv-hero__link {
		grid-template-columns: minmax(0, 1fr);
	}

	.vv-hero__img {
		min-height: 190px;
	}

	.vv-filter__label {
		min-width: 0;
		width: 100%;
	}

	.vv-hub__item {
		flex-direction: column;
		gap: 2px;
	}
}
