/*
 * Video modal: one branded dialog for every video on the site, plus the poster button that stands in for
 * a YouTube iframe inside articles. Same palette and type as the consultation popup and banner
 * (ink #292566, accent #0062fe, soft #f3f6ff, Alef headings, Heebo body). Mobile-first: dialog = viewport
 * minus 16px, stacked footer; from 720px a two-sided footer. Everything is scoped under .ta-vm / .ta-vm-embed.
 */

.ta-vm,
.ta-vm-embed {
	--ta-vm-accent: #0062fe;
	--ta-vm-accent-hover: #0054d9;
	--ta-vm-ink: #292566;
	--ta-vm-text: #292b43;
	--ta-vm-muted: #53516c;
	--ta-vm-border: #dedfe6;
	--ta-vm-soft: #fafafc;
	--ta-vm-card: #f3f6ff;
	--ta-vm-font-head: Alef, sans-serif;
	--ta-vm-font-body: Heebo, sans-serif;
}

html.ta-vm-open {
	overflow: hidden;
}

/* ---------------------------------------------------------------- */
/* Dialog                                                             */
/* ---------------------------------------------------------------- */

.ta-vm {
	width: calc(100vw - 16px);
	max-width: 1040px;
	max-height: calc(100vh - 16px);
	max-height: calc(100dvh - 16px);
	margin: auto;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--ta-vm-text);
	direction: rtl;
	text-align: right;
	font-family: var(--ta-vm-font-body);
	overflow: visible;
	-webkit-font-smoothing: antialiased;
}

.ta-vm::backdrop {
	background: rgba(23, 20, 48, 0.62);
}

.ta-vm *,
.ta-vm *::before,
.ta-vm *::after {
	box-sizing: border-box;
}

.ta-vm__card {
	display: flex;
	flex-direction: column;
	gap: 14px;
	max-height: calc(100vh - 16px);
	max-height: calc(100dvh - 16px);
	padding: 16px 16px 18px;
	overflow-y: auto;
	overscroll-behavior: contain;
	border-radius: 20px;
	background: #ffffff;
	box-shadow: 0 16px 40px rgba(13, 10, 41, 0.28);
}

.ta-vm__header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
}

.ta-vm__heading {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
}

.ta-vm__eyebrow {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0;
	font-size: 13px;
	line-height: 21px;
	color: var(--ta-vm-accent);
}

.ta-vm__eyebrow-rule {
	flex: 0 0 28px;
	width: 28px;
	height: 2px;
	background: var(--ta-vm-accent);
}

.ta-vm .ta-vm__title {
	margin: 0;
	padding: 0;
	font-family: var(--ta-vm-font-head);
	font-size: 20px;
	font-weight: 700;
	line-height: 26px;
	color: var(--ta-vm-ink);
	overflow-wrap: anywhere;
}

/* The player: 16:9, as wide as the card allows but never taller than what is left of the viewport. */
.ta-vm__stage {
	width: 100%;
}

.ta-vm__frame {
	width: min(100%, calc((100vh - 230px) * 1.7778));
	width: min(100%, calc((100dvh - 230px) * 1.7778));
	min-width: min(100%, 260px);
	margin-inline: auto;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	border-radius: 14px;
	background: #0d0a29;
}

.ta-vm__frame iframe {
	display: block;
	width: 100%;
	height: 100%;
	border: 0;
}

