/* HSV YouTube Showcase */

.hsv-yts {
	--hsv-yts-accent: #ff0000;
	--hsv-yts-cols: 3;
	--hsv-yts-border: #e5e7eb;
	--hsv-yts-text: #111827;
	--hsv-yts-muted: #6b7280;
	--hsv-yts-bg: #ffffff;
	--hsv-yts-radius: 12px;

	margin: 24px 0;
	max-width: 100%;
	background: var(--hsv-yts-bg);
	color: var(--hsv-yts-text);
	border: 1px solid var(--hsv-yts-border);
	border-radius: var(--hsv-yts-radius);
	overflow: hidden;
	line-height: 1.5;
}

.hsv-yts *,
.hsv-yts *::before,
.hsv-yts *::after {
	box-sizing: border-box;
}

/* ---------- Header kênh ---------- */

.hsv-yts__header {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 16px 20px;
	border-bottom: 1px solid var(--hsv-yts-border);
}

.hsv-yts__avatar {
	flex: 0 0 auto;
	display: block;
	width: 60px;
	height: 60px;
	border-radius: 50%;
	overflow: hidden;
	background: #f3f4f6;
	text-decoration: none;
}

.hsv-yts__avatar img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	border-radius: 50%;
}

.hsv-yts__avatar-fallback {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	background: var(--hsv-yts-accent);
	color: #fff;
	font-size: 24px;
	font-weight: 700;
	text-transform: uppercase;
}

.hsv-yts__meta {
	flex: 1 1 180px;
	min-width: 0;
}

.hsv-yts__name {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 20px;
	font-weight: 700;
	line-height: 1.25;
	margin: 0;
}

.hsv-yts__name a {
	color: inherit;
	text-decoration: none;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.hsv-yts__name a:hover {
	color: var(--hsv-yts-accent);
}

.hsv-yts__verified {
	display: inline-flex;
	color: #1d9bf0;
	flex: 0 0 auto;
}

.hsv-yts__verified svg {
	display: block;
}

.hsv-yts__stats {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 4px;
	font-size: 14px;
	color: var(--hsv-yts-muted);
}

.hsv-yts__dot {
	opacity: .7;
}

.hsv-yts__cta {
	flex: 0 0 auto;
	margin-left: auto;
}

/* Nút đăng ký chính thức của YouTube (iframe do apis.google.com dựng). */
.hsv-yts__cta .g-ytsubscribe {
	display: inline-block;
	line-height: 0;
	min-height: 24px;
}

.hsv-yts__cta .g-ytsubscribe iframe {
	max-width: 100%;
}

.hsv-yts__subscribe {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 11px 20px;
	border-radius: 8px;
	background: var(--hsv-yts-accent);
	color: #fff !important;
	font-size: 15px;
	font-weight: 600;
	line-height: 1;
	text-decoration: none !important;
	border: 0;
	transition: filter .2s ease, transform .2s ease;
}

.hsv-yts__subscribe:hover {
	filter: brightness(.88);
	transform: translateY(-1px);
	color: #fff !important;
}

.hsv-yts__subscribe svg {
	display: block;
	flex: 0 0 auto;
}

/* ---------- Danh sách video ---------- */

.hsv-yts__body {
	padding: 20px;
}

.hsv-yts__section-title {
	margin: 0 0 16px;
	font-size: 17px;
	font-weight: 700;
	line-height: 1.3;
	color: var(--hsv-yts-text);
}

.hsv-yts__grid {
	display: grid;
	grid-template-columns: repeat(var(--hsv-yts-cols), minmax(0, 1fr));
	gap: 20px;
}

.hsv-yts__item {
	min-width: 0;
}

.hsv-yts__thumb {
	position: relative;
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
	border-radius: 10px;
	overflow: hidden;
	background: #000;
	text-decoration: none;
}

@supports not (aspect-ratio: 16 / 9) {
	.hsv-yts__thumb {
		height: 0;
		padding-top: 56.25%;
	}
}

.hsv-yts__thumb img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	margin: 0;
	transition: transform .35s ease;
}

.hsv-yts__thumb:hover img {
	transform: scale(1.06);
}

.hsv-yts__play {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	display: block;
	pointer-events: none;
	opacity: .92;
	transition: opacity .2s ease, transform .2s ease;
}

.hsv-yts__play svg {
	display: block;
	filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .35));
}

.hsv-yts__play-bg {
	fill: var(--hsv-yts-accent);
}

.hsv-yts__thumb:hover .hsv-yts__play {
	opacity: 1;
	transform: translate(-50%, -50%) scale(1.08);
}

.hsv-yts__duration {
	position: absolute;
	right: 8px;
	bottom: 8px;
	padding: 2px 6px;
	border-radius: 4px;
	background: rgba(0, 0, 0, .8);
	color: #fff;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.5;
}

.hsv-yts__video-title {
	margin: 10px 0 6px;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.45;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.hsv-yts__video-title a {
	color: inherit;
	text-decoration: none;
}

.hsv-yts__video-title a:hover {
	color: var(--hsv-yts-accent);
}

.hsv-yts__video-meta {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 6px;
	font-size: 13px;
	color: var(--hsv-yts-muted);
}

/* ---------- Nút xem thêm ---------- */

.hsv-yts__more {
	margin-top: 20px;
	text-align: center;
}

.hsv-yts__more-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 10px 24px;
	border: 1px solid var(--hsv-yts-accent);
	border-radius: 999px;
	color: var(--hsv-yts-accent) !important;
	font-size: 15px;
	font-weight: 600;
	line-height: 1;
	text-decoration: none !important;
	background: transparent;
	transition: background .2s ease, color .2s ease;
}

.hsv-yts__more-btn:hover {
	background: var(--hsv-yts-accent);
	color: #fff !important;
}

/* ---------- Popup phát video ---------- */

.hsv-yts-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
}

.hsv-yts-modal[hidden] {
	display: none;
}

.hsv-yts-modal__overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, .82);
}

.hsv-yts-modal__box {
	position: relative;
	width: 100%;
	max-width: 960px;
}

.hsv-yts-modal__frame {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	background: #000;
	border-radius: 10px;
	overflow: hidden;
}

@supports not (aspect-ratio: 16 / 9) {
	.hsv-yts-modal__frame {
		height: 0;
		padding-top: 56.25%;
	}
}

.hsv-yts-modal__frame iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

.hsv-yts-modal__close {
	position: absolute;
	top: -42px;
	right: 0;
	width: 36px;
	height: 36px;
	padding: 0;
	background: transparent;
	border: 0;
	color: #fff;
	font-size: 34px;
	line-height: 1;
	cursor: pointer;
}

/* ---------- Thông báo cho quản trị viên ---------- */

.hsv-yts-warning {
	padding: 10px 14px;
	border-left: 4px solid #f0b849;
	border-radius: 4px;
	background: #fff8e5;
	color: #664d03;
	font-size: 14px;
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
	.hsv-yts__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 600px) {
	.hsv-yts__header {
		flex-wrap: wrap;
		padding: 14px 16px;
	}

	.hsv-yts__avatar {
		width: 48px;
		height: 48px;
	}

	.hsv-yts__name {
		font-size: 17px;
	}

	.hsv-yts__stats {
		font-size: 13px;
	}

	.hsv-yts__cta {
		margin-left: 0;
		width: 100%;
	}

	.hsv-yts__subscribe {
		width: 100%;
	}

	.hsv-yts__body {
		padding: 16px;
	}

	.hsv-yts__grid {
		grid-template-columns: 1fr;
		gap: 18px;
	}
}
