/* =========================================================
   Khoa Học Đời Sống – Phong cách tạp chí ColorMag 01
   ========================================================= */

/* --- Top Bar --- */
.khds-topbar {
	background-color: var(--khds-topbar-bg, #f4f4f5);
	border-bottom: 1px solid var(--khds-border, #e4e4e7);
	font-size: 13px;
	color: #3f3f46;
}

.khds-topbar__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 8px 30px;
	min-height: 36px;
}

.khds-topbar__left {
	display: flex;
	align-items: center;
	gap: 16px;
	min-width: 0;
	flex: 1;
}

.khds-topbar__date {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	white-space: nowrap;
	font-weight: 500;
	color: #27272a;
}

.khds-ticker {
	display: flex;
	align-items: center;
	gap: 8px;
	min-width: 0;
	flex: 1;
}

.khds-ticker__label {
	background-color: var(--khds-primary, #207daf);
	color: #ffffff;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	padding: 2px 8px;
	border-radius: 2px;
	white-space: nowrap;
}

.khds-ticker__list {
	list-style: none;
	margin: 0;
	padding: 0;
	position: relative;
	min-width: 0;
	flex: 1;
	height: 22px;
	overflow: hidden;
}

.khds-ticker__item {
	display: none;
	line-height: 22px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.khds-ticker__item.is-active {
	display: block;
}

.khds-ticker__item a {
	color: #27272a;
	text-decoration: none;
	font-weight: 500;
}

.khds-ticker__item a:hover {
	color: var(--khds-primary, #207daf);
}

.khds-topbar__right {
	display: flex;
	align-items: center;
	gap: 8px;
}

.khds-topbar__tool {
	display: inline-flex;
	align-items: center;
	padding: 2px 10px;
	background-color: #27272a;
	color: #ffffff !important;
	font-size: 12px;
	font-weight: 600;
	border-radius: 2px;
	text-decoration: none;
	white-space: nowrap;
}

.khds-topbar__tool:hover {
	background-color: var(--khds-primary, #207daf);
}

.khds-social-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	color: #3f3f46;
	border-radius: 3px;
}

.khds-social-link:hover {
	color: var(--khds-primary, #207daf);
	background-color: #e4e4e7;
}

/* Nút Home đầu thanh menu chính (trắng trên nền tối, hover xanh như ColorMag 01) */
.main-navigation .khds-nav-home > a {
	background-color: transparent;
	color: #ffffff;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
}

.main-navigation .khds-nav-home > a:hover {
	background-color: var(--khds-primary, #207daf);
}

/* --- Trang chủ --- */
.home .inside-article,
.home .site-main {
	margin: 0;
}

.home.separate-containers .site-content {
	padding: 24px 30px 40px;
}

/* --- Nhãn chuyên mục màu ColorMag --- */
.khds-badges {
	display: flex;
	flex-wrap: wrap;
	gap: 5px;
	margin-bottom: 8px;
}

.khds-badge {
	display: inline-block;
	background-color: var(--khds-primary, #207daf);
	color: #ffffff !important;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	padding: 3px 8px;
	border-radius: 2px;
	line-height: 1.3;
	text-decoration: none;
}

.khds-badge:hover {
	filter: brightness(0.9);
}

/* --- Hero Top: Slider (trái) + 2x2 Lưới (phải) --- */
.khds-hero-top {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
	margin-bottom: 30px;
}

.khds-slider {
	position: relative;
	overflow: hidden;
	border-radius: var(--khds-radius, 3px);
	background-color: #18181b;
}

.khds-slider__track {
	position: relative;
	width: 100%;
	height: 100%;
}

.khds-slider__slide {
	display: none;
	height: 100%;
}

.khds-slider__slide.is-active {
	display: block;
}

.khds-slider__btn {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 4;
	width: 44px;
	height: 44px;
	border: 0;
	border-radius: 3px;
	background: rgba(0, 0, 0, 0.55);
	color: #ffffff;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
}

.khds-slider__btn:hover {
	background: var(--khds-primary, #207daf);
}

.khds-slider__btn--prev {
	left: 10px;
}

.khds-slider__btn--next {
	right: 10px;
}

.khds-highlight-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
}

/* --- Card Overlay (Slider & 2x2 Grid) --- */
.khds-card--overlay {
	position: relative;
	overflow: hidden;
	border-radius: var(--khds-radius, 3px);
	background-color: #27272a;
	height: 100%;
}

.khds-card--slider .khds-card__thumb {
	aspect-ratio: 16 / 10.3;
	height: 100%;
}

.khds-card--highlight .khds-card__thumb {
	aspect-ratio: 16 / 10;
	height: 100%;
}

.khds-card__thumb {
	display: block;
	overflow: hidden;
	background-color: #e4e4e7;
	aspect-ratio: 16 / 10;
}

.khds-card__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.25s ease;
}

.khds-card:hover .khds-card__img {
	transform: scale(1.03);
}

.khds-card__noimg {
	display: block;
	width: 100%;
	height: 100%;
	background: linear-gradient(135deg, #27272a 0%, #3f3f46 100%);
}

.khds-card--overlay .khds-card__body {
	position: absolute;
	inset: auto 0 0 0;
	padding: 40px 14px 14px;
	background: linear-gradient(to top, rgba(0, 0, 0, 0.88) 0%, rgba(0, 0, 0, 0.45) 60%, rgba(0, 0, 0, 0) 100%);
	color: #ffffff;
	z-index: 2;
}

.khds-card--slider .khds-card__body {
	padding: 56px 20px 20px;
}

.khds-card--overlay .khds-card__title {
	margin: 0 0 6px;
	font-weight: 700;
	line-height: 1.35;
}

.khds-card--slider .khds-card__title {
	font-size: 21px;
}

.khds-card--highlight .khds-card__title {
	font-size: 14.5px;
}

.khds-card--overlay .khds-card__title a {
	color: #ffffff;
	text-decoration: none;
}

.khds-card--overlay .khds-card__title a:hover {
	text-decoration: underline;
}

.khds-card__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 12px;
	font-size: 12px;
	color: var(--khds-muted, #52525b);
}

.khds-card--overlay .khds-card__meta {
	color: #e4e4e7;
}

.khds-card__date,
.khds-card__author {
	display: inline-flex;
	align-items: center;
	gap: 4px;
}

/* --- Bố cục 2 cột thân trang (70% / 30%) --- */
.khds-home-layout {
	display: grid;
	grid-template-columns: minmax(0, 2.25fr) minmax(0, 1fr);
	gap: 28px;
	align-items: start;
}

.khds-sec {
	margin-bottom: 30px;
}

.khds-sec-head {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 12px;
	border-bottom: 2px solid var(--khds-primary, #207daf);
	margin-bottom: 18px;
}

.khds-sec-title {
	margin: 0;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.25;
}

.khds-sec-title a,
.khds-sec-title span {
	display: inline-block;
	background-color: var(--khds-primary, #207daf);
	color: #ffffff;
	padding: 6px 14px;
	border-radius: 2px 2px 0 0;
	text-decoration: none;
}

.khds-sec-more {
	font-size: 13px;
	font-weight: 600;
	color: var(--khds-primary, #207daf);
	text-decoration: none;
	padding-bottom: 6px;
	white-space: nowrap;
}

.khds-sec-more:hover {
	text-decoration: underline;
}

/* Style 1: 1 lớn trái + danh sách nhỏ phải */
.khds-style1-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 20px;
	align-items: start;
}

.khds-card--large .khds-card__thumb {
	border-radius: var(--khds-radius, 3px);
	margin-bottom: 12px;
}

.khds-card--large .khds-card__title {
	font-size: 18px;
	font-weight: 700;
	line-height: 1.4;
	margin: 0 0 8px;
}

.khds-card--large .khds-card__title a {
	color: #18181b;
	text-decoration: none;
}

.khds-card--large .khds-card__title a:hover {
	color: var(--khds-primary, #207daf);
}

.khds-card__excerpt {
	margin: 8px 0 0;
	font-size: 14px;
	color: #4b5563;
	line-height: 1.6;
}

/* Danh sách thẻ nhỏ ngang */
.khds-compact-list {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.khds-card--compact {
	display: grid;
	grid-template-columns: 112px minmax(0, 1fr);
	gap: 12px;
	align-items: start;
}

.khds-card--compact .khds-card__thumb {
	width: 112px;
	aspect-ratio: 16 / 11;
	border-radius: var(--khds-radius, 3px);
}

.khds-card--compact .khds-card__title {
	font-size: 14px;
	font-weight: 600;
	line-height: 1.4;
	margin: 0 0 5px;
}

.khds-card--compact .khds-card__title a {
	color: #18181b;
	text-decoration: none;
}

.khds-card--compact .khds-card__title a:hover {
	color: var(--khds-primary, #207daf);
}

/* Half Row: 2 cột song song giống Fashion & Sports trong ColorMag 01 */
.khds-half-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 24px;
}

.khds-style2-wrap {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

/* Nút xem thêm phân trang trang chủ */
.khds-home-more {
	margin: 8px 0 0;
}

.khds-btn-more {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding: 0 20px;
	border: 1px solid var(--khds-primary, #207daf);
	color: var(--khds-primary, #207daf);
	border-radius: var(--khds-radius, 3px);
	font-weight: 600;
	font-size: 14px;
	text-decoration: none;
}

.khds-btn-more:hover {
	background-color: var(--khds-primary, #207daf);
	color: #ffffff;
}

/* --- Lưới 2 cột trang chuyên mục / tìm kiếm / /page/2/ --- */
body.khds-archive-grid .site-main {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 20px;
	align-items: stretch;
}

body.khds-archive-grid .page-header,
body.khds-archive-grid .paging-navigation,
body.khds-archive-grid .khds-breadcrumb,
body.khds-archive-grid .no-results {
	grid-column: 1 / -1;
}

body.khds-archive-grid .page-header {
	background: #f8fafc;
	border-left: 4px solid var(--khds-primary, #207daf);
	padding: 16px 20px;
	margin-bottom: 4px;
}

body.khds-archive-grid .page-title {
	margin: 0;
	font-size: 24px;
}

body.khds-archive-grid article.post,
body.khds-archive-grid article.page {
	margin: 0;
	border: 1px solid var(--khds-border, #e4e4e7);
	border-radius: var(--khds-radius, 3px);
	background: #ffffff;
	display: flex;
	flex-direction: column;
}

body.khds-archive-grid .inside-article {
	padding: 16px;
	display: flex;
	flex-direction: column;
	height: 100%;
}

body.khds-archive-grid .post-image {
	margin: -16px -16px 14px;
	overflow: hidden;
}

body.khds-archive-grid .post-image img {
	width: 100%;
	aspect-ratio: 16 / 10;
	object-fit: cover;
	display: block;
}

body.khds-archive-grid .entry-title {
	font-size: 18px;
	line-height: 1.4;
	margin-bottom: 8px;
}

body.khds-archive-grid .entry-summary {
	font-size: 14px;
	color: #4b5563;
	margin-top: 10px;
}

/* --- Chi tiết bài viết & Breadcrumb --- */
.khds-breadcrumb {
	font-size: 13px;
	color: var(--khds-muted, #52525b);
	margin-bottom: 14px;
}

.khds-breadcrumb a {
	color: var(--khds-primary, #207daf);
	text-decoration: none;
}

.khds-breadcrumb a:hover {
	text-decoration: underline;
}

.khds-read-time {
	color: var(--khds-muted, #52525b);
	font-size: 13px;
}

.khds-related {
	margin-top: 32px;
	padding-top: 24px;
	border-top: 1px solid var(--khds-border, #e4e4e7);
}

.khds-related__grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 18px;
}

.khds-related .khds-card--large .khds-card__title {
	font-size: 15px;
}

/* --- Vị trí quảng cáo kiểu ColorMag 01 --- */
.khds-header-ad-wrap {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	justify-content: flex-end;
	max-width: 780px;
}

.khds-ad--header {
	width: 100%;
	min-width: 250px;
	max-width: 780px;
}

.khds-ad--mid {
	margin: 0 0 28px;
	text-align: center;
}

.khds-ad--sidebar {
	margin: 0 0 24px;
	display: flex;
	justify-content: center;
}

@media (max-width: 768px) {
	.inside-header {
		flex-direction: column;
		align-items: center;
		gap: 12px;
	}
	.khds-header-ad-wrap {
		width: 100%;
		max-width: 100%;
		justify-content: center;
	}
	.khds-ad--header {
		max-width: 100%;
	}
}

/* --- Footer Legal Links --- */
.khds-legal__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 8px 16px;
}

/* --- Responsive --- */
@media (max-width: 959px) {
	.khds-hero-top {
		grid-template-columns: 1fr;
	}
	.khds-home-layout {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 768px) {
	.khds-topbar__inner,
	.inside-header,
	.home.separate-containers .site-content,
	.site-footer .footer-widgets,
	.site-info {
		padding-left: 14px;
		padding-right: 14px;
	}
	.khds-topbar__date {
		display: none;
	}
	.khds-style1-grid,
	.khds-half-row,
	.khds-related__grid,
	body.khds-archive-grid .site-main {
		grid-template-columns: 1fr;
	}
	.khds-card--slider .khds-card__title {
		font-size: 17px;
	}
}

@media (max-width: 480px) {
	.khds-highlight-grid {
		grid-template-columns: 1fr;
	}
	.khds-card--compact {
		grid-template-columns: 96px minmax(0, 1fr);
		gap: 10px;
	}
	.khds-card--compact .khds-card__thumb {
		width: 96px;
	}
}
