/**
 * lite-yt-embed — stilovi za <lite-youtube>.
 *
 * Samostalna implementacija (vidi lite-yt-embed.js), ne kopija originala.
 * Sve klase nose td- prefiks radi konvencije teme.
 */

lite-youtube {
	position: relative;
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	border-radius: 16px;
	background-color: #0f2c48;
	contain: content;
	cursor: pointer;
}

lite-youtube:not(:defined) {
	/* Dok se element ne registruje, sličica i dugme se ipak vide. */
	display: block;
}

.td-yt__poster {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border: 0;
	display: block;
}

.td-yt__btn {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 72px;
	height: 72px;
	border-radius: 50%;
	border: 1px solid rgba(255, 255, 255, .55);
	background: rgba(255, 255, 255, .18);
	backdrop-filter: blur(2px);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	cursor: pointer;
	transition: .2s;
	text-decoration: none;
	color: #fff;
	z-index: 1;
}

.td-yt__icon {
	width: 0;
	height: 0;
	border-style: solid;
	border-width: 11px 0 11px 18px;
	border-color: transparent transparent transparent #fff;
	margin-left: 4px;
}

lite-youtube:hover .td-yt__btn,
.td-yt__btn:focus-visible {
	background: #F4A23E;
	border-color: #F4A23E;
	width: 78px;
	height: 78px;
}

.td-yt__btn:focus-visible {
	outline: 3px solid #fff;
	outline-offset: 3px;
}

lite-youtube iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
	z-index: 2;
}

lite-youtube.td-yt--is-active {
	cursor: default;
}

lite-youtube.td-yt--is-active .td-yt__poster,
lite-youtube.td-yt--is-active .td-yt__btn {
	opacity: 0;
	pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
	.td-yt__btn {
		transition: none;
	}
}
