/* [Total_Soft_Gallery_Video] replacement: YouTube thumbnail grid + dialog player */

.sf-video-gallery {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 16px;
	margin: 1.5em 0;
	padding: 0;
	list-style: none;
}

.sf-video-gallery li {
	margin: 0;
	padding: 0;
}

.sf-video {
	display: block;
	width: 100%;
	padding: 0;
	border: 0;
	background: none;
	text-align: left;
	cursor: pointer;
	font: inherit;
	color: inherit;
}

.sf-video-thumb {
	position: relative;
	display: block;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	background: #000;
}

.sf-video-thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: opacity .2s;
}

.sf-video:hover .sf-video-thumb img,
.sf-video:focus-visible .sf-video-thumb img {
	opacity: .8;
}

.sf-video:focus-visible {
	outline: 3px solid #008080;
	outline-offset: 2px;
}

/* Play badge */
.sf-video-play {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 56px;
	height: 40px;
	margin: -20px 0 0 -28px;
	border-radius: 10px;
	background: rgba(0, 0, 0, .7);
}

.sf-video-play::after {
	content: "";
	position: absolute;
	top: 12px;
	left: 23px;
	border-style: solid;
	border-width: 8px 0 8px 14px;
	border-color: transparent transparent transparent #fff;
}

.sf-video-title {
	display: block;
	margin-top: .5em;
	font-size: .9em;
	line-height: 1.3;
}

/* Player dialog */
.sf-video-dialog {
	width: min(960px, 92vw);
	padding: 0;
	border: 0;
	background: #000;
}

.sf-video-dialog::backdrop {
	background: rgba(0, 0, 0, .8);
}

.sf-video-dialog iframe {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
	border: 0;
}

.sf-video-close {
	position: absolute;
	top: -2.2em;
	right: 0;
	padding: .2em .5em;
	border: 0;
	background: none;
	color: #fff;
	font-size: 1.4em;
	line-height: 1;
	cursor: pointer;
}

.sf-video-dialog[open] {
	overflow: visible;
}
