/**
 * Voyage Carousel — frontend styles.
 * Every colour and size comes from a custom property so PHP can override per instance.
 */

.vcg {
	--vcg-card-w: 240px;
	--vcg-card-h: 380px;
	--vcg-accent: #ff7a2f;
	--vcg-bg: #0c0e12;
	--vcg-stage-h: calc(var(--vcg-card-h) + 220px);
	--vcg-line: rgba(255, 255, 255, 0.14);
	--vcg-zoom: 1.22;
	--vcg-caption-inset: 52px;
	--vcg-title-size: 26px;
	--vcg-title-color: #ffffff;
	--vcg-title-weight: 600;
	--vcg-title-spacing: 0.01em;
	--vcg-title-transform: none;
	--vcg-sub-size: 12px;
	--vcg-sub-color: rgba(255, 255, 255, 0.72);

	position: relative;
	overflow: hidden;
	background: var(--vcg-bg);
	color: #fff;
	isolation: isolate;
}

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

/* ---------- Blurred backdrop ---------- */
.vcg-backdrop {
	position: absolute;
	inset: -14%;
	z-index: 0;
	pointer-events: none;
}

.vcg-backdrop img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	filter: blur(60px) saturate(1.3) brightness(0.5);
	opacity: 0;
	transition: opacity 0.9s ease;
	margin: 0;
}

.vcg-backdrop img.is-on {
	opacity: 1;
}

.vcg-backdrop::after {
	content: "";
	position: absolute;
	inset: 0;
	background: radial-gradient(120% 90% at 50% 45%, transparent 18%, rgba(0, 0, 0, 0.6) 70%, rgba(0, 0, 0, 0.88) 100%);
}

/* ---------- Stage ---------- */
.vcg-stage {
	position: relative;
	z-index: 2;
	min-height: var(--vcg-stage-h);
	display: flex;
	align-items: center;
	justify-content: center;
	perspective: 1700px;
	padding: 60px 0 96px;
	-webkit-user-select: none;
	user-select: none;
	touch-action: pan-y;
}

.vcg-track {
	position: relative;
	width: 100%;
	height: var(--vcg-card-h);
	transform-style: preserve-3d;
}

/* ---------- Slides ---------- */
.vcg-slide {
	position: absolute;
	top: 50%;
	left: 50%;
	width: var(--vcg-card-w);
	height: var(--vcg-card-h);
	margin: calc(var(--vcg-card-h) / -2) 0 0 calc(var(--vcg-card-w) / -2);
	padding: 0;
	border: 0;
	border-radius: 10px;
	overflow: hidden;
	background: #1a1d22;
	cursor: pointer;
	box-shadow: 0 26px 60px rgba(0, 0, 0, 0.55);
	transform-style: preserve-3d;
	backface-visibility: hidden;
	transition:
		transform 0.72s cubic-bezier(0.22, 0.72, 0.24, 1),
		opacity 0.55s ease,
		filter 0.6s ease,
		box-shadow 0.5s ease;
}

.vcg-slide .vcg-img,
.vcg-slide img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	margin: 0;
	max-width: none;
	border-radius: 0;
	transition: transform 0.9s cubic-bezier(0.22, 0.72, 0.24, 1);
}

.vcg-shade {
	position: absolute;
	inset: 0;
	background: linear-gradient(to top, rgba(6, 8, 11, 0.9) 0%, rgba(6, 8, 11, 0.35) 42%, rgba(6, 8, 11, 0.04) 72%);
	opacity: 0;
	transition: opacity 0.5s ease;
}

.vcg-slide.is-active {
	cursor: zoom-in;
	box-shadow: 0 40px 90px rgba(0, 0, 0, 0.7);
}

.vcg-slide.is-active .vcg-shade {
	opacity: 1;
}

.vcg-slide.is-active:hover img {
	transform: scale(1.05);
}

.vcg-slide:focus-visible {
	outline: 2px solid var(--vcg-accent);
	outline-offset: 4px;
}

/* Soft press when the centre card is clicked. */
@keyframes vcg-tap {
	0% {
		transform: var(--vcg-tf) scale(1);
	}
	38% {
		transform: var(--vcg-tf) scale(0.955);
	}
	100% {
		transform: var(--vcg-tf) scale(1);
	}
}

