/* CX 3D Carousel — override any of these variables in your theme or via the shortcode "background" attribute */
.cx3d {
	--cx-bg: transparent;
	--cx-accent: #5b2a86;          /* arrow buttons */
	--cx-card-w: clamp(240px, 27vw, 430px);
	--cx-card-h: calc(var(--cx-card-w) * 1.35);
	--cx-step: calc(var(--cx-card-w) * .75);
	--cx-display: "Josefin Sans", "Century Gothic", "Trebuchet MS", sans-serif;

	position: relative;
	box-sizing: border-box;
	width: 100%;
	padding: 56px 0 72px;
	background: var(--cx-bg);
	color: #fff;
	overflow: hidden;
	font-family: var(--cx-display);
	user-select: none;
	-webkit-user-select: none;
}
.cx3d *, .cx3d *::before, .cx3d *::after { box-sizing: border-box; }

.cx3d__head { text-align: center; padding: 0 20px 32px; }
.cx3d__title { margin: 0; font: 700 clamp(24px, 3vw, 36px)/1.15 var(--cx-display); letter-spacing: .12em; color: #fff; }
.cx3d__subtitle { margin: 8px 0 0; font: 600 14px/1.4 var(--cx-display); letter-spacing: .1em; color: rgba(255,255,255,.75); }

/* ---------- layout: 3 cards visible (centre + one either side), arrows outside them ---------- */
.cx3d__wrap { position: relative; }

/* ---------- stage ---------- */
.cx3d__stage {
	position: relative;
	height: calc(var(--cx-card-h) + 40px);
	perspective: 1600px;
	touch-action: pan-y;
	outline: none;
	cursor: grab;
}
.cx3d__stage:active { cursor: grabbing; }
.cx3d__stage:focus-visible { outline: 2px solid #fff; outline-offset: -6px; }

.cx3d__slide {
	--o: 0; --abs: 0; --sgn: 0; --x: 0;
	position: absolute;
	top: 50%; left: 50%;
	width: var(--cx-card-w);
	height: var(--cx-card-h);
	margin: calc(var(--cx-card-h) / -2) 0 0 calc(var(--cx-card-w) / -2);
	transform-style: preserve-3d;
	/* flat side cards: no tilt, 80% of the centre card, sitting behind it */
	transform:
		translateX(calc(var(--x) * var(--cx-step)))
		scale(calc(1 - var(--abs) * .2));
	z-index: calc(10 - var(--abs));
	opacity: 1;
	transition: transform .7s cubic-bezier(.22,.8,.24,1), opacity .5s ease;
	box-shadow: 0 18px 40px rgba(0,0,0,.35);
	background: #fff;
	cursor: pointer;
}
.cx3d__slide.is-active { cursor: default; box-shadow: 0 26px 60px rgba(0,0,0,.5); }
.cx3d__slide.is-hidden { opacity: 0; pointer-events: none; }
.cx3d.is-dragging .cx3d__slide { transition: none; }

/* white mat behind the active card, like the reference */
.cx3d__slide.is-active::before {
	content: "";
	position: absolute; inset: -10px -10px auto auto;
	width: 100%; height: 100%;
	background: rgba(255,255,255,.9);
	z-index: -1;
}

.cx3d__media { position: absolute; inset: 0; overflow: hidden; background: #3a2a4a center/cover no-repeat; /* set per slide from the admin "Background image" */ }

/* dim the side cards */
.cx3d__media::after {
	content: ""; position: absolute; inset: 0;
	background: #1a1218;
	opacity: calc(var(--abs) * .38);
	transition: opacity .7s ease;
}

/* ---------- caption ---------- */
.cx3d__caption {
	position: absolute; inset: auto 0 9% 0;   /* lifted above the bottom edge of the image */
	height: 40%;
	display: flex; align-items: center; justify-content: center;
	padding: 0 8%;
	text-align: center;
}
.cx3d__box {
	width: 100%;
	padding: clamp(14px, 1.8vw, 26px) 8px;
	transition: background .5s ease, box-shadow .5s ease;
}
.cx3d__slide.is-active .cx3d__box {
	background: rgb(38 32 36 / 57%);
	box-shadow: 0 0 0 10px rgba(255,255,255,.28);
	backdrop-filter: blur(1px);
}
.cx3d__name {
	margin: 0;
	font: 700 clamp(18px, 2.3vw, 34px)/1.12 var(--cx-display);
	letter-spacing: .1em; text-transform: uppercase; color: #fff;
}
.cx3d__slide:not(.is-active) .cx3d__name { color: rgba(255,255,255,.85); }

.cx3d__btn {
	display: inline-block; margin-top: clamp(10px, 1.6vw, 22px);
	padding: 10px 26px 8px;
	font: 700 clamp(11px, 1vw, 13px)/1 var(--cx-display);
	letter-spacing: .06em; text-transform: uppercase;
	color: #fff; text-decoration: none;
	border-top: 1px solid rgba(255,255,255,.45);
	border-bottom: 1px solid rgba(255,255,255,.45);
	transition: background .25s, letter-spacing .25s;
}
.cx3d__btn:hover, .cx3d__btn:focus-visible { background: rgba(255,255,255,.16); letter-spacing: .12em; color: #fff; }
.cx3d__slide:not(.is-active) .cx3d__btn { visibility: hidden; }

/* ---------- arrows ---------- */
.cx3d__arrow {
	position: absolute; top: 50%; z-index: 30;
	width: 60px; height: 60px; margin-top: -30px; padding: 0;
	display: grid; place-items: center;
	background: #C29753; color: rgba(255,255,255,.75);
	border: 0; border-radius: 0; cursor: pointer;
	transition: background .25s, color .25s;
}
.cx3d__arrow:hover, .cx3d__arrow:focus-visible { background: #000000; color: #fff; }
.cx3d__arrow:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
/* placed just outside the outer edge of the side cards (edge = about 1.15 x card width from centre) */
.cx3d__arrow--prev { left:  max(8px, calc(50% - var(--cx-card-w) * 1.19 - 76px)); }
.cx3d__arrow--next { right: max(8px, calc(50% - var(--cx-card-w) * 1.19 - 76px)); }
.cx3d__arrow[disabled] { opacity: .35; cursor: default; }

/* ---------- responsive ---------- */
@media (max-width: 1024px) {
	.cx3d { --cx-card-w: clamp(220px, 30vw, 340px); --cx-step: calc(var(--cx-card-w) * .72); }
}
@media (max-width: 720px) {
	.cx3d { --cx-card-w: min(66vw, 320px); --cx-step: calc(var(--cx-card-w) * .62); padding: 36px 0 56px; }
	.cx3d__slide { box-shadow: 0 10px 24px rgba(0,0,0,.35); }
	.cx3d__slide.is-active::before { inset: -6px -6px auto auto; }
	.cx3d__slide.is-active .cx3d__box { box-shadow: 0 0 0 6px rgba(255,255,255,.28); }
	/* arrows sit under the slider on small screens */
	/* .cx3d__wrap { padding-bottom: 64px; }
	.cx3d__arrow { top: auto; bottom: 0; margin-top: 0; width: 44px; height: 44px; }
	.cx3d__arrow svg { width: 22px; height: 22px; }
	.cx3d__arrow--prev { left: calc(50% - 52px); }
	.cx3d__arrow--next { right: calc(50% - 52px); } */
}
@media (prefers-reduced-motion: reduce) {
	.cx3d__slide, .cx3d__media::after, .cx3d__box { transition-duration: .01ms; }
}
