/* ── Advanced Carousel Widget (advc) ───────────────────────────────────────── */

/* The stack-maths values live here as custom properties and are read back by
   assets/js/advanced-carousel.js via getComputedStyle, so each number exists in
   exactly one place. They are deliberately unitless — the JS composes the px
   itself when it builds each transform. Elementor's Style controls override
   these on the same element. */
.advc {
	--advc-offset-x: 28;
	--advc-offset-y: 32;
	--advc-depth-z: 60;
	--advc-rotation: 2;
	--advc-fade-step: 0.15;
	--advc-visible-cards: 4;
	--advc-transition: 800ms;

	position: relative;
	width: 100%;
	max-width: 520px;
	aspect-ratio: 4 / 5;
	perspective: 1600px;
	/* Centre the stage in its column. Without the auto side margins the stage
	   sits flush left and every bit of the column's slack collects on the
	   right, which reads as a one-sided padding. Centred, the front card is
	   evenly inset and the deck fans into the right-hand slack, as intended. */
	margin-left: auto;
	margin-right: auto;
	/* Room for the controls (which hang 52px below) and for the fan, which
	   spills past the stage box. Deliberately NOT derived from offset-y x card
	   count: the fanned cards are pushed back in Z at the same time, and
	   perspective foreshortens that drop by ~13% at the deepest card, so the
	   raw translate over-reserves badly (180px for a 69px overhang at the
	   defaults). The true figure needs the stage height and a perspective
	   divide, neither of which calc() can reach — so this is a sensible
	   default, overridable via Style > Stage > Bottom Spacing. */
	margin-bottom: 72px;
}

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

.advc-card {
	position: absolute;
	inset: 0;
	border: 1px solid rgba(255, 255, 255, 0.14);
	border-radius: 6px;
	overflow: hidden;
	box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.6);
	transition: transform var(--advc-transition, 800ms) cubic-bezier(0.2, 0.7, 0.2, 1), opacity 0.6s ease;
	/* Justified here (unlike a permanently-running animation): the transform
	   changes on discrete advances, so the layer wants to exist beforehand. */
	will-change: transform;
	/* Pre-JS / no-JS state — only the front card shows, flat, so the deck does
	   not flash as an opaque pile before the first paint. JS then writes
	   transform / z-index / opacity inline, which wins over these. */
	opacity: 0;
}

.advc-card:first-child {
	opacity: 1;
}

/* Set by JS around its very first paint, so the deck lands already fanned
   instead of visibly dealing itself out of the flat pile on load. */
.advc.advc-init .advc-card {
	transition: none;
}

.advc-card__link {
	display: block;
	width: 100%;
	height: 100%;
	text-decoration: none;
	color: inherit;
}

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

.advc-label {
	position: absolute;
	left: 14px;
	bottom: 14px;
	padding: 6px 10px;
	border-radius: 4px;
	background: rgba(0, 0, 0, 0.4);
	color: #ffffff;
	font-size: 0.8rem;
	line-height: 1.2;
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
}

.advc-corner {
	position: absolute;
	right: 14px;
	top: 14px;
	padding: 4px 8px;
	border-radius: 4px;
	background: rgba(0, 0, 0, 0.35);
	color: rgba(255, 255, 255, 0.85);
	font-size: 0.7rem;
	line-height: 1.2;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
}

.advc-controls {
	position: absolute;
	right: 0;
	bottom: -52px;
	display: flex;
	gap: 8px;
	align-items: center;
	/* Above every card, whatever the slide count sets z-index to. */
	z-index: 999;
}

.advc-counter {
	margin-right: 6px;
	color: rgba(255, 255, 255, 0.7);
	font-size: 0.8rem;
	font-variant-numeric: tabular-nums;
	letter-spacing: 0.08em;
	white-space: nowrap;
}

.advc-controls button {
	width: 36px;
	height: 36px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: rgba(255, 255, 255, 0.1);
	color: #ffffff;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
	transition: background 0.2s;
}

.advc-controls button:hover {
	background: rgba(255, 255, 255, 0.22);
}

.advc-controls button:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.advc-controls button svg {
	width: 16px;
	height: 16px;
	fill: none;
	stroke: currentColor;
	pointer-events: none;
}

.advc[data-draggable="1"] {
	cursor: grab;
	touch-action: pan-y;
}

.advc[data-draggable="1"].is-dragging {
	cursor: grabbing;
}

@media (prefers-reduced-motion: reduce) {
	/* Autoplay is also skipped in JS under this preference; this drops the
	   travel so an advance is an instant swap rather than a long glide. */
	.advc-card {
		transition: none;
		will-change: auto;
	}
}
