/* ==========================================================================
   HERO

   Celá obrazovka, obsah zarovnaný k spodku. Obrázok je pod textom
   a stmavený — text tak nikdy nestratí kontrast, aj keď sa obrázok
   vymení za iný.
   ========================================================================== */

.cpx-hero {
	position: relative;
	isolation: isolate;
	display: flex;
	align-items: flex-end;
	min-height: 100vh;
	overflow: hidden;
}

/* `svh` počíta s pruhom prehliadača na mobile; staršie prehliadače
   ostanú pri `vh` vyššie. */
@supports (height: 100svh) {
	.cpx-hero {
		min-height: 100svh;
	}
}

.cpx-hero__media {
	position: absolute;
	inset: 0;
	pointer-events: none;
}

.cpx-hero__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;

	/* Motýlica sedí vpravo od stredu — text tak dostane voľnú ľavú tretinu. */
	object-position: 68% 42%;
	opacity: 0.72;
}

/*
 * Závoj pod textom. V dizajne to rieši samotný obrázok; keď si redaktor
 * nahrá svetlejší, text musí ostať čitateľný aj tak.
 */
.cpx-hero__media::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(90deg, rgba(3, 16, 31, 0.85) 0%, rgba(3, 16, 31, 0.35) 46%, rgba(3, 16, 31, 0) 70%);
}

.cpx-hero__inner {
	position: relative;
	padding-block: calc(var(--cpx-header-height) + var(--cpx-space-section)) var(--cpx-space-section);
	animation: cpx-rise 700ms var(--cpx-ease) both;
}

@keyframes cpx-rise {
	from {
		opacity: 0;
		transform: translateY(14px);
	}

	to {
		opacity: 1;
		transform: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.cpx-hero__inner {
		animation: none;
	}
}

.cpx-hero__title {
	max-width: 15ch;
	margin-top: var(--cpx-space-34);
	font-size: var(--cpx-fs-h1);
	font-weight: var(--cpx-weight-black);
	line-height: var(--cpx-lh-display);
	letter-spacing: var(--cpx-ls-display);
	text-wrap: pretty;
}

.cpx-hero__text {
	max-width: 46ch;
	margin-top: var(--cpx-space-34);
	font-size: var(--cpx-fs-lead);
	line-height: var(--cpx-lh-base);
	color: var(--cpx-text-muted);
}

.cpx-hero__actions {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: var(--cpx-space-16) var(--cpx-space-26);
	margin-top: var(--cpx-space-44);
}

@media (max-width: 700px) {
	.cpx-hero__media img {
		object-position: 62% 38%;
	}

	/* Na úzkom displeji je motýlica pod textom, nie vedľa neho. */
	.cpx-hero__media::after {
		background: linear-gradient(180deg, rgba(3, 16, 31, 0.35) 0%, rgba(3, 16, 31, 0.72) 52%, rgba(3, 16, 31, 0.88) 100%);
	}

	.cpx-hero__title {
		max-width: 100%;
	}

	.cpx-hero__actions .btn--primary {
		flex: 1 1 100%;
	}
}
