/**
 * Viora CTA widget.
 *
 * A centred closing ask over an optional plate, with the invitation running
 * across the section in hollow display type.
 */

.viora-cta {
	--viora-cta-marquee-size: clamp(3.5rem, 9.7vw, 8.75rem);   /* 140 */

	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	padding-block: clamp(4rem, 9.03vw, 8.125rem);
	overflow: hidden;
	isolation: isolate;
	text-align: center;
}

/* -------------------------------------------------- *
 * Background plate
 * -------------------------------------------------- */

.viora-cta__bg {
	position: absolute;
	/* Overscan: the plate drifts, so it has to be taller than the section or
	   the parallax would expose an edge at one end of the travel. */
	inset: -12% 0;
	z-index: -2;
	will-change: transform;
}

.viora-cta__bg img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Deep enough that white display type holds up over a bright, high-key
   photograph — which is exactly the kind of image this section attracts. */
.viora-cta__overlay {
	position: absolute;
	inset: 0;
	background-color: rgba(17, 17, 17, 0.72);
}

/* -------------------------------------------------- *
 * Marquee
 * -------------------------------------------------- */

/*
 * Cropped by the bottom edge rather than centred: a strip running behind the
 * copy crosses every line of it, and hollow display type at 140px wins that
 * fight no matter how low the opacity goes.
 */
.viora-cta__marquee {
	position: absolute;
	left: 0;
	bottom: 0;
	z-index: -1;
	display: flex;
	width: max-content;
	color: var(--viora-ink, var(--viora-color-heading));
	font-family: var(--viora-font-display);
	font-size: var(--viora-cta-marquee-size);
	font-weight: 400;
	line-height: 1;
	letter-spacing: -0.03em;
	text-transform: uppercase;
	white-space: nowrap;
	opacity: 0.14;
	pointer-events: none;
	transform: translateY(32%);
	user-select: none;
}

.viora-cta--outline .viora-cta__marquee {
	color: transparent;
	-webkit-text-stroke: 1px var(--viora-ink, var(--viora-color-heading));
	opacity: 0.28;
}

.viora-cta__marquee-run {
	display: flex;
	animation: viora-cta-marquee 38s linear infinite;
}

.viora-cta__marquee-item {
	padding-right: 0.35em;
}

@keyframes viora-cta-marquee {
	to {
		/* One full run, not the whole strip: the second run has already taken
		   its place by the time the first finishes. */
		transform: translateX(-100%);
	}
}

.viora-cta:hover .viora-cta__marquee-run {
	animation-play-state: paused;
}

/* -------------------------------------------------- *
 * Copy
 * -------------------------------------------------- */

.viora-cta__inner {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	width: min(760px, 100% - 2 * var(--viora-layout-container-pad));
	margin-inline: auto;
}

.viora-cta__head .viora-head__title {
	--viora-head-size: clamp(2.5rem, 5.2vw, 4.6875rem);   /* 75 */
	max-width: 14ch;
}

.viora-cta__head .viora-head__text {
	max-width: 42ch;
}

.viora-cta__actions {
	display: flex;
	margin-top: clamp(1.75rem, 3.06vw, 2.75rem);
}

.viora-cta__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 0.75rem 1.25rem;
	margin: clamp(1.5rem, 2.5vw, 2.25rem) 0 0;
	color: var(--viora-ink-soft, var(--viora-color-heading-soft));
	font-family: var(--viora-font-ui);
	font-size: 0.75rem;
	font-weight: var(--viora-weight-medium);
	line-height: 1.7;
	letter-spacing: 0.24em;
	text-transform: uppercase;
}

.viora-cta__meta-link {
	color: inherit;
	text-decoration: none;
	transition: color var(--viora-motion-base) var(--viora-motion-easing);
}

.viora-cta__meta-link:hover {
	color: var(--viora-color-accent);
}

.viora-cta__meta-sep {
	display: block;
	width: 1.5rem;
	height: 1px;
	background-color: currentColor;
	opacity: 0.5;
}

/* -------------------------------------------------- *
 * Reveal
 * -------------------------------------------------- */

.viora-cta.is-animated .viora-cta__item {
	opacity: 0;
	transform: translateY(24px);
}

.viora-cta.is-animated .viora-cta__item.is-in {
	opacity: 1;
	transform: none;
	transition:
		opacity 0.9s var(--viora-motion-easing),
		transform 0.9s var(--viora-motion-easing);
}

/* -------------------------------------------------- *
 * Tablet
 * -------------------------------------------------- */

@media (max-width: 1024px) {
	.viora-cta {
		--viora-cta-marquee-size: clamp(3rem, 11vw, 6rem);
		padding-block: clamp(3.5rem, 7vw, 5.5rem);
	}
}

/* -------------------------------------------------- *
 * Mobile
 * -------------------------------------------------- */

@media (max-width: 767px) {
	.viora-cta {
		--viora-cta-marquee-size: clamp(2.5rem, 13vw, 4rem);
	}

	.viora-cta__head .viora-head__title {
		--viora-head-size: clamp(2rem, 9vw, 2.75rem);
		max-width: none;
	}

	.viora-cta__button {
		width: 100%;
		justify-content: space-between;
	}
}

@media (prefers-reduced-motion: reduce) {
	.viora-cta.is-animated .viora-cta__item {
		opacity: 1;
		transform: none;
		transition: none;
	}

	.viora-cta__marquee-run {
		animation: none;
	}

	.viora-cta__bg {
		transform: none !important;
	}
}
