/**
 * YouTube facade — превью, click-to-load, скрытие при блокировке.
 */

.wt-feature-youtube-facade {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	background-color: #1a1a1a;
	overflow: hidden;
}

.wt-feature-youtube-facade__inner {
	position: absolute;
	inset: 0;
}

.wt-feature-youtube-facade__thumb {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.wt-feature-youtube-facade__play {
	position: absolute;
	inset: 0;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0;
	padding: 0;
	border: 0;
	background: rgba(0, 0, 0, 0.35);
	cursor: pointer;
	transition: background-color 0.2s ease;
}

.wt-feature-youtube-facade__play:hover,
.wt-feature-youtube-facade__play:focus-visible {
	background: rgba(0, 0, 0, 0.5);
}

.wt-feature-youtube-facade__play:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

.wt-feature-youtube-facade__play-icon {
	display: block;
	width: 0;
	height: 0;
	border-style: solid;
	border-width: 24px 0 24px 40px;
	border-color: transparent transparent transparent #fff;
	filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.45));
}

/* До появления в viewport клик отключён (управляется JS). */
.wt-feature-youtube-facade:not(.wt-feature-youtube-facade--in-view) .wt-feature-youtube-facade__play {
	pointer-events: none;
	cursor: default;
}

.wt-feature-youtube-facade--loaded .wt-feature-youtube-facade__play,
.wt-feature-youtube-facade--loaded .wt-feature-youtube-facade__thumb {
	display: none;
}

.wt-feature-youtube-facade__iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

/* YouTube недоступен (блокировка и т.п.) — скрываем embed-блоки, не иконки в footer. */
.wt-youtube-blocked .wt-feature-youtube-facade,
.wt-youtube-blocked .wp-block-embed-youtube,
.wt-youtube-blocked .lyte-wrapper,
.wt-youtube-blocked .entry-content iframe[src*="youtube"],
.wt-youtube-blocked .entry-content iframe[src*="youtu.be"] {
	display: none !important;
}
