/*
 * Custom Cards Carousel (hash c7d2e4).
 *
 * Structural rules only. Anything an Elementor control owns (card size, colours, radius,
 * padding, title typography, icon size and background, dot size and colours, animation values)
 * is deliberately NOT declared here. Controls feed CSS custom properties on .ccc-c7d2e4 and the
 * var() fallbacks below only exist so the layout cannot collapse if a variable is missing.
 *
 * State model: JS sets --ccc-pos on every card (-1 left, 0 centre, 1 right) and toggles
 * .is-active. Position, rotation and scale are all derived from that one variable.
 *
 * Overflow: the widget does NOT clip. The fanned side cards can extend past the widget box and
 * the viewport, so the parent container must handle it (for example overflow hidden on a full
 * width container), otherwise the page can get a horizontal scrollbar.
 *
 * Layering: side cards sit at z-index 1 and the active card at 3. z-index is part of the card
 * transition, so while cards swap it steps 3, 2, 1 on the outgoing centre card and 1, 2, 3 on
 * the incoming one, and the card wrapping from one side to the other (always z-index 1) stays
 * underneath both instead of flipping above the old centre card.
 *
 * Backdrop root note: backdrop-filter on the icon only sees what is behind it inside the nearest
 * backdrop root. Do not add filter, opacity below 1, mask or clip-path to .ccc-c7d2e4__card or
 * its ancestors, or the icon blur stops working. The greyscale filter is applied to the image
 * only, a sibling of the icon, so it is safe.
 */

.ccc-c7d2e4 {
	width: 100%;
	max-width: 100%;
}

.ccc-c7d2e4 *,
.ccc-c7d2e4 *::before,
.ccc-c7d2e4 *::after {
	box-sizing: border-box;
}

/* Stage: fixed height from the card height control. No overflow rule, see the note above.
   pan-y keeps vertical page scroll working while horizontal gestures reach the swipe handler. */
.ccc-c7d2e4__stage {
	position: relative;
	width: 100%;
	height: var(--ccc-h, 450px);
	touch-action: pan-y;
	-webkit-user-select: none;
	user-select: none;
	-webkit-tap-highlight-color: transparent;
}

.ccc-c7d2e4__stage:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 6px;
}

/* Card: centred in the stage, positioned by --ccc-pos. translate percentages refer to the
   card itself, so offsets scale with the card width control. */
.ccc-c7d2e4__card {
	position: absolute;
	top: 0;
	left: 50%;
	z-index: 1;
	display: flex;
	flex-direction: column;
	width: var(--ccc-w, 300px);
	height: 100%;
	cursor: pointer;
	transform-origin: 50% 50%;
	transform:
		translateX( calc( -50% + var(--ccc-pos, 0) * var(--ccc-offset, 80) * 1% ) )
		translateY( var(--ccc-ty, 0) )
		rotate( calc( var(--ccc-pos, 0) * var(--ccc-rot, 14) * 1deg ) )
		scale( var(--ccc-s, 1) );
	transition:
		transform var(--ccc-dur, 600ms) var(--ccc-ease, ease-in-out),
		background-color var(--ccc-dur, 600ms) var(--ccc-ease, ease-in-out),
		box-shadow var(--ccc-dur, 600ms) var(--ccc-ease, ease-in-out),
		z-index var(--ccc-dur, 600ms) var(--ccc-ease, ease-in-out);
	will-change: transform;
}

.ccc-c7d2e4__card.is-active {
	z-index: 3;
	--ccc-s: 1;
	--ccc-ty: 0;
}

.ccc-c7d2e4__card:not(.is-active) {
	--ccc-s: var(--ccc-inactive-scale, 0.9);
	--ccc-ty: calc( var(--ccc-drop, 6) * 1% );
}

/* Intro state: side cards tucked behind the centre card with a gentler tilt and a touch
   smaller. Removing .is-stacked (JS, on first view) lets the transition above fan them out. */
