.avt-video-card {
	--avt-footer-bg: #005baa;
	--avt-footer-color: #fff;
	--avt-play-bg: #005baa;
	--avt-play-color: #fff;
	--avt-play-size: 104px;
	--avt-radius: 24px;
	--avt-overlay: .08;
	--avt-footer-font: 28px;
	--avt-max-width: none;
	position: relative;
	width: 100%;
	max-width: var(--avt-max-width);
	margin-left: auto;
	margin-right: auto;
	overflow: hidden;
	border-radius: var(--avt-radius);
	/* Keep the clipping surface transparent so the parent white background cannot
	 * anti-alias through the rounded corners of the thumbnail/footer. */
	background: transparent;
	transform: translateZ(0);
	-webkit-transform: translateZ(0);
	container-type: inline-size;
	container-name: avt-video-card;
	box-shadow: 0 10px 35px rgba(0, 0, 0, .11);
}

.avt-video-card.avt-align-left {
	margin-left: 0;
	margin-right: auto;
}

.avt-video-card.avt-align-center {
	margin-left: auto;
	margin-right: auto;
}

.avt-video-card.avt-align-right {
	margin-left: auto;
	margin-right: 0;
}

.avt-video-card *,
.avt-video-card *::before,
.avt-video-card *::after {
	box-sizing: border-box;
}

.avt-video-card__link,
.avt-video-card__link:hover,
.avt-video-card__link:focus {
	display: block;
	color: inherit;
	text-decoration: none;
}

.avt-video-card__media {
	position: relative;
	overflow: hidden;
	background: #f2f4f7;
}

.avt-ratio-16-9 .avt-video-card__media { aspect-ratio: 16 / 9; }
.avt-ratio-4-3 .avt-video-card__media { aspect-ratio: 4 / 3; }
.avt-ratio-1-1 .avt-video-card__media { aspect-ratio: 1 / 1; }

.avt-video-card__image {
	display: block;
	width: 100%;
	height: auto;
	margin: 0;
	transition: transform .35s ease;
}

.avt-video-card:not(.avt-ratio-auto) .avt-video-card__image {
	height: 100%;
}

/*
 * Crop a single pixel from the outside edge of fixed-ratio thumbnails.
 * Some YouTube/custom poster images contain a dark edge pixel that becomes
 * visible when they are forced into an exact 16:9 box. The tiny overscan is
 * visually imperceptible but keeps that source-image edge outside the clip.
 */
.avt-ratio-16-9 .avt-video-card__image {
	width: calc(100% + 2px);
	height: calc(100% + 2px);
	max-width: none;
	margin: -1px;
}

.avt-fit-cover .avt-video-card__image { object-fit: cover; }
.avt-fit-contain .avt-video-card__image { object-fit: contain; }

.avt-video-card__placeholder {
	display: grid;
	place-items: center;
	min-height: 320px;
	padding: 40px;
	color: #6d7580;
	font-size: 18px;
	font-weight: 600;
	background:
		linear-gradient(135deg, rgba(255,255,255,.7), rgba(255,255,255,0)),
		#eef1f4;
}

.avt-video-card__shade {
	position: absolute;
	z-index: 1;
	inset: 0;
	background: rgba(0, 0, 0, var(--avt-overlay));
	transition: background .25s ease;
}

.avt-video-card__play {
	position: absolute;
	z-index: 2;
	top: 50%;
	left: 50%;
	width: var(--avt-play-size);
	height: var(--avt-play-size);
	transform: translate(-50%, -50%);
	display: grid;
	place-items: center;
	border: 5px solid var(--avt-play-color);
	border-radius: 999px;
	background: var(--avt-play-bg);
	box-shadow: 0 7px 22px rgba(0, 0, 0, .24);
	transition: transform .25s ease, filter .25s ease;
}

.avt-video-card__triangle {
	display: block;
	width: 0;
	height: 0;
	margin-left: 7%;
	border-top: calc(var(--avt-play-size) * .15) solid transparent;
	border-bottom: calc(var(--avt-play-size) * .15) solid transparent;
	border-left: calc(var(--avt-play-size) * .23) solid var(--avt-play-color);
}

