/* SMP Content Views — frontend */
.smp-cv {
	--smp-cv-cols: 3;
	--smp-cv-cols-t: 2;
	--smp-cv-cols-m: 1;
	--smp-cv-gap: 24px;
	--smp-cv-radius: 12px;
	--smp-cv-accent: #2563eb;
	--smp-cv-ratio: 16 / 9;
	--smp-cv-text: inherit;
	--smp-cv-muted: #6b7280;
	--smp-cv-card-bg: #fff;
	--smp-cv-border: rgba(0, 0, 0, .08);
	--smp-cv-cur-cols: var(--smp-cv-cols);
	margin: 0 0 1.5em;
	box-sizing: border-box;
}
.smp-cv *,
.smp-cv *::before,
.smp-cv *::after { box-sizing: border-box; }
.smp-cv { font-size: 1rem; line-height: 1.5; }
.smp-cv-body > * { margin-block: 0; }
.smp-cv--slider .smp-cv-title,
.smp-cv-grid .smp-cv-title { overflow-wrap: anywhere; }

@media (max-width: 1024px) { .smp-cv { --smp-cv-cur-cols: var(--smp-cv-cols-t); } }
@media (max-width: 640px)  { .smp-cv { --smp-cv-cur-cols: var(--smp-cv-cols-m); } }

/* ---------- Grid / List ---------- */
.smp-cv-grid {
	display: grid;
	grid-template-columns: repeat(var(--smp-cv-cur-cols), minmax(0, 1fr));
	gap: var(--smp-cv-gap);
}

/* ---------- Card ---------- */
.smp-cv-card {
	position: relative;
	display: flex;
	flex-direction: column;
	height: 100%;
	background: var(--smp-cv-card-bg);
	border: 1px solid var(--smp-cv-border);
	border-radius: var(--smp-cv-radius);
	overflow: hidden;
	transition: transform .2s ease, box-shadow .2s ease;
}
.smp-cv--shadow .smp-cv-card { box-shadow: 0 2px 10px rgba(0, 0, 0, .06); border-color: transparent; }
.smp-cv--shadow .smp-cv-card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(0, 0, 0, .1); }

.smp-cv-thumb {
	position: relative;
	display: block;
	overflow: hidden;
	aspect-ratio: var(--smp-cv-ratio);
	background: #f3f4f6;
}
.smp-cv-thumb img,
.smp-cv-img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .4s ease;
}
.smp-cv-card:hover .smp-cv-thumb img { transform: scale(1.04); }

.smp-cv-badge {
	position: absolute;
	top: 10px;
	left: 10px;
	padding: 3px 10px;
	font-size: 12px;
	font-weight: 600;
	color: #fff;
	background: var(--smp-cv-accent);
	border-radius: 999px;
}

.smp-cv-body {
	display: flex;
	flex-direction: column;
	gap: 8px;
	flex: 1;
	padding: 16px 18px 18px;
}
.smp-cv-cat {
	font-size: 12px;
	font-weight: 600;
	letter-spacing: .03em;
	text-transform: uppercase;
	color: var(--smp-cv-accent);
}
.smp-cv-cat a { color: inherit; text-decoration: none; }
.smp-cv-title {
	margin: 0 !important;
	font-size: 1.125rem !important;
	font-weight: 600;
	line-height: 1.4 !important;
	letter-spacing: normal;
}
.smp-cv-title a { color: var(--smp-cv-text); text-decoration: none; }
.smp-cv-title a:hover { color: var(--smp-cv-accent); }
.smp-cv-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 12px;
	font-size: 13px;
	color: var(--smp-cv-muted);
}
.smp-cv-excerpt {
	margin: 0 !important;
	font-size: .9375rem;
	line-height: 1.6;
	color: var(--smp-cv-muted);
}
.smp-cv-more {
	margin-top: auto;
	align-self: flex-start;
	padding-top: 4px;
	font-size: 14px;
	font-weight: 600;
	color: var(--smp-cv-accent);
	text-decoration: none;
}
.smp-cv-more:hover { text-decoration: underline; }

/* ---------- List: ảnh trái, nội dung phải ---------- */
.smp-cv--list .smp-cv-card { flex-direction: row; }
.smp-cv--list .smp-cv-thumb { flex: 0 0 38%; max-width: 280px; aspect-ratio: var(--smp-cv-ratio); align-self: flex-start; }
.smp-cv--list .smp-cv-body { padding: 14px 18px; }
@media (max-width: 480px) {
	.smp-cv--list .smp-cv-thumb { flex-basis: 36%; }
	.smp-cv--list .smp-cv-body { padding: 10px 12px; gap: 4px; }
	.smp-cv--list .smp-cv-excerpt { display: none; }
}