.vcg-slide.is-tapped {
	animation: vcg-tap 0.42s cubic-bezier(0.3, 0.8, 0.3, 1);
}

/* ---------- Caption ----------
   Anchored to the bottom of the *centre card* rather than the bottom of the
   stage, so it keeps the same breathing room whatever the card height or
   zoom is. --vcg-caption-inset is the gap between the text baseline block
   and the card's lower edge. */
.vcg-caption {
	position: absolute;
	left: 50%;
	top: 50%;
	bottom: auto;
	transform: translate(
		-50%,
		calc((var(--vcg-card-h) * var(--vcg-zoom) / 2) - var(--vcg-caption-inset) - 100%)
	);
	z-index: 6;
	width: min(620px, calc(var(--vcg-card-w) * var(--vcg-zoom) - 30px));
	text-align: center;
	pointer-events: none;
}

.vcg-caption-title {
	margin: 0 0 8px;
	/* Scales down on narrow screens but never past 62% of the set size. */
	font-size: clamp(
		calc(var(--vcg-title-size) * 0.62),
		calc(var(--vcg-title-size) * 0.55 + 1.1vw),
		var(--vcg-title-size)
	);
	font-weight: var(--vcg-title-weight);
	line-height: 1.12;
	letter-spacing: var(--vcg-title-spacing);
	text-transform: var(--vcg-title-transform);
	color: var(--vcg-title-color);
	text-shadow: 0 4px 30px rgba(0, 0, 0, 0.6);
}

.vcg-caption-sub {
	margin: 0;
	font-size: var(--vcg-sub-size);
	letter-spacing: 0.08em;
	color: var(--vcg-sub-color);
	text-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
}