.avt-video-card__footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	min-height: 94px;
	padding: 22px 38px;
	color: var(--avt-footer-color);
	background: var(--avt-footer-bg);
}

.avt-video-card__title {
	min-width: 0;
	color: inherit;
	font-size: var(--avt-footer-font);
	font-weight: 700;
	line-height: 1.15;
}

.avt-video-card__platform {
	display: inline-flex;
	align-items: center;
	flex: 0 0 auto;
	gap: 10px;
	color: inherit;
	font-size: max(18px, calc(var(--avt-footer-font) * .9));
	font-weight: 700;
	line-height: 1;
	white-space: nowrap;
}

.avt-video-card__platform-icon {
	position: relative;
	display: inline-grid;
	place-items: center;
	width: 56px;
	height: 38px;
	border-radius: 9px;
	background: currentColor;
}

.avt-video-card__platform-icon span {
	width: 0;
	height: 0;
	margin-left: 3px;
	border-top: 8px solid transparent;
	border-bottom: 8px solid transparent;
	border-left: 13px solid var(--avt-footer-bg);
}

.avt-video-card:hover .avt-video-card__image,
.avt-video-card:focus-within .avt-video-card__image {
	transform: scale(1.018);
}

.avt-video-card:hover .avt-video-card__shade,
.avt-video-card:focus-within .avt-video-card__shade {
	background: rgba(0, 0, 0, calc(var(--avt-overlay) + .06));
}

.avt-video-card:hover .avt-video-card__play,
.avt-video-card:focus-within .avt-video-card__play {
	transform: translate(-50%, -50%) scale(1.07);
	filter: brightness(1.04);
}

.avt-video-card__link:focus-visible {
	outline: 3px solid currentColor;
	outline-offset: 4px;
}

/*
 * The element can be placed in a narrow Avada column even when the browser
 * viewport is desktop-sized, so viewport media queries alone are not enough.
 * Switch the footer layout based on the card's own rendered width.
 */
@container avt-video-card (max-width: 430px) {
	.avt-video-card__footer {
		align-items: flex-start;
		flex-direction: column;
		gap: 6px;
		min-height: 0;
		padding: 15px 20px 16px;
	}

	.avt-video-card__title {
		width: 100%;
		font-size: min(var(--avt-footer-font), 21px);
		overflow-wrap: anywhere;
	}

	/* Keep the secondary platform branding intentionally compact on narrow
	 * cards. The CTA title remains the visual priority while YouTube still
	 * reads clearly without adding another large row to the footer. */
	.avt-video-card__platform {
		gap: 4px;
		font-size: 11px;
		line-height: 1;
	}

	.avt-video-card__platform-icon {
		width: 24px;
		height: 16px;
		border-radius: 4px;
	}

	.avt-video-card__platform-icon span {
		margin-left: 2px;
		border-top-width: 3px;
		border-bottom-width: 3px;
		border-left-width: 6px;
	}
}

@media (max-width: 767px) {
	.avt-video-card {
		--avt-radius: min(var(--avt-radius), 16px);
	}

	.avt-video-card__play {
		width: min(var(--avt-play-size), 76px);
		height: min(var(--avt-play-size), 76px);
		border-width: 4px;
	}

	.avt-video-card__triangle {
		border-top-width: 11px;
		border-bottom-width: 11px;
		border-left-width: 18px;
	}

	.avt-video-card__footer {
		min-height: 0;
		padding: 17px 20px;
		gap: 14px;
	}

	.avt-video-card__title {
		font-size: min(var(--avt-footer-font), 21px);
	}

	.avt-video-card__platform {
		gap: 4px;
		font-size: 11px;
		line-height: 1;
	}

	.avt-video-card__platform-icon {
		width: 24px;
		height: 16px;
		border-radius: 4px;
	}

	.avt-video-card__platform-icon span {
		margin-left: 1px;
		border-top-width: 3px;
		border-bottom-width: 3px;
		border-left-width: 6px;
	}
}

@media (max-width: 480px) {
	.avt-video-card__footer {
		align-items: flex-start;
		flex-direction: column;
	}
}

@media (prefers-reduced-motion: reduce) {
	.avt-video-card__image,
	.avt-video-card__shade,
	.avt-video-card__play {
		transition: none;
	}
}
