/**
 * Sliderul din antet (tema Triaj).
 *
 * Straturile sunt asezate pe grila sliderului (--gw x --gh, implicit 960 x 350).
 * Pozitiile si marimile se calculeaza din latimea scenei, deci totul se
 * micsoreaza proportional, ca in Revolution Slider. Sub 640px textele trec
 * unul sub altul, la marimi care se pot citi pe telefon.
 */

.t-hero {
	--t-ease: cubic-bezier(0.19, 1, 0.22, 1);
	position: relative;
	overflow: hidden;
	/* clip, nu doar hidden: o imagine mai inalta decat sliderul nu mai poate fi
	   derulata in interior cand primeste focus un buton. */
	overflow: clip;
	background: #e9e9e9;
	isolation: isolate;
}

.t-hero__track {
	display: grid;
}

.t-slide {
	grid-area: 1 / 1;
	position: relative;
	opacity: 0;
	visibility: hidden;
	transition: opacity var(--t-fade, 1000ms) ease, visibility 0s linear var(--t-fade, 1000ms);
}

.t-slide.is-active,
.t-slide.is-leaving {
	visibility: visible;
}

.t-slide.is-active {
	z-index: 2;
	opacity: 1;
	transition: opacity var(--t-fade, 1000ms) ease;
}

.t-slide.is-leaving {
	z-index: 1;
	opacity: 1;
}

.t-slide__bg {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center top;
}

.t-slide__stage {
	position: relative;
	width: min(100%, calc(var(--gw, 960) * 1px));
	aspect-ratio: var(--gw, 960) / var(--gh, 350);
	margin-inline: auto;
	container-type: inline-size;
}

/* Straturile ------------------------------------------------------------- */

.t-layer {
	position: absolute;
	left: calc(var(--x) / var(--gw, 960) * 100%);
	top: calc(var(--y) / var(--gh, 350) * 100%);
	z-index: var(--z, 5);
}

.t-layer--xcenter {
	left: calc((var(--gw, 960) / 2 + var(--x)) / var(--gw, 960) * 100%);
	translate: -50% 0;
}

.t-layer--xright {
	left: auto;
	right: calc(var(--x) / var(--gw, 960) * 100%);
}

.t-layer--ymiddle {
	top: calc((var(--gh, 350) / 2 + var(--y)) / var(--gh, 350) * 100%);
	translate: 0 -50%;
}

.t-layer--xcenter.t-layer--ymiddle {
	translate: -50% -50%;
}

.t-layer--ybottom {
	top: auto;
	bottom: calc(var(--y) / var(--gh, 350) * 100%);
}

.t-layer--image {
	width: calc(var(--w) / var(--gw, 960) * 100cqw);
}

.t-layer--image img {
	display: block;
	width: 100%;
	max-width: none;
	height: auto;
}

/* Imagine cunoscuta doar dupa inaltime. */
.t-layer--byh {
	width: auto;
}

.t-layer--byh img {
	width: auto;
	height: calc(var(--h) / var(--gw, 960) * 100cqw);
}

.t-layer--text {
	font-family: Arial, Helvetica, sans-serif;
	font-size: calc(var(--fs) / var(--gw, 960) * 100cqw);
	line-height: calc(var(--lh) / var(--gw, 960) * 100cqw);
	font-weight: var(--fw, 400);
	color: var(--c, #333);
	padding: calc(var(--pt, 0) / var(--gw, 960) * 100cqw) calc(var(--pr, 0) / var(--gw, 960) * 100cqw) calc(var(--pb, 0) / var(--gw, 960) * 100cqw) calc(var(--pl, 0) / var(--gw, 960) * 100cqw);
	white-space: nowrap;
}

.t-layer--box {
	background: var(--b);
}

.t-layer--text a {
	color: inherit;
}

/* Intrarea straturilor: pornesc din afara locului lor si ajung pe pozitie,
   cu intarzierea si durata salvate pentru fiecare. */
.t-slide .t-layer {
	opacity: 0;
}

.t-slide .t-layer[data-from="left"] {
	transform: translateX(-70cqw);
}

.t-slide .t-layer[data-from="right"] {
	transform: translateX(70cqw);
}

.t-slide .t-layer[data-from="top"] {
	transform: translateY(-6cqw);
}

.t-slide .t-layer[data-from="bottom"] {
	transform: translateY(40cqw);
}

.t-slide.is-active .t-layer,
.t-slide.is-active .t-layer[data-from] {
	opacity: 1;
	transform: none;
	transition: opacity var(--sp, 300ms) ease var(--st, 0ms), transform var(--sp, 300ms) var(--t-ease) var(--st, 0ms);
}

.t-slide.is-leaving .t-layer,
.t-slide.is-leaving .t-layer[data-from] {
	opacity: 1;
	transform: none;
	transition: none;
}

/* Fara animatii: previzualizarea din panou si cine le-a oprit din sistem. */
.t-hero.is-static .t-slide,
.t-hero.is-static .t-layer,
.t-hero.is-static .t-layer[data-from] {
	opacity: 1;
	visibility: visible;
	transform: none;
	transition: none;
}

@media (prefers-reduced-motion: reduce) {
	.t-slide,
	.t-slide.is-active {
		transition: none;
	}

	.t-slide .t-layer,
	.t-slide .t-layer[data-from] {
		opacity: 1;
		transform: none;
		transition: none;
	}
}

/* Comenzile -------------------------------------------------------------- */

.t-hero__controls {
	position: absolute;
	z-index: 5;
	right: max(12px, calc((100% - var(--gw, 960) * 1px) / 2 + 12px));
	bottom: 12px;
	display: flex;
	align-items: center;
	gap: 2px;
	padding: 3px 6px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.88);
	box-shadow: 0 1px 4px rgba(12, 33, 77, 0.18);
}

