.ytvg-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 16px;
	margin: 20px 0;
}

@media (max-width: 640px) {
	.ytvg-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 420px) {
	.ytvg-grid {
		grid-template-columns: 1fr;
	}
}

.ytvg-cell {
	display: flex;
	flex-direction: column;
}

.ytvg-item {
	position: relative;
	display: block;
	width: 100%;
	padding: 0;
	border: none;
	background: #000;
	border-radius: 8px;
	overflow: hidden;
	cursor: pointer;
	aspect-ratio: 16 / 9;
	line-height: 0;
}

.ytvg-item img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.25s ease, opacity 0.25s ease;
}

.ytvg-hover-title {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	padding: 24px 10px 10px;
	background: linear-gradient(to top, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0));
	color: #fff;
	font-size: 13px;
	line-height: 1.3;
	text-align: left;
	opacity: 0;
	transform: translateY(6px);
	transition: opacity 0.2s ease, transform 0.2s ease;
	pointer-events: none;
}

.ytvg-item:hover .ytvg-hover-title,
.ytvg-item:focus-visible .ytvg-hover-title {
	opacity: 1;
	transform: translateY(0);
}

.ytvg-item:hover img {
	transform: scale(1.04);
	opacity: 0.85;
}

.ytvg-play-icon {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 56px;
	height: 56px;
	margin: -28px 0 0 -28px;
	background: rgba(0, 0, 0, 0.65);
	border-radius: 50%;
	pointer-events: none;
}

.ytvg-play-icon::before {
	content: "";
	position: absolute;
	top: 50%;
	left: 54%;
	width: 0;
	height: 0;
	transform: translate(-50%, -50%);
	border-style: solid;
	border-width: 10px 0 10px 16px;
	border-color: transparent transparent transparent #fff;
}

.ytvg-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	overflow-y: auto;
	padding: 40px 16px;
}

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

.ytvg-modal-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.85);
}

.ytvg-modal-content {
	position: relative;
	width: min(90vw, 960px);
	z-index: 1;
	margin: auto;
}

.ytvg-modal-video-wrap {
	position: relative;
	width: 100%;
	padding-top: 56.25%; /* 16:9 */
}

.ytvg-modal-video-wrap iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

.ytvg-modal-close {
	position: absolute;
	top: -40px;
	right: 0;
	background: transparent;
	border: none;
	color: #fff;
	font-size: 32px;
	line-height: 1;
	cursor: pointer;
}

.ytvg-modal-nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	background: rgba(0, 0, 0, 0.5);
	border: none;
	color: #fff;
	font-size: 20px;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	cursor: pointer;
	z-index: 2;
}

.ytvg-modal-nav:hover {
	background: rgba(0, 0, 0, 0.8);
}

.ytvg-modal-prev {
	left: -60px;
}

.ytvg-modal-next {
	right: -60px;
}

@media (max-width: 800px) {
	.ytvg-modal-prev { left: 8px; }
	.ytvg-modal-next { right: 8px; }
}

.ytvg-modal-nav[hidden] {
	display: none;
}

.ytvg-modal-info {
	color: #fff;
	padding: 14px 4px 0;
}

.ytvg-modal-info h3 {
	margin: 0 0 4px;
	font-size: 17px;
}

.ytvg-modal-info p {
	margin: 0;
	font-size: 14px;
	color: rgba(255, 255, 255, 0.8);
}
