/**
 * MicroLearn — Aparat video header on articles.
 *
 * Scoped to .ml-video so it can sit at the top of any article template.
 * Colours come from the modern skin tokens, with light-theme fallbacks.
 */

.ml-video {
	margin: 0 0 32px;
	border-radius: var(--ms-radius-lg, 24px);
	overflow: hidden;
	background: #0d0b09;
	border: 1px solid var(--ms-line, #e7e9e7);
	box-shadow: var(--ms-shadow-lg, 0 28px 60px -28px rgba(16, 24, 20, .28));
}

.ml-video__frame {
	position: relative;
	aspect-ratio: 16 / 9;
	background: #000;
}

.ml-video__frame img,
.ml-video__frame iframe {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	border: 0;
}

.ml-video__frame img {
	object-fit: cover;
	transition: transform .6s ease;
}

.ml-video:hover .ml-video__frame img {
	transform: scale(1.03);
}

/* Soft scrim so the play button and the badges stay readable on any poster. */
.ml-video__frame::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	pointer-events: none;
	background: linear-gradient(180deg, rgba(0, 0, 0, 0) 42%, rgba(0, 0, 0, .55) 80%, rgba(0, 0, 0, .78));
	transition: opacity .3s ease;
}

.ml-video.is-playing .ml-video__frame::after {
	opacity: 0;
}

/* ------------------------------------------------------------ play button */

.ml-video__play {
	position: absolute;
	left: 50%;
	top: 50%;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	gap: 12px;
	padding: 10px 26px 10px 14px;
	border: 0;
	border-radius: var(--ms-radius-full, 999px);
	background: rgba(255, 255, 255, .96);
	color: #1b1b1b;
	font: inherit;
	font-size: 15px;
	font-weight: 700;
	line-height: 1;
	cursor: pointer;
	transform: translate(-50%, -50%);
	box-shadow: 0 18px 40px -16px rgba(0, 0, 0, .65);
	transition: background .2s ease, box-shadow .2s ease;
}

.ml-video__play:hover {
	background: #fff;
	box-shadow: 0 22px 46px -16px rgba(0, 0, 0, .75);
}

.ml-video__play:focus-visible {
	outline: 3px solid var(--ms-green, #f97316);
	outline-offset: 3px;
}

.ml-video__play-icon {
	display: grid;
	place-items: center;
	flex: none;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: var(--ms-green, #f97316);
	color: #fff;
}

.ml-video__play-icon svg {
	width: 18px;
	height: 18px;
}

/* ---------------------------------------------------------------- badges */

.ml-video__badge,
.ml-video__time {
	position: absolute;
	bottom: 14px;
	z-index: 2;
	padding: 5px 12px;
	border-radius: var(--ms-radius-full, 999px);
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	line-height: 1.7;
	backdrop-filter: blur(6px);
}

.ml-video__badge {
	inset-inline-start: 14px;
	background: rgba(249, 115, 22, .92);
}

.ml-video__time {
	inset-inline-end: 14px;
	background: rgba(0, 0, 0, .62);
	font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------- caption */

.ml-video__caption {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 14px;
	padding: 14px 20px;
	border-top: 1px solid var(--ms-line-soft, #f0f2f0);
	background: var(--ms-white, #fff);
	color: var(--ms-body, #5c6560);
	font-size: 13.5px;
	line-height: 1.9;
}

.ml-video__caption b {
	color: var(--ms-ink, #222);
}

.ml-video__caption a {
	color: var(--ms-green-ink, #c2410c);
	font-weight: 700;
	text-decoration: none;
}

.ml-video__caption a:hover {
	text-decoration: underline;
}

/* ------------------------------------------------------------- responsive */

@media (max-width: 600px) {
	.ml-video {
		margin-bottom: 24px;
		border-radius: var(--ms-radius, 16px);
	}

	.ml-video__play {
		gap: 8px;
		padding: 8px 18px 8px 10px;
		font-size: 13px;
	}

	.ml-video__play-icon {
		width: 36px;
		height: 36px;
	}

	.ml-video__play-icon svg {
		width: 15px;
		height: 15px;
	}

	.ml-video__badge,
	.ml-video__time {
		bottom: 10px;
		padding: 4px 9px;
		font-size: 11px;
	}

	.ml-video__caption {
		padding: 12px 14px;
		font-size: 12.5px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ml-video__frame img,
	.ml-video:hover .ml-video__frame img {
		transition: none;
		transform: none;
	}
}
