/*!
 * Theme Dang Chi Viet — custom.css
 *
 * TOÀN BỘ CSS bổ sung / ghi đè của theme + plugin Dang Chi Viet CMS nằm trong file này.
 * KHÔNG sửa style.css (bản gốc Around) — ghi đè ở đây, dùng selector lồng hoặc !important khi cần.
 *
 * Mục lục:
 *   1. Ghi đè style.css (Around)
 *   2. Giao diện chung của theme
 *   3. Khối nội dung trang chủ (shortcode của plugin): thumbnail, featured, classic, grid, list, magazine, banner, rating
 *   4. Mục lục tự động (TOC)
 *   5. Hero section ([dcv_hero]) + trang chuyên mục công ty thành viên
 */

/* =========================================================================
 * 1. Ghi đè style.css (Around) — trước đây sửa thẳng trong style.css.
 *    style.css giữ nguyên bản gốc; mọi thay đổi đặt ở đây.
 * ====================================================================== */
.navbar-light {
	background: var(--bs-light);
}
.navbar-light .navbar-nav .menu-item > a:hover,
.navbar-light .navbar-nav .menu-item > a:focus {
	color: var(--dcv-cat-color, var(--bs-primary)) !important;
}
.bg-gradient {
	background-image: linear-gradient(to bottom right, #000000ab, #00ffff63) !important;
}
.category-icon {
	display: block;
	background: #007bff;
	padding: 20px;
	color: #fff;
	border-radius: 5px;
	width: 79px;
	height: 79px;
}
.category-icon img {
	filter: brightness(0) invert(1) !important;
}
.category-icon i {
	color: #fff !important;
}
@media (min-width: 992px) {
	/* style.css thu nhỏ logo còn 120px khi header dính -> giữ nguyên kích thước logo (145px) */
	.navbar-stuck .navbar-brand img {
		width: 145px !important;
	}
	.offcanvas-collapse .offcanvas-body .navbar-nav .menu-item.current-menu-item > a,
	.navbar-expand-lg .navbar-nav .menu-item.current-menu-item > a {
		color: var(--bs-primary) !important;
	}
}
.tns-carousel-wrapper.tns-controls-inside [data-controls=prev] {
	left: -1.75rem !important;
}
.tns-carousel-wrapper.tns-controls-inside [data-controls=next] {
	right: -1.75rem !important;
}

/* =========================================================================
 * 2. Giao diện chung của theme
 * ====================================================================== */
.skip-link:focus { position: fixed; top: 8px; left: 8px; z-index: 100000; padding: 8px 14px; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.2); }

/* Trang chủ dựng bằng shortcode */
.dcv-home > p:empty { display: none; }
.dcv-home .dcv-block:first-child .dcv-block__head { border-top-color: transparent; padding-top: 0; }


