/* Jero video: 16:9 box filled by the YouTube player or a self-hosted <video> (video.js). */
.jero-video,
.yt-autoplay {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	background: #000;
}
.jero-video iframe,
.yt-autoplay iframe,
.jero-video video {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}
.jero-video video { object-fit: cover; }
.jero-video--file {
	background-position: center;
	background-size: cover; /* the poster, set inline by file.php */
}

/* Touch screens: a transparent layer takes the first tap to show the controls, then lets taps
   through while they show (video.js). Not used with a mouse: hover shows them. */
.jero-video__tap {
	position: absolute;
	inset: 0;
	z-index: 1;
}
.jero-video.is-active .jero-video__tap { pointer-events: none; }
@media (hover: hover) and (pointer: fine) {
	.jero-video__tap { display: none; }
}

/* Our controls, shown on hover, keyboard focus, or after a tap (video.js). Hidden, they stay
   focusable but can't be clicked.
   - YouTube (data-controls="custom"): a single sound button, bottom left.
   - Files (.jero-video--file): a bar along the bottom over a soft gradient: play/pause,
     progress, sound, full screen. */
.jero-video__controls {
	position: absolute;
	left: 10px;
	bottom: 10px;
	z-index: 2;
	display: flex;
	align-items: center;
	gap: 2px;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.25s ease;
}
.jero-video--file .jero-video__controls {
	left: 0;
	right: 0;
	bottom: 0;
	padding: 28px 8px 6px;
	background: linear-gradient(to top, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0));
}
.jero-video.is-active .jero-video__controls,
.jero-video:has(.jero-video__controls :focus-visible) .jero-video__controls {
	opacity: 1;
	pointer-events: auto;
}
@media (hover: hover) and (pointer: fine) {
	.jero-video:hover .jero-video__controls {
		opacity: 1;
		pointer-events: auto;
	}
}
.jero-video__btn {
	display: grid;
	flex: none;
	place-items: center;
	width: 34px;
	height: 34px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: #fff;
	cursor: pointer;
	transition: background 0.2s ease;
}
.jero-video__btn[hidden] { display: none; }
.jero-video__btn svg {
	width: 20px;
	height: 20px;
	filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35));
}
.jero-video__btn:hover { background: rgba(255, 255, 255, 0.14); }
.jero-video__btn:focus-visible,
.jero-video__progress:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 1px;
}
/* YouTube's single button sits on the picture without the gradient: a light glass disc. */
.jero-video:not(.jero-video--file) .jero-video__btn {
	background: rgba(0, 0, 0, 0.35);
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
}
.jero-video:not(.jero-video--file) .jero-video__btn:hover { background: rgba(0, 0, 0, 0.55); }

/* Progress: a hairline track that shows its handle on hover/focus/tap (--jero-progress is set
   by video.js; Firefox fills it with ::-moz-range-progress). */
.jero-video__progress {
	--jero-progress: 0%;
	flex: 1;
	min-width: 0;
	height: 20px;
	margin: 0 6px;
	padding: 0;
	background: transparent;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}
.jero-video__progress::-webkit-slider-runnable-track {
	height: 3px;
	border-radius: 3px;
	background: linear-gradient(to right, #fff var(--jero-progress), rgba(255, 255, 255, 0.35) var(--jero-progress));
}
.jero-video__progress::-moz-range-track {
	height: 3px;
	border-radius: 3px;
	background: rgba(255, 255, 255, 0.35);
}
.jero-video__progress::-moz-range-progress {
	height: 3px;
	border-radius: 3px;
	background: #fff;
}
.jero-video__progress::-webkit-slider-thumb {
	width: 11px;
	height: 11px;
	margin-top: -4px;
	border: 0;
	border-radius: 50%;
	background: #fff;
	transform: scale(0);
	transition: transform 0.15s ease;
	-webkit-appearance: none;
	appearance: none;
}
.jero-video__progress::-moz-range-thumb {
	width: 11px;
	height: 11px;
	border: 0;
	border-radius: 50%;
	background: #fff;
	transform: scale(0);
	transition: transform 0.15s ease;
}
.jero-video__progress:hover::-webkit-slider-thumb,
.jero-video__progress:focus-visible::-webkit-slider-thumb,
.jero-video.is-active .jero-video__progress::-webkit-slider-thumb { transform: scale(1); }
.jero-video__progress:hover::-moz-range-thumb,
.jero-video__progress:focus-visible::-moz-range-thumb,
.jero-video.is-active .jero-video__progress::-moz-range-thumb { transform: scale(1); }

/* Full screen (the whole box, so the bar stays): show the full picture. */
.jero-video:fullscreen { aspect-ratio: auto; }
.jero-video:fullscreen video { object-fit: contain; }
.jero-video__sound {
	position: absolute;
	top: 12px;
	left: 12px;
	z-index: 2;
	padding: 8px 14px;
	border: 0;
	border-radius: 20px;
	background: rgba(0, 0, 0, 0.7);
	color: #fff;
	font-size: 14px;
	line-height: 1;
	cursor: pointer;
	transition: background 0.2s;
}
.jero-video__sound:hover,
.jero-video__sound:focus-visible { background: rgba(0, 0, 0, 0.9); }
.jero-video__sound[hidden] { display: none; }