.t-hero__dots {
	display: flex;
}

.t-hero__pause,
.t-hero__dot {
	display: grid;
	place-items: center;
	width: 32px;
	height: 32px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: #13306b;
	cursor: pointer;
}

.t-hero__pause .t-icon {
	width: 18px;
	height: 18px;
	fill: currentColor;
}

.t-hero__pause .t-icon--play,
.t-hero.is-paused .t-hero__pause .t-icon--pause {
	display: none;
}

.t-hero.is-paused .t-hero__pause .t-icon--play {
	display: block;
}

.t-hero__dot::before {
	content: "";
	width: 11px;
	height: 11px;
	border: 2px solid #800808;
	border-radius: 50%;
	transition: background-color 0.2s ease;
}

.t-hero__dot[aria-current="true"]::before {
	background: #800808;
}

.t-hero__pause:hover,
.t-hero__dot:hover {
	background: rgba(19, 48, 107, 0.1);
}

.t-hero__pause:focus-visible,
.t-hero__dot:focus-visible {
	outline: 3px solid #13306b;
	outline-offset: 0;
}

/* Telefon: textele unul sub altul ------------------------------------------ */

@media (max-width: 640px) {
	.t-slide {
		display: flex;
		flex-direction: column;
	}

	.t-slide__stage {
		flex: 1 0 auto;
		display: flex;
		flex-direction: column;
		align-items: flex-start;
		gap: 10px;
		width: 100%;
		min-height: 220px;
		aspect-ratio: auto;
		padding: 22px 16px 58px;
		container-type: normal;
	}

	.t-layer,
	.t-layer--xcenter,
	.t-layer--ymiddle,
	.t-layer--xright,
	.t-layer--ybottom {
		position: relative;
		left: auto;
		right: auto;
		top: auto;
		bottom: auto;
		translate: none;
	}

	.t-layer--text {
		z-index: 2;
		max-width: 58%;
		font-size: max(1rem, calc(var(--fs) * 0.55px));
		line-height: 1.25;
		padding: calc(var(--pt, 0) * 0.5px) calc(var(--pr, 0) * 0.5px) calc(var(--pb, 0) * 0.5px) calc(var(--pl, 0) * 0.5px);
		white-space: normal;
	}

	.t-layer--image {
		position: absolute;
		right: 0;
		bottom: 0;
		z-index: 1;
		width: 38%;
	}

	.t-layer--image ~ .t-layer--image {
		display: none;
	}

	.t-slide:not(.is-active):not(.is-leaving) .t-layer[data-from="left"] {
		transform: translateX(-40px);
	}

	.t-slide:not(.is-active):not(.is-leaving) .t-layer[data-from="right"] {
		transform: translateX(40px);
	}

	.t-slide:not(.is-active):not(.is-leaving) .t-layer[data-from="top"] {
		transform: translateY(-16px);
	}

	.t-slide:not(.is-active):not(.is-leaving) .t-layer[data-from="bottom"] {
		transform: translateY(24px);
	}

	.t-hero__controls {
		right: 50%;
		translate: 50% 0;
		bottom: 10px;
	}
}