/* Bài viết */
.dcv-single .dcv-sapo { font-size: 1.05rem; line-height: 1.6; }
.dcv-single .entry-content img { max-width: 100%; height: auto; }
.dcv-featured img { aspect-ratio: auto; }
.dcv-post-nav .nav-links { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.dcv-post-nav .nav-next { text-align: right; }
.dcv-post-nav a { display: block; padding: 14px 16px; border: 1px solid #e7e9ec; border-radius: 8px; text-decoration: none; }
.dcv-post-nav a:hover { border-color: var(--bs-primary); }
@media (max-width: 575.98px) { .dcv-post-nav .nav-links { grid-template-columns: 1fr; } .dcv-post-nav .nav-next { text-align: left; } }

.dcv-related h3 a { color: inherit; text-decoration: none; }
.dcv-related h3 a:hover { color: var(--bs-primary); }

/* Danh sách bài */
.post-excerpt .entry-title a { color: inherit; text-decoration: none; }
.post-excerpt .entry-title a:hover { color: var(--bs-primary); }
.card .dcv-thumb.card-img-top { border-radius: .5rem .5rem 0 0; }

/* Footer */
.dcv-footer-menu { display: flex; flex-wrap: wrap; gap: 4px 18px; padding: 0; list-style: none; }
.dcv-footer-menu a { color: rgba(255,255,255,.75); }
.dcv-footer-tags a:hover { color: #fff !important; }

/* Comment */
.dcv-comments .children { list-style: none; padding-left: 24px; }

/* Trang chuyên mục: biểu tượng + menu chuyên mục cuộn ngang */
.dcv-archive-icon { width: auto !important; height: 1.15em !important; max-width: 2em !important; object-fit: contain; }
.dcv-archive-subnav { margin-top: 1.25rem; }

.dcv-block__subnav.dcv-archive-subnav ul {
    gap: 5px;
}

.dcv-block__subnav.dcv-archive-subnav .dcv-subnav__track a {
    font-size: 14px;
    font-weight: 400;
}

.dcv-archive-subnav .dcv-subnav__track a:hover,
.dcv-archive-subnav .dcv-subnav__track .is-active {
    color: var(--dcv-cat-color, var(--bs-primary)) !important;
    border-color: var(--dcv-cat-color, var(--bs-primary)) !important;
}

.text-category {
    color: var(--dcv-cat-color, var(--bs-primary)) !important;
}

/* #########################################################################
 * 3. Khối nội dung (shortcode của plugin Dang Chi Viet CMS)
 * ###################################################################### */

:root {
	--dcv-accent: var(--bs-primary, #e2231a);
	--dcv-accent-2: var(--bs-secondary, #f7941d);
	--dcv-text: var(--bs-body-color, #222);
	--dcv-muted: #5f6368;
	--dcv-line: #d9d9d9;
	--dcv-radius: 4px;
	--dcv-gap: 24px;
}

/* =========================================================================
 * 1. Khung thumbnail — ảnh luôn lấp đầy khung theo tỉ lệ, phần dư bị cắt
 * ====================================================================== */
.dcv-thumb {
	position: relative;
	display: block;
	width: 100%;
	margin: 0;
	aspect-ratio: var(--dcv-ratio, 16 / 9);
	overflow: hidden;
	border-radius: var(--dcv-radius);
	background: #e9ecef;
	container-type: inline-size;
	isolation: isolate;
}
.dcv-thumb__link { position: absolute; inset: 0; display: block; }
.dcv-thumb__img,
.dcv-thumb img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100% !important;
	max-width: none;
	object-fit: cover;
	object-position: center;
	transition: transform .5s ease;
}
@media (hover: hover) {
	.dcv-thumb__link:hover .dcv-thumb__img { transform: scale(1.04); }
}

/* Thumbnail giả: ảnh nền + gradient + tiêu đề chữ lớn */
.dcv-thumb.is-placeholder .dcv-thumb__overlay {
	position: absolute;
	inset: 0;
	z-index: 1;
	background:
		linear-gradient(160deg, rgba(var(--bs-primary-rgb, 226, 35, 26), .55) 0%, rgba(0, 0, 0, 0) 45%),
		linear-gradient(0deg, rgba(10, 14, 26, .92) 0%, rgba(10, 14, 26, .35) 70%, rgba(10, 14, 26, .15) 100%);
}
.dcv-thumb.is-placeholder .dcv-thumb__title {
	position: absolute;
	inset: auto 0 0 0;
	z-index: 2;
	padding: 7cqi 7cqi 12cqi;
	color: #fff;
	font-weight: 800;
	font-size: clamp(14px, 7.2cqi, 44px);
	line-height: 1.18;
	letter-spacing: -.01em;
	text-wrap: balance;
	text-shadow: 0 1px 2px rgba(0, 0, 0, .35);
}
.dcv-thumb.is-placeholder .dcv-thumb__title span {
	display: -webkit-box;
	-webkit-line-clamp: 4;
	-webkit-box-orient: vertical;
	overflow: hidden;
	border-left: max(3px, 1cqi) solid var(--dcv-accent);
	padding-left: 3.5cqi;
}
.dcv-thumb.is-placeholder .dcv-thumb__brand {
	position: absolute;
	right: 7cqi;
	bottom: 4.5cqi;
	z-index: 2;
	color: rgba(255, 255, 255, .7);
	font-size: clamp(9px, 3cqi, 14px);
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
}
/* Ảnh nhỏ (list) -> chỉ giữ gradient, bỏ chữ để không bị rối */
@container (max-width: 160px) {
	.dcv-thumb.is-placeholder .dcv-thumb__title { font-size: 11px; padding: 8px; }
	.dcv-thumb.is-placeholder .dcv-thumb__title span { -webkit-line-clamp: 3; }
	.dcv-thumb.is-placeholder .dcv-thumb__brand { display: none; }
}

/* =========================================================================
 * 2. Khối nội dung trang chủ
 * ====================================================================== */
.dcv-blocks { display: grid; gap: 40px; }
.dcv-block { min-width: 0; margin-bottom: 40px; color: var(--dcv-text); }
.dcv-blocks > .dcv-block { margin-bottom: 0; }
.dcv-block a { color: inherit; text-decoration: none; }
.dcv-block a:hover { color: var(--dcv-cat-color, rgba(var(--bs-primary-rgb),0.6)) !important; }
.dcv-block a:focus-visible { outline: 2px solid var(--dcv-accent); outline-offset: 2px; }

.dcv-block__head {
	display: flex;
	align-items: center;
	gap: 8px 36px;
	padding-top: 14px;
	margin-bottom: 18px;
	border-top: 2px solid #e5e5e5;
	min-width: 0;
	position: relative;
}
.dcv-block__head:after {
    content: '';
    height: 2px;
    width: 79px;
    background: var(--dcv-cat-color, var(--bs-primary, #e2231a));
    position: absolute;
    top: -2px;
    left: 0;
}
.dcv-block__title {
	position: relative;
	flex: 0 0 auto;
	margin: 0;
	padding-left: 22px;
	color: var(--dcv-cat-color, var(--bs-primary, #e2231a));
	font-size: clamp(18px, 2.2vw, 22px);
	font-weight: 700;
	line-height: 1;
	text-transform: uppercase;
	letter-spacing: .01em;
	flex-grow: 100;
}
.dcv-block__title::before {
	content: "";
	position: absolute;
	left: 4px;
	top: 50%;
	width: 5px;
	height: .85em;
	background: linear-gradient(180deg, var(--dcv-accent-2), var(--dcv-accent));
	transform: translateY(-50%) skewX(-18deg);
}
/* Màu riêng của chuyên mục: tiêu đề + vạch chéo + hover menu con cùng màu */
.dcv-block__head.has-color .dcv-block__title::before { background: var(--dcv-cat-color); }
.dcv-block .dcv-block__title a { display: inline-flex; align-items: center; gap: 10px; color: inherit; }
.dcv-block .dcv-block__title a:hover { color: inherit; opacity: .82; }
.dcv-block__head.has-color .dcv-block__subnav a:hover { color: var(--dcv-cat-color); }
.dcv-block__head.has-color .dcv-subnav__btn:hover { color: var(--dcv-cat-color); border-color: var(--dcv-cat-color); }
/* Biểu tượng ảnh thay cho vạch chéo */
.dcv-block__title.has-icon { padding-left: 0; }
.dcv-block__title.has-icon::before { display: none; }
.dcv-block__icon {
	flex: 0 0 auto;
	width: auto !important;
	height: 1.4em !important;
	max-width: 22px !important;
	object-fit: contain;
}
/* Menu chuyên mục con: cuộn ngang + nút « » + kéo bằng chuột */
.dcv-block__subnav {
	position: relative;
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	align-items: center;
}
.dcv-subnav__track {
	flex: 1 1 auto;
	min-width: 0;
	overflow-x: auto;
	scrollbar-width: none;
	overscroll-behavior-x: contain;
	-webkit-user-select: none;
	user-select: none;
}
.dcv-subnav__track::-webkit-scrollbar { display: none; }
.dcv-block__subnav ul {
	display: flex;
	gap: 28px;
	margin: 0;
	padding: 0;
	list-style: none;
	white-space: nowrap;
}
.dcv-block__subnav a { display: block; padding: 4px 0; font-size: 15px; color: #333; -webkit-user-drag: none; }

/* Mờ dần ở đầu/cuối khi còn mục bị khuất */
/* Vùng dưới nút (36px) trong suốt hẳn, sau đó rõ dần -> chữ không bị nút đè lên */
.dcv-block__subnav.is-overflow .dcv-subnav__track {
	--dcv-hide-l: 36px;
	--dcv-fade-l: 76px;
	--dcv-hide-r: 36px;
	--dcv-fade-r: 76px;
	-webkit-mask-image: linear-gradient(90deg, transparent 0, transparent var(--dcv-hide-l), #000 var(--dcv-fade-l), #000 calc(100% - var(--dcv-fade-r)), transparent calc(100% - var(--dcv-hide-r)), transparent 100%);
	mask-image: linear-gradient(90deg, transparent 0, transparent var(--dcv-hide-l), #000 var(--dcv-fade-l), #000 calc(100% - var(--dcv-fade-r)), transparent calc(100% - var(--dcv-hide-r)), transparent 100%);
}
.dcv-block__subnav.at-start .dcv-subnav__track { --dcv-hide-l: 0px; --dcv-fade-l: 0px; }
.dcv-block__subnav.at-end .dcv-subnav__track { --dcv-hide-r: 0px; --dcv-fade-r: 0px; }
@media (hover: none), (pointer: coarse) {
	.dcv-block__subnav.is-overflow .dcv-subnav__track { --dcv-hide-l: 0px; --dcv-hide-r: 0px; --dcv-fade-l: 24px; --dcv-fade-r: 32px; }
	.dcv-block__subnav.is-overflow.at-start .dcv-subnav__track { --dcv-fade-l: 0px; }
	.dcv-block__subnav.is-overflow.at-end .dcv-subnav__track { --dcv-fade-r: 0px; }
}

/* Máy tính (chuột): con trỏ "bàn tay" khi có thể kéo */
@media (hover: hover) and (pointer: fine) {
	.dcv-block__subnav.is-overflow .dcv-subnav__track { cursor: grab; }
	.dcv-block__subnav.is-dragging .dcv-subnav__track,
	.dcv-block__subnav.is-dragging .dcv-subnav__track a { cursor: grabbing; }
}
.dcv-block__subnav.is-dragging a { pointer-events: none; }

/* Nút « » */
.dcv-subnav__btn {
	position: absolute;
	top: 45%;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	padding: 0;
	border: 1px solid var(--dcv-line);
	border-radius: 50%;
	background: var(--bs-body-bg, #fff);
	color: #333;
	font-size: 16px;
	line-height: 1;
	cursor: pointer;
	transform: translateY(-50%);
	box-shadow: 0 1px 4px rgba(0, 0, 0, .08);
	transition: color .15s, border-color .15s;
}
.dcv-subnav__btn[hidden] { display: none; }
.dcv-subnav__btn--prev { left: 0; }
.dcv-subnav__btn--next { right: 0; }
.dcv-subnav__btn:hover { color: var(--dcv-accent); border-color: var(--dcv-accent); }
.dcv-subnav__btn:focus-visible { outline: 2px solid var(--dcv-accent); outline-offset: 2px; }
/* Điện thoại / màn cảm ứng: vuốt là đủ, ẩn nút cho gọn */
@media (hover: none), (pointer: coarse) {
	.dcv-subnav__btn { display: none !important; }
}
.dcv-block__more { flex: 0 0 auto; margin-left: auto; font-size: 14px; color: var(--dcv-accent) !important; }
.dcv-block__more--bottom { display: inline-block; margin-top: 12px; }

.dcv-subnav__track ul li {
    margin-bottom: 0;
}

/* Bài nổi bật: chữ trái (1/3) – ảnh phải (2/3) */
.dcv-lead {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
	grid-template-areas: "body media";
	gap: var(--dcv-gap);
	margin-bottom: var(--dcv-gap);
}
.dcv-lead__media { grid-area: media; }
.dcv-lead__body { grid-area: body; }
.dcv-lead__title {
	margin: 0 0 10px;
	font-size: clamp(18px, 1.6vw, 21px);
	font-weight: 700;
	line-height: 1.4;
}
.dcv-lead__excerpt { margin: 0; font-size: 14px; line-height: 1.6; color: var(--dcv-muted); }

/* Lưới bài nhỏ */
.dcv-grid {
	display: grid;
	grid-template-columns: repeat(var(--dcv-cols, 4), minmax(0, 1fr));
	gap: var(--dcv-gap);
}
.dcv-card { min-width: 0; }
.dcv-card__title {
	display: -webkit-box;
	margin: 12px 0 0;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.45;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.dcv-card__excerpt { margin: 6px 0 0; font-size: 14px; color: var(--dcv-muted); }
.dcv-card__date { display: block; margin-top: 6px; font-size: 13px; color: var(--dcv-muted); }

/* Danh sách nhỏ */
.dcv-list { margin: 0; padding: 0; list-style: none; }
.dcv-list__item {
	display: grid;
	grid-template-columns: 120px minmax(0, 1fr);
	gap: 14px;
	align-items: start;
	padding: 12px 0;
	border-bottom: 1px solid #eee;
}
.dcv-list__item:last-child { border-bottom: 0; }
.dcv-list__title { margin: 0; font-size: 15px; font-weight: 600; line-height: 1.45; }

@media (max-width: 991.98px) {
	.dcv-grid { --dcv-cols: 2 !important; }
}
@media (max-width: 767.98px) {
	:root { --dcv-gap: 16px; }
	.dcv-block__head { gap: 6px 20px; }
	.dcv-lead { grid-template-columns: minmax(0, 1fr); grid-template-areas: "media" "body"; gap: 12px; }
	.dcv-card__title { font-size: 15px; }
}
@media (max-width: 479.98px) {
	.dcv-block--featured .dcv-grid { --dcv-cols: 1 !important; gap: 0; }
	.dcv-block--featured .dcv-card {
		display: grid;
		grid-template-columns: 120px minmax(0, 1fr);
		gap: 12px;
		padding: 12px 0;
		border-top: 1px solid #eee;
	}
	.dcv-block--featured .dcv-card__title { margin: 0; }
}

/* Bố cục "classic": bài lớn trái (ảnh trên – chữ dưới) + danh sách phải.
   Lưới & khoảng cách dùng class Bootstrap trong template, ở đây chỉ chỉnh chữ + ảnh nhỏ. */
.dcv-classic-lead__title {
	font-size: clamp(22px, 2.3vw, 32px);
	font-weight: 600;
	line-height: 1.3;
	letter-spacing: -.01em;
}
.dcv-classic-lead__excerpt { font-size: 15px; line-height: 1.65; color: var(--dcv-muted); }
.dcv-classic-item .dcv-classic-item__media { width: 38%; max-width: 160px; }
.dcv-classic-item__title {
	display: -webkit-box;
	font-size: 17px;
	font-weight: 600;
	line-height: 1.45;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
@media (max-width: 575.98px) {
	.dcv-classic-item .dcv-classic-item__media { width: 120px; }
	.dcv-classic-item__title { font-size: 15px; }
}

/* =========================================================================
 * 3. Banner sự kiện
 * ====================================================================== */
.dcv-banner { margin: 0 0 40px; }
.dcv-banner__inner { position: relative; display: block; overflow: hidden; border-radius: var(--dcv-radius); color: #fff; text-decoration: none; }
.dcv-banner__img { display: block; width: 100%; height: auto; }
.dcv-banner.has-ratio .dcv-banner__inner { aspect-ratio: var(--dcv-banner-ratio); }
.dcv-banner.has-ratio .dcv-banner__img { height: 100%; object-fit: cover; }
@media (max-width: 767.98px) {
	.dcv-banner.has-ratio .dcv-banner__inner { aspect-ratio: var(--dcv-banner-ratio-sm, var(--dcv-banner-ratio)); }
}
.dcv-banner__overlay {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: flex-start;
	gap: 8px;
	padding: 4% 5%;
	background: linear-gradient(90deg, rgba(0, 0, 0, .65), rgba(0, 0, 0, 0) 70%);
}
.dcv-banner__title { font-size: clamp(18px, 3vw, 36px); line-height: 1.15; max-width: 60%; }
.dcv-banner__subtitle { font-size: clamp(13px, 1.4vw, 17px); max-width: 55%; opacity: .9; }
.dcv-banner__title, .dcv-banner__subtitle { overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 575.98px) {
	.dcv-banner__overlay { gap: 4px; padding: 3% 4%; }
	.dcv-banner__title { font-size: 16px; max-width: 75%; white-space: nowrap; }
	.dcv-banner__subtitle, .dcv-banner__content { display: none; }
	.dcv-banner__button { display: none !important; }
}

/* =========================================================================
 * 4. Captcha Cloudflare Turnstile trong form
 * ====================================================================== */
.dcv-turnstile { margin-bottom: 10px; min-height: 0; }

/* =========================================================================
 * 5. Like / dislike
 * ====================================================================== */
.dcv-rating { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; }
.dcv-rating__question { margin: 0; font-size: 1rem; }
.dcv-rating__btn[disabled] { cursor: default; }
.dcv-rating__note { width: 100%; font-size: 13px; color: var(--dcv-muted); }

@media (prefers-reduced-motion: reduce) {
	.dcv-thumb__img, .dcv-thumb img { transition: none; }
}

/* =========================================================================
 * 6. Khối "magazine" — carousel thẻ ảnh dọc (template="magazine")
 *    Dùng Tiny Slider của theme; CSS dưới đây chỉ lo phần giao diện thẻ + nút.
 * ====================================================================== */

.dcv-mag-card {
	position: relative;
	display: grid; /* ảnh và chữ chồng lên nhau trong cùng 1 ô lưới */
	overflow: hidden;
	border-radius: 6px;
	background: #14161b;
	color: #fff;
}
.dcv-mag-card > * { grid-area: 1 / 1; }
.dcv-mag-card .dcv-mag-card__media { border-radius: 0; }
/* Lớp tối dần từ dưới lên để chữ trắng luôn đọc được */
.dcv-mag-card::before {
	content: "";
	grid-area: 1 / 1;
	z-index: 1;
	background: linear-gradient(0deg, rgba(8, 10, 14, .92) 0%, rgba(8, 10, 14, .7) 28%, rgba(8, 10, 14, .15) 60%, rgba(8, 10, 14, .05) 100%);
	pointer-events: none;
}
.dcv-mag-card__body {
	z-index: 2;
	align-self: end;
	padding: 0 9% 11%;
	min-width: 0;
}
.dcv-mag-card__label {
	display: block;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.3;
	letter-spacing: .03em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, .82);
}
.dcv-mag-card__label::after {
	content: "";
	display: block;
	width: 44px;
	height: 2px;
	margin: 12px 0 16px;
	background: rgba(255, 255, 255, .55);
}
.dcv-mag-card__title {
	display: -webkit-box;
	margin: 0;
	font-size: clamp(17px, 1.45vw, 20px);
	font-weight: 700;
	line-height: 1.38;
	color: #fff;
	text-shadow: 0 1px 3px rgba(0, 0, 0, .45);
	-webkit-line-clamp: 4;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
/* Cả thẻ bấm được (link tiêu đề phủ toàn thẻ) */
.dcv-block .dcv-mag-card__link,
.dcv-block .dcv-mag-card__link:hover { color: #fff; }
.dcv-mag-card__link::after { content: ""; position: absolute; inset: 0; z-index: 3; }
.dcv-mag-card:focus-within { outline: 3px solid var(--dcv-accent); outline-offset: 2px; }
.dcv-mag-card__link:focus-visible { outline: 0; }
@media (hover: hover) {
	.dcv-mag-card:hover .dcv-thumb__img { transform: scale(1.04); }
}

/* Trước khi Tiny Slider chạy (theme ẩn bằng opacity: 0) — giữ sẵn kích thước để trang không bị giật */
.dcv-magazine .tns-carousel-inner:not(.tns-slider) { gap: 14px; }
.dcv-magazine .tns-carousel-inner:not(.tns-slider) > .dcv-magazine__slide { flex: 0 0 calc((100% - 14px) / 1.25); }
@media (min-width: 576px) { .dcv-magazine .tns-carousel-inner:not(.tns-slider) > .dcv-magazine__slide { flex-basis: calc((100% - 2 * 14px) / 2.25); } }
@media (min-width: 768px) { .dcv-magazine .tns-carousel-inner:not(.tns-slider) { gap: 20px; } .dcv-magazine .tns-carousel-inner:not(.tns-slider) > .dcv-magazine__slide { flex-basis: calc((100% - 3 * 20px) / 3.25); } }
@media (min-width: 1200px) { .dcv-magazine .tns-carousel-inner:not(.tns-slider) { gap: 24px; } .dcv-magazine .tns-carousel-inner:not(.tns-slider) > .dcv-magazine__slide { flex-basis: calc((100% - 4 * 24px) / 4.3); } }

/* Không có Tiny Slider (dùng plugin với theme khác): cuộn ngang bằng tay/vuốt */
.dcv-magazine.is-static .tns-carousel-inner {
	opacity: 1;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
}
.dcv-magazine.is-static .tns-carousel-inner::-webkit-scrollbar { display: none; }
.dcv-magazine.is-static .dcv-magazine__slide { scroll-snap-align: start; }

/* Nút ← → tròn trắng, nằm giữa chiều cao, lấn ra ngoài mép carousel */
.dcv-magazine.tns-controls-inside [data-controls] {
	align-items: center;
	width: 52px;
	height: 52px;
	margin-top: -26px;
	border: 0;
	border-radius: 50%;
	background: #fff;
	color: #333;
	font-size: 1.35rem;
	box-shadow: 0 4px 18px rgba(0, 0, 0, .18);
	opacity: 1;
}
.dcv-magazine.tns-controls-inside [data-controls]:hover { color: var(--dcv-accent); }
.dcv-magazine.tns-controls-inside [data-controls="prev"] { left: -26px; }
.dcv-magazine.tns-controls-inside [data-controls="next"] { right: -26px; }
@media (max-width: 1299.98px) {
	.dcv-magazine.tns-controls-inside [data-controls="prev"] { left: 8px; }
	.dcv-magazine.tns-controls-inside [data-controls="next"] { right: 8px; }
}

/* #########################################################################
 * 4. Mục lục tự động (TOC)
 * ###################################################################### */

:root { --dcv-toc-offset: 0px; --dcv-toc-bar-h: 48px; }

/* Heading có khoảng chừa khi nhảy bằng #anchor (không có JS) */
.entry-content :is(h2, h3, h4, h5, h6)[id] {
	scroll-margin-top: calc(var(--dcv-toc-offset) + var(--dcv-toc-bar-h) + 16px);
}

/* ---------------- Hộp mục lục trong bài ---------------- */
.dcv-toc {
	margin: 24px 0 28px;
	padding: 16px 20px 14px;
	border: 1px solid #e3e5e8;
	border-radius: 10px;
	background: #f7f8fa;
	font-size: 15px;
	line-height: 1.5;
}
.dcv-toc__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dcv-toc__title { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 17px; }
.dcv-toc__icon { flex: 0 0 auto; color: var(--bs-primary, #d70018); }
.dcv-toc__toggle {
	border: 0;
	background: none;
	padding: 2px 6px;
	color: var(--bs-primary, #d70018);
	font: inherit;
	font-size: 14px;
	cursor: pointer;
}
.dcv-toc__toggle:hover { text-decoration: underline; }
.dcv-toc.is-collapsed .dcv-toc__list { display: none; }

.dcv-toc ol,
.dcv-toc-bar ol {
	margin: 0;
	padding: 0;
	list-style: none;
	counter-reset: dcv-toc;
}
.dcv-toc .dcv-toc__list { margin-top: 10px; }
.dcv-toc ol ol,
.dcv-toc-bar ol ol { padding-left: 22px; }
.dcv-toc li,
.dcv-toc-bar li { counter-increment: dcv-toc; margin: 0; }
.dcv-toc a,
.dcv-toc-bar a {
	display: flex;
	gap: 6px;
	padding: 5px 0;
	color: #2b2f33;
	text-decoration: none;
}
.dcv-toc a:hover,
.dcv-toc-bar a:hover { color: var(--bs-primary, #d70018); }
.dcv-toc a.is-active,
.dcv-toc-bar a.is-active { color: var(--bs-primary, #d70018); font-weight: 600; }
.dcv-toc.is-numbered a::before,
.dcv-toc-bar.is-numbered a::before {
	content: counters(dcv-toc, ".") ".";
	flex: 0 0 auto;
	min-width: 1.6em;
	color: #8a9097;
	font-variant-numeric: tabular-nums;
}
.dcv-toc a.is-active::before,
.dcv-toc-bar a.is-active::before { color: inherit; }

/* ---------------- Thanh mục lục khi cuộn ---------------- */
.dcv-toc-bar {
	position: fixed;
	top: var(--dcv-toc-offset);
	left: 0;
	width: 100%;
	z-index: 1020; /* dưới header (1030) và dropdown menu */
	background: #fff;
	box-shadow: 0 4px 14px rgba(0, 0, 0, .1);
	font-size: 15px;
	animation: dcv-toc-in .2s ease-out;
}
.dcv-toc-bar[hidden] { display: none; }
@keyframes dcv-toc-in {
	from { opacity: 0; transform: translateY(-6px); }
	to { opacity: 1; transform: none; }
}
.dcv-toc-bar__inner { position: relative; }
.dcv-toc-bar__toggle {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	min-height: var(--dcv-toc-bar-h);
	padding: 6px 16px;
	border: 0;
	background: none;
	color: #1f2328;
	font: inherit;
	text-align: left;
	cursor: pointer;
}
.dcv-toc-bar__label { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.dcv-toc-bar__caption { font-size: 12px; color: #8a9097; }
.dcv-sr-only {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}
.dcv-toc-bar__current {
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
	font-weight: 600;
}
.dcv-toc__icon--chevron { color: #5f6368; transition: transform .2s; }
.dcv-toc-bar.is-open .dcv-toc__icon--chevron { transform: rotate(180deg); }
.dcv-toc-bar__toggle:focus-visible { outline: 2px solid var(--bs-primary, #d70018); outline-offset: -2px; }

.dcv-toc-bar__panel {
	max-height: min(60vh, 480px);
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 4px 16px 14px;
	border-top: 1px solid #eef0f2;
}
.dcv-toc-bar__panel[hidden] { display: none; }

.dcv-toc-bar__progress { height: 3px; background: #eef0f2; }
.dcv-toc-bar__progress span {
	display: block;
	height: 100%;
	background: var(--bs-primary, #d70018);
	transform: scaleX(0);
	transform-origin: left center;
}

@media (min-width: 992px) {
	.dcv-toc-bar { border-radius: 0 0 10px 10px; overflow: hidden; }
}
@media (prefers-reduced-motion: reduce) {
	.dcv-toc-bar { animation: none; }
	.dcv-toc__icon--chevron { transition: none; }
}

.dcv-post-tags { margin-top: 0; }
@media (min-width: 768px) {
	.dcv-post-tags .dcv-subnav__track ul { margin-left: 0; }
}


/* #########################################################################
 * 5. Hero section ([dcv_hero]) — nền tối + hoạt ảnh canvas (hero.js)
 *    Màu nhấn: --hero-accent / --hero-accent-rgb (theo kiểu hoặc màu chuyên mục)
 * ###################################################################### */

.dcv-hero {
	--hero-bg: #05070d;
	--hero-text: #eef2f8;
	--hero-muted: rgba(238, 242, 248, .68);
	position: relative;
	isolation: isolate;
	display: flex;
	align-items: center;
	min-height: clamp(560px, 82vh, 920px);
	padding: 120px 0 110px;
	overflow: hidden;
	color: var(--hero-text);
	background:
		radial-gradient(1100px 620px at 72% 38%, rgba(var(--hero-accent-rgb), .20), transparent 62%),
		radial-gradient(900px 520px at 6% 105%, rgba(var(--hero-accent-rgb), .10), transparent 60%),
		linear-gradient(180deg, #05070d 0%, #090d18 55%, #05070d 100%);
}
.dcv-hero--h-full { min-height: calc(100vh - 70px); }
.dcv-hero--h-md   { min-height: clamp(460px, 62vh, 680px); }

/* Tràn hết chiều rộng màn hình kể cả khi nằm trong .container (trang chủ dựng bằng Page) */
.dcv-hero--bleed {
	width: 100vw;
	max-width: 100vw;
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
}
body:has(.dcv-hero--bleed) { overflow-x: clip; }
/* Hero là khối <section> đầu tiên của trang -> sát header.
   (Phía trước có thể có <h1 class="visually-hidden"> hoặc <p> rỗng do wpautop khi 2 shortcode chỉ cách 1 dòng.) */
.dcv-home > p:empty { display: none; }
.dcv-home > section.dcv-hero:first-of-type { margin-top: -1.5rem; }
@media (min-width: 992px) { .dcv-home > section.dcv-hero:first-of-type { margin-top: -3rem; } }
.dcv-home > .dcv-hero { margin-bottom: 3rem; }

/* Lớp nền: canvas hoạt ảnh -> lưới kỹ thuật -> quầng sáng */
.dcv-hero__canvas { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; opacity: 0; transition: opacity 1.2s ease; }
.dcv-hero.is-ready .dcv-hero__canvas { opacity: 1; }
.dcv-hero__grid {
	position: absolute;
	inset: 0;
	z-index: -2;
	background-image:
		linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px),
		linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
	background-size: 64px 64px;
	-webkit-mask-image: radial-gradient(ellipse 70% 60% at 65% 45%, #000 20%, transparent 75%);
	mask-image: radial-gradient(ellipse 70% 60% at 65% 45%, #000 20%, transparent 75%);
}
.dcv-hero__glow {
	position: absolute;
	inset: auto 0 0 0;
	z-index: -1;
	height: 40%;
	background: linear-gradient(0deg, var(--hero-bg), transparent);
	pointer-events: none;
}
/* Chữ trái: phủ tối nhẹ phía chữ để luôn đọc rõ trên hoạt ảnh */
.dcv-hero--left::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: linear-gradient(90deg, rgba(5, 7, 13, .85) 0%, rgba(5, 7, 13, .55) 38%, transparent 62%);
	pointer-events: none;
}

.dcv-hero__container { position: relative; z-index: 1; }
.dcv-hero__content { max-width: 720px; }
.dcv-hero--center .dcv-hero__content { margin: 0 auto; text-align: center; }

/* Hiện dần từng phần khi tải trang */
.dcv-hero__content > * {
	opacity: 0;
	transform: translateY(18px);
	animation: dcv-hero-in .9s cubic-bezier(.2, .7, .2, 1) forwards;
	animation-delay: calc(var(--i, 0) * 110ms + 150ms);
}
@keyframes dcv-hero-in { to { opacity: 1; transform: none; } }

.dcv-hero__logo { display: block; max-height: 56px; width: auto; margin-bottom: 28px; }
.dcv-hero--center .dcv-hero__logo,
.dcv-hero--center .dcv-hero__eyebrow { margin-inline: auto; }

.dcv-hero__eyebrow {
	display: flex;
	width: fit-content;
	align-items: center;
	gap: 10px;
	margin: 0 0 22px;
	padding: 7px 16px 7px 12px;
	border: 1px solid rgba(var(--hero-accent-rgb), .35);
	border-radius: 999px;
	background: rgba(var(--hero-accent-rgb), .08);
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
	color: var(--hero-text);
	font-size: 13px;
	font-weight: 600;
	letter-spacing: .14em;
	text-transform: uppercase;
}
.dcv-hero__dot {
	position: relative;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--hero-accent);
	box-shadow: 0 0 12px var(--hero-accent);
}
.dcv-hero__dot::after {
	content: "";
	position: absolute;
	inset: -6px;
	border-radius: 50%;
	border: 1px solid var(--hero-accent);
	animation: dcv-hero-ping 2s ease-out infinite;
}
@keyframes dcv-hero-ping { from { transform: scale(.4); opacity: 1; } to { transform: scale(1.6); opacity: 0; } }

.dcv-hero .dcv-hero__title {
	margin: 0 0 22px;
	font-size: clamp(2.6rem, 6.2vw, 5.6rem);
	font-weight: 800;
	line-height: 1;
	letter-spacing: -.035em;
	text-transform: none;
	background: linear-gradient(100deg, #ffffff 0%, #ffffff 35%, var(--hero-accent) 100%);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent !important;
	text-wrap: balance;
	display: inline-block; /* dải màu ăn theo độ dài chữ (khối rộng 100% làm chữ ngắn chỉ nhận phần trắng) */
	max-width: 100%;
	padding-bottom: .06em; /* không cắt chân chữ g, y khi dùng background-clip */
}
.dcv-hero__subtitle {
	max-width: 600px;
	margin: 0 0 34px;
	color: var(--hero-muted);
	font-size: clamp(1rem, 1.25vw, 1.2rem);
	line-height: 1.7;
}
.dcv-hero--center .dcv-hero__subtitle { margin-inline: auto; }

.dcv-hero__actions { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 48px; }
.dcv-hero--center .dcv-hero__actions { justify-content: center; }
.dcv-hero__btn {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 14px 26px;
	border-radius: 999px;
	font-size: 15px;
	font-weight: 600;
	text-decoration: none !important;
	transition: transform .25s ease, box-shadow .25s ease, background-color .25s ease, border-color .25s ease;
}
.dcv-hero__btn--primary {
	background: var(--hero-accent);
	color: #05070d !important;
	box-shadow: 0 10px 34px -10px rgba(var(--hero-accent-rgb), .75), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.dcv-hero__btn--primary:hover { transform: translateY(-2px); box-shadow: 0 16px 40px -10px rgba(var(--hero-accent-rgb), .9); }
.dcv-hero__btn--primary svg { transition: transform .25s ease; }
.dcv-hero__btn--primary:hover svg { transform: translateX(4px); }
.dcv-hero__btn--ghost {
	border: 1px solid rgba(255, 255, 255, .22);
	background: rgba(255, 255, 255, .04);
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
	color: var(--hero-text) !important;
}
.dcv-hero__btn--ghost:hover { border-color: var(--hero-accent); background: rgba(var(--hero-accent-rgb), .1); }
.dcv-hero__btn:focus-visible { outline: 2px solid var(--hero-accent); outline-offset: 3px; }

.dcv-hero__stats {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(130px, max-content));
	gap: 0;
	margin: 0;
	padding-top: 28px;
	border-top: 1px solid rgba(255, 255, 255, .1);
}
.dcv-hero--center .dcv-hero__stats { justify-content: center; }
.dcv-hero__stat { padding: 0 32px 0 0; margin: 0 32px 0 0; border-right: 1px solid rgba(255, 255, 255, .1); }
.dcv-hero__stat:last-child { border-right: 0; margin-right: 0; padding-right: 0; }
.dcv-hero__stat-value {
	margin: 0 0 6px;
	color: #fff;
	font-size: clamp(1.7rem, 2.6vw, 2.4rem);
	font-weight: 700;
	line-height: 1;
	letter-spacing: -.02em;
	font-variant-numeric: tabular-nums;
}
.dcv-hero__stat-value em { font-style: normal; color: var(--hero-accent); }
.dcv-hero__stat-label { margin: 0; color: var(--hero-muted); font-size: 12px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; }

/* Biểu tượng cuộn xuống */
.dcv-hero__scroll {
	position: absolute;
	left: 50%;
	bottom: 28px;
	z-index: 1;
	width: 26px;
	height: 42px;
	margin-left: -13px;
	border: 1.5px solid rgba(255, 255, 255, .35);
	border-radius: 14px;
}
.dcv-hero__scroll span {
	position: absolute;
	left: 50%;
	top: 8px;
	width: 3px;
	height: 8px;
	margin-left: -1.5px;
	border-radius: 2px;
	background: var(--hero-accent);
	animation: dcv-hero-scroll 1.8s ease-in-out infinite;
}
@keyframes dcv-hero-scroll { 0% { transform: translateY(0); opacity: 1; } 70% { transform: translateY(14px); opacity: 0; } 100% { opacity: 0; } }
.dcv-hero__end { position: absolute; bottom: 0; }

@media (max-width: 991.98px) {
	.dcv-hero { padding: 96px 0 96px; }
	.dcv-hero--left::before { background: linear-gradient(180deg, rgba(5, 7, 13, .35), rgba(5, 7, 13, .8)); }
	.dcv-hero__canvas { opacity: .55 !important; }
}
@media (max-width: 575.98px) {
	.dcv-hero { min-height: auto; padding: 80px 0 90px; }
	.dcv-hero__stats { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 20px; }
	.dcv-hero__stat { margin-right: 0; padding-right: 16px; }
	.dcv-hero__stat:nth-child(2n) { border-right: 0; }
	.dcv-hero__btn { padding: 12px 20px; }
	.dcv-hero__scroll { display: none; }
}
@media (prefers-reduced-motion: reduce) {
	.dcv-hero__content > * { animation: none; opacity: 1; transform: none; }
	.dcv-hero__dot::after, .dcv-hero__scroll span { animation: none; }
}

/* Trang chuyên mục có hero: menu chuyên mục con ngay dưới hero */
.dcv-archive-hero-nav { margin-top: 1.25rem; margin-bottom: 2rem; }

/* -------------------------------------------------------------------------
 * Hero kiểu "special" — mô hình 3D chuỗi cung ứng (Three.js, hero-special.js)
 * ---------------------------------------------------------------------- */
.dcv-hero--special { touch-action: pan-y; cursor: grab; user-select: none; -webkit-user-select: none; }
.dcv-hero--special.is-dragging { cursor: grabbing; }
.dcv-hero--special .dcv-hero__container { pointer-events: none; }   /* kéo xoay được cả vùng trống bên phải */
.dcv-hero--special .dcv-hero__content { pointer-events: auto; cursor: auto; user-select: text; -webkit-user-select: text; }
.dcv-hero--special .dcv-hero__grid { opacity: .5; }
.dcv-hero--special.dcv-hero--left::before { background: linear-gradient(90deg, rgba(5, 7, 13, .9) 0%, rgba(5, 7, 13, .6) 34%, transparent 55%); }

.dcv-hero__stations { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.dcv-hero__station {
	position: absolute;
	top: 0;
	left: 0;
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 6px 12px 6px 6px;
	border: 1px solid color-mix(in srgb, var(--station-color) 55%, transparent);
	border-radius: 999px;
	background: rgba(8, 12, 22, .72);
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
	color: #eef2f8;
	font: inherit;
	text-align: left;
	white-space: nowrap;
	pointer-events: auto;
	cursor: pointer;
	opacity: 0;
	transition: border-color .2s, background-color .2s, box-shadow .2s;
	will-change: transform;
}
.dcv-hero.is-ready .dcv-hero__station { transition: opacity .3s, border-color .2s, background-color .2s, box-shadow .2s; }
.dcv-hero__station::after {
	content: "";
	position: absolute;
	left: 50%;
	top: 100%;
	width: 1px;
	height: 18px;
	background: linear-gradient(var(--station-color), transparent);
}
.dcv-hero__station-no {
	display: grid;
	place-items: center;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: var(--station-color);
	color: #05070d;
	font-size: 12px;
	font-weight: 800;
}
.dcv-hero__station-text { display: flex; flex-direction: column; line-height: 1.15; }
.dcv-hero__station-text strong { font-size: 13px; font-weight: 700; }
.dcv-hero__station-text small { font-size: 11px; color: rgba(238, 242, 248, .6); letter-spacing: .04em; }
.dcv-hero__station:hover,
.dcv-hero__station.is-hover,
.dcv-hero__station.is-active {
	border-color: var(--station-color);
	background: color-mix(in srgb, var(--station-color) 18%, rgba(8, 12, 22, .85));
	box-shadow: 0 0 24px -6px var(--station-color);
}
.dcv-hero__station:focus-visible { outline: 2px solid var(--station-color); outline-offset: 3px; }

.dcv-hero__hint {
	position: absolute;
	right: 28px;
	bottom: 26px;
	z-index: 2;
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	color: rgba(238, 242, 248, .55);
	font-size: 12px;
	letter-spacing: .04em;
	pointer-events: none;
}

/* Không tải được Three.js / không có WebGL -> hoạt ảnh 2D thay thế, ẩn nhãn 3D */
.dcv-hero--special.is-fallback { cursor: auto; }
.dcv-hero--special.is-fallback .dcv-hero__stations,
.dcv-hero--special.is-fallback .dcv-hero__hint { display: none; }

@media (max-width: 991.98px) {
	.dcv-hero--special .dcv-hero__canvas { opacity: .7 !important; }
	.dcv-hero__station { padding: 4px 9px 4px 4px; }
	.dcv-hero__station-text small { display: none; }
	.dcv-hero__hint { right: 50%; transform: translateX(50%); bottom: 18px; white-space: nowrap; }
	.dcv-hero--special .dcv-hero__scroll { display: none; }
}
@media (max-width: 575.98px) {
	.dcv-hero__station-text { display: none; }
	.dcv-hero__station { padding: 3px; }
}
