/* "Watch Dr. Aly Speak": featured video + thumbnails. */

.cmath-kv {
	position: relative;
	overflow: hidden;
	background: var(--color-brand-samon);
	padding: var(--block-padding-m) var(--grid-margins);
}

/* Background illustrations. */
.cmath-kv__deco {
	position: absolute;
	z-index: 0;
	background-repeat: no-repeat;
	background-size: contain;
	pointer-events: none;
}

.cmath-kv__deco--mandala {
	top: -26px;
	left: -131px;
	width: 470px;
	height: 470px;
	background-image: url("../img/mandala-2.svg");
}

.cmath-kv__deco--cube {
	right: -170px;
	bottom: -14px;
	width: 446px;
	height: 513px;
	background-image: url("../img/cube.svg");
}

.cmath-kv__inner {
	position: relative;
	z-index: 1;
	max-width: var(--max-width-content);
	margin-inline: auto;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--space-200);
}

.cmath-kv__title {
	margin: 0;
	font-family: var(--font-family-headers);
	font-weight: var(--font-h2-weight);
	font-size: var(--font-h2-size);
	line-height: 1.2;
	color: var(--color-text-default);
	text-align: center;
}

.cmath-kv__stage {
	display: flex;
	flex-direction: column;
	gap: var(--space-200);
	width: 100%;
	max-width: 778px;
}

/* Destaque. */
.cmath-kv__featured {
	position: relative;
	display: block;
	width: 100%;
	aspect-ratio: 778 / 430;
	padding: 0;
	border: 0;
	overflow: hidden;
	background: #000;
	cursor: pointer;
}

.cmath-kv__poster {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.cmath-kv__featured::after {
	content: "";
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.2);
	transition: background-color 0.2s ease;
}

.cmath-kv__featured:hover::after,
.cmath-kv__featured:focus-visible::after {
	background: rgba(0, 0, 0, 0.35);
}

.cmath-kv__featured.is-playing {
	cursor: default;
}

.cmath-kv__featured.is-playing::after {
	display: none;
}

.cmath-kv__media {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
	background: #000;
}

.cmath-kv__play {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	z-index: 1;
	pointer-events: none;
}

.cmath-kv__play svg {
	display: block;
	width: 48px;
	height: 48px;
}

.cmath-kv__play--sm svg {
	width: 32px;
	height: 32px;
}

.cmath-kv__featured.is-playing .cmath-kv__play {
	display: none;
}

/* Tira de thumbnails. */
.cmath-kv__thumbs-row,
.cmath-kv__thumbs-track {
	display: flex;
	gap: var(--grid-gutter);
	width: 100%;
}

.cmath-kv__thumb {
	position: relative;
	flex: 1 1 0;
	aspect-ratio: 238 / 134;
	padding: 0;
	border: 0;
	overflow: hidden;
	background: #000;
	cursor: pointer;
}

/* Em carousel (>3) cada thumbnail ocupa ~1/3 da viewport. */
.cmath-kv__thumbs.cmath-carousel .cmath-kv__thumb {
	flex: 0 0 calc((100% - 2 * var(--grid-gutter)) / 3);
}

.cmath-kv__thumb img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.cmath-kv__thumb::after {
	content: "";
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.2);
	transition: background-color 0.2s ease;
}

.cmath-kv__thumb:hover::after,
.cmath-kv__thumb:focus-visible::after {
	background: rgba(0, 0, 0, 0.1);
}

.cmath-kv__thumb.is-active {
	outline: 3px solid var(--color-brand-teal-darker);
	outline-offset: -3px;
}

.cmath-kv__thumb.is-active::after {
	background: transparent;
}

/* CTA. */
.cmath-kv__cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: var(--space-50) var(--space-100);
	border-radius: var(--radius-full);
	background: var(--color-brand-teal-darker);
	color: var(--color-text-white);
	font-family: var(--font-family-paragraph);
	font-size: var(--font-body-size);
	text-decoration: none;
	transition: background-color 0.2s ease;
}

.cmath-kv__cta:hover,
.cmath-kv__cta:focus-visible {
	background: var(--color-brand-dark-turquoise);
	color: var(--color-text-white);
}

@media (max-width: 1024px) {
	.cmath-kv__deco {
		display: none;
	}
}

@media (max-width: 768px) {
	.cmath-kv__thumbs.cmath-carousel .cmath-kv__thumb {
		flex: 0 0 calc((100% - var(--grid-gutter)) / 2);
	}
}
