/**
 * Gradba video embeds — the facade and the player that replaces it.
 *
 * Prefixed `#wpforo #wpforo-wrap` like everything else that has to out-rank wpForo's own
 * two-ID rules (here: its styling of images and links inside a post).
 *
 * The box is 16:9 at a readable width, not the full width of the post: at 960px a video
 * would push the text that introduces it off the screen. Shorts are upright.
 */

#wpforo #wpforo-wrap .gradba-video {
	position: relative;
	display: block;
	width: 100%;
	max-width: 640px;
	aspect-ratio: 16 / 9;
	margin: 12px 0;
	overflow: hidden;
	border-radius: 12px;
	background: #000;
}
#wpforo #wpforo-wrap .gradba-video--short {
	max-width: 320px;
	aspect-ratio: 9 / 16;
}
#wpforo #wpforo-wrap .gradba-video-link {
	position: absolute;
	inset: 0;
	display: block;
}
/* YouTube's hqdefault is 4:3 with black bars top and bottom; `cover` crops them away.
   The long first selector is for weight, not tidiness: a thumbnail is an <img> inside a post,
   and both wpForo (`.wpforo-post .wpforo-post-content img`: 500px cap, 2px margin) and the
   theme (the same, prefixed `body`: natural size, `contain`, a hairline border) style those
   at a specificity a short selector loses to — the thumbnail then sits at 480px in a 640px
   box with a frame around it. */
body #wpforo #wpforo-wrap .wpforo-post .wpforo-post-content .gradba-video .gradba-video-link img,
body #wpforo #wpforo-wrap .gradba-video .gradba-video-link img {
	width: 100%;
	height: 100%;
	max-width: none;
	max-height: none;
	margin: 0;
	border: 0;
	border-radius: 0;
	background: #000;
	object-fit: cover;
	transition: opacity 0.15s ease;
}
#wpforo #wpforo-wrap .gradba-video-link:hover img,
#wpforo #wpforo-wrap .gradba-video-link:focus-visible img {
	opacity: 0.85;
}
#wpforo #wpforo-wrap .gradba-video-play {
	position: absolute;
	top: 50%;
	left: 50%;
	display: block;
	width: 68px;
	height: 48px;
	transform: translate(-50%, -50%);
	pointer-events: none;
}
#wpforo #wpforo-wrap .gradba-video-play svg {
	display: block;
}
#wpforo #wpforo-wrap .gradba-video-play-bg {
	fill: rgb(20 20 20 / 0.82);
	transition: fill 0.15s ease;
}
#wpforo #wpforo-wrap .gradba-video-link:hover .gradba-video-play-bg,
#wpforo #wpforo-wrap .gradba-video-link:focus-visible .gradba-video-play-bg {
	fill: #f00;
}
#wpforo #wpforo-wrap .gradba-video iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}
