.yt-gallery {
	display: grid !important;
	grid-template-columns: repeat(var(--yt-gallery-columns, 3), minmax(0, 1fr)) !important;
	gap: 28px 20px;
	margin: 24px 0;
	list-style: none;
	padding: 0;
}
@media (max-width: 900px) {
	.yt-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}
@media (max-width: 560px) {
	.yt-gallery { grid-template-columns: minmax(0, 1fr) !important; }
}
.yt-gallery__item {
	display: flex;
	flex-direction: column;
	width: 100% !important;
	max-width: 100%;
	text-align: left;
	background: none;
	border: none;
	padding: 0;
	margin: 0;
	cursor: pointer;
	font: inherit;
	color: inherit;
	float: none;
}
.yt-gallery__item:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 4px;
	border-radius: 10px;
}
.yt-gallery__thumb-wrap {
	position: relative;
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
	border-radius: 10px;
	overflow: hidden;
	background: #111;
}
.yt-gallery__thumb {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 220ms ease;
}
.yt-gallery__item:hover .yt-gallery__thumb { transform: scale(1.04); }
.yt-gallery__play {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%) scale(1);
	width: 52px;
	height: 52px;
	border-radius: 50%;
	background: rgba(204, 0, 0, 0.9);
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform 180ms ease, background 180ms ease;
}
.yt-gallery__item:hover .yt-gallery__play {
	background: rgba(20, 20, 20, 0.85);
	transform: translate(-50%, -50%) scale(1.08);
}
/* Scoped to the item so the <h3> stays a plain, unclassed heading in the
   markup and still inherits the site's theme styling — this just keeps
   cards in the same row aligned when titles wrap to different lengths. */
.yt-gallery__item h3 {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	margin: 10px 0 0;
	min-height: calc(1.4em * 2);
}
.yt-gallery-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	background: rgba(0, 0, 0, 0.92);
	display: none;
	align-items: center;
	justify-content: center;
	padding: min(4vw, 32px);
}
.yt-gallery-modal.is-open { display: flex; }
.yt-gallery-modal__frame-wrap {
	width: 100%;
	max-width: 1100px;
	aspect-ratio: 16 / 9;
	background: #000;
	border-radius: 8px;
	overflow: hidden;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.yt-gallery-modal__frame-wrap iframe {
	width: 100%;
	height: 100%;
	border: none;
}
.yt-gallery-modal__close {
	position: absolute;
	top: 20px;
	right: 24px;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	border: none;
	background: rgba(255, 255, 255, 0.1);
	color: #fff;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
}