/* ---------- Overlay card ---------- */
.smp-cv-card--overlay { border: 0; }
.smp-cv-overlay-link { position: relative; display: block; height: 100%; color: #fff; text-decoration: none; }
.smp-cv-card--overlay .smp-cv-thumb { height: 100%; }
.smp-cv-card--noimg .smp-cv-thumb { background: var(--smp-cv-accent); min-height: 220px; }
.smp-cv-overlay {
	position: absolute;
	inset: auto 0 0 0;
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 40px 18px 18px;
	background: linear-gradient(to top, rgba(0, 0, 0, .78), rgba(0, 0, 0, 0));
}
.smp-cv-overlay .smp-cv-cat { color: #fff; opacity: .9; }
.smp-cv-overlay .smp-cv-title { color: #fff; }
.smp-cv-overlay .smp-cv-meta { color: rgba(255, 255, 255, .8); }

/* ---------- Slider ---------- */
.smp-cv-slider { position: relative; }
.smp-cv-track {
	display: flex;
	gap: var(--smp-cv-gap);
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
	padding: 4px 2px 12px;
	outline: none;
}
.smp-cv-track::-webkit-scrollbar { display: none; }
.smp-cv-slide {
	flex: 0 0 calc((100% - (var(--smp-cv-cur-cols) - 1) * var(--smp-cv-gap)) / var(--smp-cv-cur-cols));
	scroll-snap-align: start;
	min-width: 0;
}
.smp-cv-nav {
	position: absolute;
	top: 40%;
	z-index: 2;
	width: 40px;
	height: 40px;
	padding: 0;
	font-size: 26px;
	line-height: 38px;
	color: #111;
	background: #fff;
	border: 1px solid var(--smp-cv-border);
	border-radius: 50%;
	box-shadow: 0 4px 12px rgba(0, 0, 0, .12);
	cursor: pointer;
	transform: translateY(-50%);
	transition: opacity .2s, background .2s;
}
.smp-cv-nav:hover { background: var(--smp-cv-accent); color: #fff; }
.smp-cv-nav[disabled] { opacity: .3; cursor: default; }
.smp-cv-prev { left: -12px; }
.smp-cv-next { right: -12px; }
@media (max-width: 640px) { .smp-cv-nav { display: none; } }

.smp-cv-dots { display: flex; justify-content: center; gap: 8px; margin-top: 6px; }
.smp-cv-dot {
	width: 8px;
	height: 8px;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: #d1d5db;
	cursor: pointer;
	transition: width .2s, background .2s;
}
.smp-cv-dot.is-active { width: 22px; background: var(--smp-cv-accent); }

/* ---------- Tab lọc ---------- */
.smp-cv-filter {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0 0 18px;
}
.smp-cv-filter-btn {
	padding: 7px 16px;
	font: inherit;
	font-size: 14px;
	line-height: 1.3;
	color: var(--smp-cv-text);
	background: transparent;
	border: 1px solid var(--smp-cv-border);
	border-radius: 999px;
	cursor: pointer;
	transition: background .2s, color .2s, border-color .2s;
}
.smp-cv-filter-btn:hover { border-color: var(--smp-cv-accent); color: var(--smp-cv-accent); }
.smp-cv-filter-btn.is-active { background: var(--smp-cv-accent); border-color: var(--smp-cv-accent); color: #fff; }
@media (max-width: 640px) {
	.smp-cv-filter { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
	.smp-cv-filter::-webkit-scrollbar { display: none; }
	.smp-cv-filter-btn { flex: 0 0 auto; }
}

/* ---------- Phân trang ---------- */
.smp-cv-pagination { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 24px; }
.smp-cv-pagination[hidden] { display: none; }
.smp-cv-page {
	min-width: 38px;
	height: 38px;
	padding: 0 10px;
	font: inherit;
	font-size: 14px;
	color: var(--smp-cv-text);
	background: transparent;
	border: 1px solid var(--smp-cv-border);
	border-radius: 8px;
	cursor: pointer;
}
.smp-cv-page:hover:not([disabled]) { border-color: var(--smp-cv-accent); color: var(--smp-cv-accent); }
.smp-cv-page.is-active { background: var(--smp-cv-accent); border-color: var(--smp-cv-accent); color: #fff; cursor: default; }
.smp-cv-page[disabled] { opacity: .35; cursor: default; }
.smp-cv-page-gap { padding: 0 4px; color: var(--smp-cv-muted); }
.smp-cv-loadmore {
	padding: 11px 28px;
	font: inherit;
	font-size: 15px;
	font-weight: 600;
	color: var(--smp-cv-accent);
	background: transparent;
	border: 1.5px solid var(--smp-cv-accent);
	border-radius: 999px;
	cursor: pointer;
	transition: background .2s, color .2s;
}
.smp-cv-loadmore:hover { background: var(--smp-cv-accent); color: #fff; }
.smp-cv-pagination--infinite .smp-cv-loadmore { border-color: transparent; font-weight: 500; color: var(--smp-cv-muted); }

/* ---------- Đang tải / trống ---------- */
.smp-cv.is-loading .smp-cv-items { opacity: .45; pointer-events: none; transition: opacity .2s; }
.smp-cv.is-loading .smp-cv-loadmore { position: relative; color: transparent !important; }
.smp-cv.is-loading .smp-cv-loadmore::after {
	content: "";
	position: absolute;
	inset: 0;
	margin: auto;
	width: 18px;
	height: 18px;
	border: 2px solid var(--smp-cv-accent);
	border-right-color: transparent;
	border-radius: 50%;
	animation: smp-cv-spin .7s linear infinite;
}
@keyframes smp-cv-spin { to { transform: rotate(360deg); } }
.smp-cv-noresult { margin: 8px 0 0; padding: 28px 16px; text-align: center; color: var(--smp-cv-muted); border: 1px dashed var(--smp-cv-border); border-radius: var(--smp-cv-radius); }
.smp-cv-noresult[hidden] { display: none; }
.smp-cv-fresh { scroll-margin-top: 80px; }
@media (prefers-reduced-motion: reduce) {
	.smp-cv-card, .smp-cv-thumb img, .smp-cv-track { transition: none !important; scroll-behavior: auto !important; }
}