.ccc-c7d2e4.is-stacked .ccc-c7d2e4__card {
	transform:
		translateX( calc( -50% + var(--ccc-pos, 0) * var(--ccc-stack, 15) * 1% ) )
		translateY( var(--ccc-ty, 0) )
		rotate( calc( var(--ccc-pos, 0) * var(--ccc-rot, 14) * 0.3deg ) )
		scale( var(--ccc-s, 1) );
}

.ccc-c7d2e4.is-stacked .ccc-c7d2e4__card:not(.is-active) {
	--ccc-s: calc( var(--ccc-inactive-scale, 0.9) * 0.94 );
}

/* Title: reserves two lines so every card has the same image top whether the title wraps or
   not. The bottom margin clears the icon, which overlaps the image top by half its size. */
.ccc-c7d2e4__title {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	min-height: 2lh;
	margin: 0 0 calc( var(--ccc-icon-wrap, 70px) / 2 + 8px );
	text-align: center;
	text-wrap: balance;
	overflow-wrap: anywhere;
}

/* Stretched link: the ::after covers the whole card (the card is the positioned ancestor).
   Only the active card follows it, JS intercepts clicks on the others. */
.ccc-c7d2e4__link,
.ccc-c7d2e4__link:hover,
.ccc-c7d2e4__link:focus {
	color: inherit;
	text-align: center;
	text-decoration: none;
}

.ccc-c7d2e4__link::after {
	content: '';
	position: absolute;
	inset: 0;
	z-index: 1;
}

.ccc-c7d2e4__link:focus-visible {
	outline: none;
}

.ccc-c7d2e4__link:focus-visible::after {
	outline: 2px solid currentColor;
	outline-offset: 4px;
	border-radius: inherit;
}

/* Media fills the rest of the card, or takes the Image Height control when it is set. The image
   wrapper clips the image to its radius; the icon is a sibling so it can straddle the image top
   edge without being clipped. */
.ccc-c7d2e4__media {
	position: relative;
	flex: 1 1 auto;
	min-height: 0;
}

.ccc-c7d2e4__img {
	position: absolute;
	inset: 0;
	overflow: hidden;
}

.ccc-c7d2e4__image {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	-webkit-user-drag: none;
	transition: filter var(--ccc-dur, 600ms) var(--ccc-ease, ease-in-out);
}

.ccc-c7d2e4--grayscale .ccc-c7d2e4__card:not(.is-active) .ccc-c7d2e4__image {
	filter: grayscale(100%);
}

/* Icon: circle centred on the top edge of the image. Size and look come from controls. */
.ccc-c7d2e4__icon {
	position: absolute;
	top: 0;
	left: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	width: var(--ccc-icon-wrap, 70px);
	height: var(--ccc-icon-wrap, 70px);
	border-radius: 50%;
	line-height: 1;
	transform: translate( -50%, -50% );
	pointer-events: none;
}

.ccc-c7d2e4__icon svg {
	display: block;
	flex: none;
	width: 1em;
	height: 1em;
}

.ccc-c7d2e4__icon i {
	line-height: 1;
}

/* Navigation dots. Theme button styles are neutralised so the controls fully own the look.
   Width and height animate so an Active Dot Size larger than Dot Size grows smoothly. */
.ccc-c7d2e4__nav {
	display: flex;
	align-items: center;
	justify-content: center;
}

.ccc-c7d2e4__dot {
	display: block;
	flex: none;
	min-width: 0;
	min-height: 0;
	margin: 0;
	padding: 0;
	border-width: 1px;
	border-style: solid;
	border-radius: 50%;
	background-color: transparent;
	box-shadow: none;
	line-height: 0;
	font-size: 0;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
	transition: background-color 0.3s ease, border-color 0.3s ease, width 0.3s ease, height 0.3s ease;
}

.ccc-c7d2e4__dot:hover,
.ccc-c7d2e4__dot:focus {
	background-color: transparent;
	box-shadow: none;
}

.ccc-c7d2e4__dot:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
	.ccc-c7d2e4__card,
	.ccc-c7d2e4__image,
	.ccc-c7d2e4__dot {
		transition: none;
	}
}