@keyframes vcg-up {
	from {
		opacity: 0;
		transform: translateY(16px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

.vcg-caption.is-swapping .vcg-caption-title,
.vcg-caption.is-swapping .vcg-caption-sub {
	animation: vcg-up 0.55s cubic-bezier(0.2, 0.7, 0.3, 1);
}

/* ---------- Arrows and dots ---------- */
.vcg-arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 7;
	width: 44px;
	height: 44px;
	display: grid;
	place-items: center;
	border-radius: 50%;
	border: 1px solid var(--vcg-line);
	background: rgba(255, 255, 255, 0.07);
	color: #fff;
	cursor: pointer;
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
	transition: background 0.2s ease, transform 0.2s ease;
}

.vcg-arrow:hover {
	background: rgba(255, 255, 255, 0.2);
}

.vcg-arrow:focus-visible {
	outline: 2px solid var(--vcg-accent);
	outline-offset: 3px;
}

.vcg-prev {
	left: max(24px, 5%);
}

.vcg-next {
	right: max(24px, 5%);
}

.vcg-prev:hover {
	transform: translateY(-50%) translateX(-3px);
}

.vcg-next:hover {
	transform: translateY(-50%) translateX(3px);
}

.vcg-arrow[disabled] {
	opacity: 0.3;
	cursor: default;
	pointer-events: none;
}

.vcg-dots {
	position: absolute;
	bottom: 34px;
	left: 50%;
	transform: translateX(-50%);
	z-index: 7;
	display: flex;
	gap: 9px;
}

.vcg-dots button {
	width: 7px;
	height: 7px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.28);
	cursor: pointer;
	transition: width 0.35s ease, background 0.35s ease;
}

.vcg-dots button.is-on {
	width: 26px;
	border-radius: 99px;
	background: var(--vcg-accent);
}

/* ---------- Detail view ---------- */
.vcg-detail {
	position: fixed;
	inset: 0;
	z-index: 999990;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 5vh 5vw;
	background: rgba(6, 8, 11, 0.9);
	-webkit-backdrop-filter: blur(14px);
	backdrop-filter: blur(14px);
}

.vcg-detail.is-open {
	display: flex;
	animation: vcg-fade 0.3s ease;
}

@keyframes vcg-fade {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

@keyframes vcg-pop {
	from {
		opacity: 0;
		transform: translateY(26px) scale(0.97);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

.vcg-detail-inner {
	display: grid;
	grid-template-columns: 1.15fr 0.85fr;
	gap: 44px;
	align-items: center;
	width: 100%;
	max-width: 1050px;
	animation: vcg-pop 0.55s cubic-bezier(0.2, 0.75, 0.25, 1);
}

.vcg-detail-inner img {
	width: 100%;
	height: min(66vh, 560px);
	object-fit: cover;
	border-radius: 12px;
	display: block;
	margin: 0;
}

.vcg-detail-title {
	margin: 0 0 14px;
	font-size: clamp(24px, 3vw, 34px);
	font-weight: 800;
	line-height: 1.1;
	text-transform: uppercase;
	letter-spacing: 0.02em;
	color: #fff;
}

.vcg-detail-desc {
	margin: 0 0 24px;
	font-size: 15px;
	line-height: 1.7;
	color: rgba(255, 255, 255, 0.66);
}

.vcg-facts {
	display: flex;
	flex-wrap: wrap;
	gap: 30px;
	margin-bottom: 28px;
}

.vcg-facts span {
	display: block;
	margin-bottom: 5px;
	font-size: 10px;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, 0.4);
}

.vcg-facts strong {
	font-size: 17px;
	font-weight: 600;
	color: #fff;
}

.vcg-cta {
	display: inline-block;
	padding: 12px 26px;
	border: 0;
	border-radius: 999px;
	background: var(--vcg-accent);
	color: #151515;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	text-decoration: none;
	cursor: pointer;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.vcg-cta:hover {
	transform: translateY(-1px);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
	color: #151515;
}

.vcg-detail-close {
	position: absolute;
	top: 24px;
	right: 30px;
	padding: 6px;
	border: 0;
	background: none;
	color: rgba(255, 255, 255, 0.6);
	cursor: pointer;
	line-height: 1;
}

.vcg-detail-close:hover {
	color: #fff;
}

.vcg-empty {
	padding: 18px;
	border: 1px dashed #c3c4c7;
	border-radius: 6px;
	background: #fff;
	color: #50575e;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
	.vcg {
		--vcg-card-w: 200px;
		--vcg-card-h: 310px;
		--vcg-caption-inset: 42px;
	}

	.vcg-detail-inner {
		grid-template-columns: 1fr;
		gap: 22px;
		max-height: 86vh;
		overflow-y: auto;
	}

	.vcg-detail-inner img {
		height: 32vh;
	}
}

@media (max-width: 560px) {
	.vcg {
		--vcg-card-w: 168px;
		--vcg-card-h: 262px;
		--vcg-caption-inset: 34px;
	}

	.vcg-stage {
		padding: 40px 0 80px;
	}

	.vcg-arrow {
		width: 38px;
		height: 38px;
	}

	.vcg-facts {
		gap: 20px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.vcg *,
	.vcg-detail * {
		animation-duration: 0.01ms !important;
		transition-duration: 0.14s !important;
	}
}

/* ==========================================================================
   Gold corner accents
   Four L-shaped brackets drawn with background gradients, so no extra markup
   is needed. Retune from the custom properties below, or override any of them
   in Appearance -> Customise -> Additional CSS.
   ========================================================================== */

.vcg {
	--vcg-gold: #c9a140;         /* base gold */
	--vcg-gold-hi: #f2d98a;      /* highlight, used on the active card */
	--vcg-corner-len: 34px;      /* how long each arm is */
	--vcg-corner-w: 1.5px;       /* how thick each arm is */
	--vcg-corner-inset: 10px;    /* distance from the card edge */
	--vcg-corner-len-active: 46px;
}

/* Photo sits flush; only a whisper of gold rings the card. */
.vcg .vcg-slide {
	padding: 0;
	border-radius: 3px;
	background: #0b0d11;
	box-shadow:
		0 0 0 1px rgba(201, 161, 64, 0.34),
		0 26px 60px rgba(0, 0, 0, 0.55);
}

/* The four brackets. Eight gradient layers: a horizontal arm and a
   vertical arm pinned to each corner. */
.vcg .vcg-slide::after {
	content: "";
	position: absolute;
	inset: var(--vcg-corner-inset);
	z-index: 5;
	pointer-events: none;
	background-repeat: no-repeat;
	background-image:
		linear-gradient(var(--vcg-gold), var(--vcg-gold)),
		linear-gradient(var(--vcg-gold), var(--vcg-gold)),
		linear-gradient(var(--vcg-gold), var(--vcg-gold)),
		linear-gradient(var(--vcg-gold), var(--vcg-gold)),
		linear-gradient(var(--vcg-gold), var(--vcg-gold)),
		linear-gradient(var(--vcg-gold), var(--vcg-gold)),
		linear-gradient(var(--vcg-gold), var(--vcg-gold)),
		linear-gradient(var(--vcg-gold), var(--vcg-gold));
	background-position:
		left top, left top,
		right top, right top,
		left bottom, left bottom,
		right bottom, right bottom;
	background-size:
		var(--vcg-corner-len) var(--vcg-corner-w),
		var(--vcg-corner-w) var(--vcg-corner-len),
		var(--vcg-corner-len) var(--vcg-corner-w),
		var(--vcg-corner-w) var(--vcg-corner-len),
		var(--vcg-corner-len) var(--vcg-corner-w),
		var(--vcg-corner-w) var(--vcg-corner-len),
		var(--vcg-corner-len) var(--vcg-corner-w),
		var(--vcg-corner-w) var(--vcg-corner-len);
	transition:
		background-size 0.55s cubic-bezier(0.22, 0.72, 0.24, 1),
		opacity 0.45s ease;
	opacity: 0.75;
}

/* Centre card: longer, brighter arms and a warm glow. */
.vcg .vcg-slide.is-active::after {
	opacity: 1;
	background-image:
		linear-gradient(var(--vcg-gold-hi), var(--vcg-gold-hi)),
		linear-gradient(var(--vcg-gold-hi), var(--vcg-gold-hi)),
		linear-gradient(var(--vcg-gold-hi), var(--vcg-gold-hi)),
		linear-gradient(var(--vcg-gold-hi), var(--vcg-gold-hi)),
		linear-gradient(var(--vcg-gold-hi), var(--vcg-gold-hi)),
		linear-gradient(var(--vcg-gold-hi), var(--vcg-gold-hi)),
		linear-gradient(var(--vcg-gold-hi), var(--vcg-gold-hi)),
		linear-gradient(var(--vcg-gold-hi), var(--vcg-gold-hi));
	background-size:
		var(--vcg-corner-len-active) var(--vcg-corner-w),
		var(--vcg-corner-w) var(--vcg-corner-len-active),
		var(--vcg-corner-len-active) var(--vcg-corner-w),
		var(--vcg-corner-w) var(--vcg-corner-len-active),
		var(--vcg-corner-len-active) var(--vcg-corner-w),
		var(--vcg-corner-w) var(--vcg-corner-len-active),
		var(--vcg-corner-len-active) var(--vcg-corner-w),
		var(--vcg-corner-w) var(--vcg-corner-len-active);
}

.vcg .vcg-slide.is-active {
	box-shadow:
		0 0 0 1px rgba(242, 217, 138, 0.5),
		0 0 34px rgba(201, 161, 64, 0.18),
		0 40px 90px rgba(0, 0, 0, 0.7);
}

/* Keep the caption gradient below the brackets. */
.vcg .vcg-shade {
	z-index: 2;
}

.vcg .vcg-slide img,
.vcg .vcg-slide .vcg-img {
	border-radius: 3px;
}

/* Serif caption, to match the restrained frame. Weight, spacing and case now
   come from the variables above so the settings screen stays in charge. */
.vcg .vcg-caption-title {
	font-family: var(--vcg-title-font, "Cormorant Garamond", "Playfair Display", Georgia, serif);
}

@media (max-width: 560px) {
	.vcg {
		--vcg-corner-len: 24px;
		--vcg-corner-len-active: 32px;
		--vcg-corner-inset: 7px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.vcg .vcg-slide::after {
		transition: none;
	}
}
