/* ==========================================================================
   Video embeds — article player and cards that play in their thumbnail.
   ========================================================================== */

/* Card: the player takes over the thumbnail. */
.aadigital-inline-trigger {
	position: relative;
	display: block;
	cursor: pointer;
}

.aadigital-inline-trigger.is-playing {
	aspect-ratio: 16 / 9;
	background: #000;
}

/* Portrait clip (TikTok, Instagram Reels): the card becomes a 9:16 frame
   instead of squeezing a vertical video into a landscape box. */
.aadigital-inline-trigger.is-playing.is-vertical {
	/* `width: 100%` is required: with the image gone and the player absolutely
	   positioned there is no intrinsic width left to size the box, so the card
	   collapses. The cap keeps a portrait clip from towering on desktop. */
	width: 100%;
	max-inline-size: 320px;
	margin-inline: auto;
	aspect-ratio: 9 / 16;
}

.aadigital-inline-embed {
	position: absolute;
	inset: 0;
	overflow: hidden;
	background: #000;
}

.aadigital-inline-embed__frame,
.aadigital-inline-embed__video {
	display: block;
	width: 100%;
	height: 100%;
	border: 0;
}

/* Article: WordPress-style embed block, fixed ratio, no layout shift. */
.aadigital-embed {
	margin: 0 0 26px;
}

.aadigital-embed__ratio {
	position: relative;
	display: block;
	width: 100%;
	overflow: hidden;
	aspect-ratio: 16 / 9;
	border-radius: 8px;
	background: #000;
}

.aadigital-embed--vertical .aadigital-embed__ratio {
	max-width: 380px;
	margin-inline: auto;
	aspect-ratio: 9 / 16;
}

.aadigital-embed__frame,
.aadigital-embed__video {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	border: 0;
}

.aadigital-embed figcaption {
	margin-block-start: 8px;
	color: #6b7280;
	font-size: 12px;
	line-height: 1.5;
}

.aadigital-embed__link {
	margin-block-end: 24px;
	font-weight: 700;
}

@media (max-width: 639px) {
	.aadigital-embed {
		margin-block-end: 20px;
	}

	.aadigital-embed--vertical .aadigital-embed__ratio {
		max-width: 100%;
	}
}
