/**
 * Cards Stack - Sticky (Angie snippet, hash 4d9e72).
 *
 * Static layout only. Without JS the cards sit as a stack with card 1 on top. The script then
 * pins the section and moves the cards with GSAP. Every size comes from a custom property so
 * the Elementor controls (and their responsive values) can drive it.
 *
 * Custom properties:
 *   --cst-w           card width
 *   --cst-ar          card aspect ratio
 *   --cst-offset      vertical step between stacked cards
 *   --cst-scale-step  scale lost by each card further back
 *   --cst-z           z-index of the whole stack
 *   --cst-n           card count (set inline by PHP)
 *   --cst-i           slot of one card, 0 is the top card (set inline by PHP)
 */

.cst-4d9e72 {
	--cst-w: 400px;
	--cst-ar: 1 / 1;
	--cst-offset: 20px;
	--cst-scale-step: 0.04;
	--cst-z: 5;

	position: relative;
	z-index: var(--cst-z);
	width: var(--cst-w);
	max-width: 100%;
	margin-right: auto;
	margin-left: auto;
}

.cst-4d9e72,
.cst-4d9e72 *,
.cst-4d9e72 *::before,
.cst-4d9e72 *::after {
	box-sizing: border-box;
}

.cst-4d9e72__stage {
	position: relative;
	width: 100%;
	aspect-ratio: var(--cst-ar);
}

/* Each card fills the stage. Slot i moves it down by i offsets and shrinks it by i steps. */
.cst-4d9e72__card {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: calc(var(--cst-n, 1) - var(--cst-i, 0));
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 40px 30px;
	border-radius: 10px;
	background-color: #252322;
	color: #fff;
	text-align: center;
	transform-origin: 50% 50%;
	transform: translateY(calc(var(--cst-i, 0) * var(--cst-offset))) scale(calc(1 - var(--cst-i, 0) * var(--cst-scale-step)));
	will-change: transform;
	backface-visibility: hidden;
}

/* Font families follow the kit globals, so a change in Site Settings reaches the cards. */
.cst-4d9e72__num {
	display: block;
	margin: 0 0 50px;
	font-family: var(--e-global-typography-primary-font-family, serif), serif;
	font-size: 110px;
	font-weight: 400;
	line-height: 1;
	color: rgba(255, 255, 255, 0.4);
}

.cst-4d9e72__body {
	display: flex;
	flex-direction: column;
	align-items: inherit;
	gap: 10px;
	max-width: 100%;
}

.cst-4d9e72__title {
	margin: 0;
	font-family: var(--e-global-typography-secondary-font-family, sans-serif), sans-serif;
	font-size: 24px;
	font-weight: 700;
	letter-spacing: 1.2px;
	line-height: 1.2;
	text-transform: uppercase;
	color: #c4a667;
}

.cst-4d9e72__text {
	margin: 0;
	font-family: var(--e-global-typography-text-font-family, sans-serif), sans-serif;
	font-size: 14px;
	font-weight: 400;
	line-height: 1.45;
	color: #fff;
}

/*
 * List layout: every card is shown one under the other, with no stacking and no motion.
 * Used for visitors who prefer reduced motion, and by JS when GSAP did not load, so the
 * card text is never hidden behind another card.
 */
.cst-4d9e72--list .cst-4d9e72__stage {
	display: grid;
	gap: 20px;
	aspect-ratio: auto;
}

.cst-4d9e72--list .cst-4d9e72__card {
	position: relative;
	top: auto;
	right: auto;
	bottom: auto;
	left: auto;
	z-index: auto;
	aspect-ratio: var(--cst-ar);
	transform: none;
	will-change: auto;
}

@media (prefers-reduced-motion: reduce) {
	.cst-4d9e72__stage {
		display: grid;
		gap: 20px;
		aspect-ratio: auto;
	}

	.cst-4d9e72__card {
		position: relative;
		top: auto;
		right: auto;
		bottom: auto;
		left: auto;
		z-index: auto;
		aspect-ratio: var(--cst-ar);
		transform: none;
		will-change: auto;
	}
}

/*
 * The pinned container (set by JS). Elementor adds a transform transition to every container,
 * which makes the section slide when GSAP releases the pin. Keep the other transitions.
 */
.cst-4d9e72-pinned {
	transition-property: background, border, border-radius, box-shadow !important;
}

/*
 * Fill the width of the parent container. In a column container whose items shrink to fit, a
 * percentage card width (the mobile default is 100%) is circular, the widget collapses to zero
 * height and the pinned box no longer contains the cards. A full-width wrapper breaks the cycle;
 * the stack itself still uses --cst-w and stays centred.
 */
.elementor-widget-cards_stack_sticky_4d9e72 {
	width: 100%;
}
