/*
 * YouTube click-to-play facade (markup: Dnews\Core\Embeds::render()).
 * Lives in the plugin so it survives a theme switch.
 */
.dnews-yt {
	width: 100%;
	margin: 0;
}

.dnews-yt__frame {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	background: #000;
	overflow: hidden;
}

.dnews-yt__play {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: #000;
	cursor: pointer;
}

.dnews-yt__play img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.dnews-yt__icon {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 4.25rem;
	height: 4.25rem;
	margin: -2.125rem 0 0 -2.125rem;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.7);
	box-shadow: 0 0 0 2px #fff;
	transition: background-color 0.15s;
}

.dnews-yt__icon::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	margin: -0.75rem 0 0 -0.5rem;
	border-style: solid;
	border-width: 0.75rem 0 0.75rem 1.25rem;
	border-color: transparent transparent transparent #fff;
}

.dnews-yt__play:hover .dnews-yt__icon,
.dnews-yt__play:focus-visible .dnews-yt__icon {
	background: rgba(0, 0, 0, 0.9);
}

.dnews-yt__play:focus-visible {
	outline: 3px solid #fff;
	outline-offset: -6px;
	box-shadow: inset 0 0 0 6px #000;
}

.dnews-yt__frame iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

.dnews-yt__watch {
	display: inline-block;
	padding: 0.5rem 0;
	font-size: var(--wp--preset--font-size--small, 14px);
}

/*
 * Core's embed wrapper pads itself to 16:9; the facade owns its ratio.
 * Embeds::strip_aspect_classes() removes the classes that trigger the spacer;
 * this rule outranks core's selector (0,2,1) whatever the print order.
 */
.wp-block-embed .wp-block-embed__wrapper:has(> .dnews-yt)::before {
	content: none;
	padding-top: 0;
}