.ta-vm__footer {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.ta-vm__cta {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 8px;
}

.ta-vm__hint {
	font-size: 13px;
	line-height: 20px;
	color: var(--ta-vm-muted);
	text-align: center;
}

/* ---------------------------------------------------------------- */
/* Buttons: reset first, the parent theme paints plain buttons pink    */
/* ---------------------------------------------------------------- */

.ta-vm button {
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	box-shadow: none;
	color: inherit;
	font: inherit;
	line-height: inherit;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}

.ta-vm button:focus {
	outline: none;
}

.ta-vm button:focus-visible,
.ta-vm a:focus-visible {
	outline: 2px solid var(--ta-vm-ink);
	outline-offset: 2px;
}

.ta-vm button.ta-vm__close,
.ta-vm button.ta-vm__close:hover,
.ta-vm button.ta-vm__close:focus {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 44px;
	width: 44px;
	height: 44px;
	border-radius: 22px;
	background: var(--ta-vm-soft);
	color: var(--ta-vm-ink);
	transition: background-color 0.15s ease;
}

.ta-vm button.ta-vm__close:hover {
	background: var(--ta-vm-card);
}

.ta-vm button.ta-vm__consult,
.ta-vm button.ta-vm__consult:hover,
.ta-vm button.ta-vm__consult:focus {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-height: 52px;
	padding: 0 28px;
	border-radius: 999px;
	background: var(--ta-vm-accent);
	color: #ffffff;
	font-family: var(--ta-vm-font-head);
	font-size: 18px;
	font-weight: 700;
	line-height: 1.2;
	transition: background-color 0.15s ease;
}

.ta-vm button.ta-vm__consult:hover {
	background: var(--ta-vm-accent-hover);
}

.ta-vm a.ta-vm__youtube,
.ta-vm a.ta-vm__youtube:hover,
.ta-vm a.ta-vm__youtube:focus {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 48px;
	padding: 0 22px;
	border: 1px solid var(--ta-vm-ink);
	border-radius: 999px;
	background: #ffffff;
	color: var(--ta-vm-ink);
	font-size: 15px;
	font-weight: 500;
	text-decoration: none;
	transition: background-color 0.15s ease;
}

.ta-vm a.ta-vm__youtube:hover {
	background: var(--ta-vm-card);
}

.ta-vm__sr {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

/* ---------------------------------------------------------------- */
/* Open animation (opacity and transform only)                        */
/* ---------------------------------------------------------------- */

.ta-vm[open] .ta-vm__card {
	animation: ta-vm-in 0.22s ease-out;
}

.ta-vm[open]::backdrop {
	animation: ta-vm-fade 0.22s ease-out;
}

@keyframes ta-vm-in {
	from { opacity: 0; transform: translateY(12px) scale(0.985); }
	to { opacity: 1; transform: none; }
}

@keyframes ta-vm-fade {
	from { opacity: 0; }
	to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
	.ta-vm[open] .ta-vm__card,
	.ta-vm[open]::backdrop {
		animation: none;
	}
}

html.ta-a11y-motion .ta-vm[open] .ta-vm__card,
html.ta-a11y-motion .ta-vm[open]::backdrop {
	animation: none;
}

/* ---------------------------------------------------------------- */
/* Tablet and desktop                                                  */
/* ---------------------------------------------------------------- */

@media (min-width: 720px) {
	.ta-vm {
		width: calc(100vw - 48px);
	}

	.ta-vm__card {
		gap: 18px;
		padding: 24px 28px 26px;
		border-radius: 24px;
	}

	.ta-vm .ta-vm__title {
		font-size: 28px;
		line-height: 34px;
	}

	.ta-vm__frame {
		border-radius: 16px;
	}

	.ta-vm__footer {
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
	}

	.ta-vm__cta {
		flex-direction: row;
		align-items: center;
		gap: 16px;
	}

	.ta-vm__hint {
		font-size: 14px;
		text-align: right;
	}
}

/* Short landscape screens (phones turned sideways): shrink the chrome so the player keeps its size. */
@media (max-height: 520px) {
	.ta-vm__card {
		gap: 8px;
		padding: 10px 14px 12px;
	}

	.ta-vm__eyebrow,
	.ta-vm__hint {
		display: none;
	}

	.ta-vm .ta-vm__title {
		font-size: 17px;
		line-height: 22px;
	}

	.ta-vm__frame {
		width: min(100%, calc((100vh - 150px) * 1.7778));
		width: min(100%, calc((100dvh - 150px) * 1.7778));
	}

	.ta-vm__footer {
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
	}

	.ta-vm__cta {
		flex-direction: row;
	}

	.ta-vm button.ta-vm__consult,
	.ta-vm button.ta-vm__consult:hover,
	.ta-vm button.ta-vm__consult:focus {
		min-height: 44px;
		font-size: 16px;
	}

	.ta-vm a.ta-vm__youtube,
	.ta-vm a.ta-vm__youtube:hover,
	.ta-vm a.ta-vm__youtube:focus {
		min-height: 44px;
	}
}

/* ---------------------------------------------------------------- */
/* Poster button that replaces a YouTube iframe inside articles       */
/* ---------------------------------------------------------------- */

button.ta-vm-embed,
button.ta-vm-embed:hover,
button.ta-vm-embed:focus {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	max-width: 800px;
	aspect-ratio: 16 / 9;
	margin: 8px 0;
	padding: 0;
	overflow: hidden;
	border: 1px solid var(--ta-vm-border);
	border-radius: 16px;
	background: var(--ta-vm-card);
	color: var(--ta-vm-ink);
	font-family: var(--ta-vm-font-body);
	text-align: right;
	cursor: pointer;
	transition: border-color 0.15s ease, background-color 0.15s ease;
}

button.ta-vm-embed:hover {
	border-color: var(--ta-vm-accent);
	background: #ffffff;
}

button.ta-vm-embed:focus-visible {
	outline: 2px solid var(--ta-vm-ink);
	outline-offset: 3px;
}

.ta-vm-embed .ta-vm-embed__logo {
	position: absolute;
	top: 6%;
	inset-inline: 0;
	display: block;
	width: min(34%, 220px);
	height: auto;
	margin-inline: auto;
}

.ta-vm-embed .ta-vm-embed__play {
	position: absolute;
	inset-inline-start: 50%;
	top: 47%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	margin-top: -28px;
	margin-inline-start: -28px;
	border-radius: 50%;
	background: var(--ta-vm-accent);
	color: #ffffff;
	box-shadow: 0 6px 18px rgba(0, 98, 254, 0.35);
	transition: transform 0.15s ease;
}

@media (min-width: 720px) {
	.ta-vm-embed .ta-vm-embed__play {
		width: 72px;
		height: 72px;
		margin-top: -36px;
		margin-inline-start: -36px;
	}
}

.ta-vm-embed .ta-vm-embed__play svg {
	display: block;
	margin-left: 4px; /* optical centring of a right-pointing triangle */
}

button.ta-vm-embed:hover .ta-vm-embed__play {
	transform: scale(1.06);
}

.ta-vm-embed .ta-vm-embed__caption {
	position: absolute;
	inset-inline: 0;
	bottom: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 8px 16px 12px;
	background: linear-gradient(to top, rgba(243, 246, 255, 1) 60%, rgba(243, 246, 255, 0));
}

.ta-vm-embed .ta-vm-embed__title {
	font-family: var(--ta-vm-font-head);
	font-size: 16px;
	font-weight: 700;
	line-height: 22px;
	color: var(--ta-vm-ink);
}

.ta-vm-embed .ta-vm-embed__hint {
	font-size: 13px;
	line-height: 20px;
	color: var(--ta-vm-muted);
}

@media (prefers-reduced-motion: reduce) {
	.ta-vm-embed .ta-vm-embed__play {
		transition: none;
	}
}

html.ta-a11y-motion .ta-vm-embed .ta-vm-embed__play {
	transition: none;
}
