/* =============================================================================
   Cinematic Shoes Gallery — styles
   Premium, minimal, full-bleed scroll gallery. No borders, no cards, no
   flashy effects — everything here is in service of one calm, large image
   at a time.
   ========================================================================== */

/* -----------------------------------------------------------------------
   Root section
   - Breaks out of whatever container Woodmart/Elementor/the block editor
     puts it in, so it reads as a true full-bleed hero, without ever
     touching a theme file.
   - Height is a full viewport so it behaves like a hero replacement.
----------------------------------------------------------------------- */
.csg-root {
	--csg-bg: #F1F0EF;
	--csg-image-height: 70vh;
	--csg-duration: 700ms;
	--csg-ease: cubic-bezier(0.22, 0.61, 0.36, 1);

	position: relative;
	width: 100vw;
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
	height: 100vh;
	min-height: 480px;
	overflow: hidden;
	background: var(--csg-bg);
	outline: none;
	-webkit-tap-highlight-color: transparent;
	touch-action: pan-x; /* vertical gestures are handled by our own JS */
}

/* The stage simply centers whatever slide is visible. */
.csg-stage {
	position: absolute;
	inset: 0;
}

/* -----------------------------------------------------------------------
   Slides
   Every <img> sits stacked, centered, large (≈70% viewport height by
   default), with no border/shadow/card chrome. Only transform + opacity
   are animated, which keeps everything on the GPU and off the layout
   thread — no reflows during transitions.
----------------------------------------------------------------------- */
.csg-slide {
	position: absolute;
	top: 50%;
	left: 50%;
	height: var(--csg-image-height);
	width: auto;
	max-width: 86vw;
	object-fit: contain;
	user-select: none;
	-webkit-user-drag: none;

	opacity: 0;
	visibility: hidden;
	pointer-events: none;

	transform: translate3d(-50%, -50%, 0) translateX(0) scale(1);
	will-change: transform, opacity;
	transition: transform var(--csg-duration) var(--csg-ease),
		opacity var(--csg-duration) var(--csg-ease);

	/* A whisper of depth so the shoe feels lifted off the background —
	   subtle on purpose, this is the only "decoration" in the whole UI. */
	filter: drop-shadow(0 18px 28px rgba(0, 0, 0, 0.08));
}

/* First slide is visible by default. This is also the no-JS fallback —
   without JavaScript, the gallery still shows a single clean shoe. */
.csg-slide[data-index='0'] {
	opacity: 1;
	visibility: visible;
}

/* The currently active slide. */
.csg-slide.csg-current {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transform: translate3d(-50%, -50%, 0) translateX(0) scale(1);
}

/* Outgoing slide when moving forward (next shoe): drifts left, fades,
   shrinks slightly — exactly the "leaving" half of the brief. */
.csg-slide.csg-leaving-next {
	visibility: visible;
	opacity: 0;
	transform: translate3d(-50%, -50%, 0) translateX(-48px) scale(0.92);
}

/* Outgoing slide when moving backward (previous shoe): mirror image. */
.csg-slide.csg-leaving-prev {
	visibility: visible;
	opacity: 0;
	transform: translate3d(-50%, -50%, 0) translateX(48px) scale(0.92);
}

/*
 * "Start" positions for an incoming slide, applied for exactly one frame
 * with transitions disabled so the element can be teleported into place
 * before animating — this is what makes "comes from the right" /
 * "comes from the left" actually visible instead of being an instant cut.
 */
.csg-slide.csg-enter-from-right-start,
.csg-slide.csg-enter-from-left-start {
	visibility: visible;
	opacity: 0;
	transition: none;
}
.csg-slide.csg-enter-from-right-start {
	transform: translate3d(-50%, -50%, 0) translateX(64px) scale(0.92);
}
.csg-slide.csg-enter-from-left-start {
	transform: translate3d(-50%, -50%, 0) translateX(-64px) scale(0.92);
}

/* -----------------------------------------------------------------------
   Progress dots — small, on the right, no labels, no flash.
----------------------------------------------------------------------- */
.csg-dots {
	position: absolute;
	top: 50%;
	right: clamp(20px, 4vw, 56px);
	transform: translateY(-50%);
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 14px;
	z-index: 2;
}

.csg-dot {
	appearance: none;
	-webkit-appearance: none;
	border: 1px solid rgba(30, 30, 30, 0.28);
	background: transparent;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	padding: 0;
	cursor: pointer;
	transition: transform 0.35s var(--csg-ease), background-color 0.35s var(--csg-ease),
		border-color 0.35s var(--csg-ease);
}

.csg-dot:hover {
	border-color: rgba(30, 30, 30, 0.55);
}

.csg-dot:focus-visible {
	outline: 2px solid rgba(30, 30, 30, 0.55);
	outline-offset: 3px;
}

.csg-dot.is-active {
	background-color: rgba(30, 30, 30, 0.85);
	border-color: rgba(30, 30, 30, 0.85);
	transform: scale(1.35);
}

/* -----------------------------------------------------------------------
   Empty state / no-JS message — quiet, on-brand, never alarming.
----------------------------------------------------------------------- */
.csg-root--empty {
	display: flex;
	align-items: center;
	justify-content: center;
}

.csg-empty-msg {
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	font-size: 15px;
	letter-spacing: 0.02em;
	color: rgba(30, 30, 30, 0.55);
	text-align: center;
}

.csg-empty-msg__hint {
	display: block;
	margin-top: 8px;
	font-size: 13px;
	color: rgba(30, 30, 30, 0.4);
}

.csg-noscript-msg {
	position: absolute;
	bottom: 24px;
	left: 50%;
	transform: translateX(-50%);
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	font-size: 13px;
	color: rgba(30, 30, 30, 0.5);
}

/* -----------------------------------------------------------------------
   Tablet
----------------------------------------------------------------------- */
@media (max-width: 1024px) {
	.csg-slide {
		max-width: 80vw;
	}
}

/* -----------------------------------------------------------------------
   Mobile
   - Slightly smaller image so dots / safe-areas never crowd it.
   - Dots move to the bottom, horizontal, out of the way of a thumb swipe.
   - touch-action stays pan-x; our JS decides when a vertical swipe should
     move the page vs. move the gallery, exactly like the wheel logic.
----------------------------------------------------------------------- */
@media (max-width: 768px) {
	.csg-root {
		height: 100vh;
		min-height: 560px;
	}

	.csg-slide {
		height: 56vh;
		max-width: 88vw;
	}

	.csg-dots {
		top: auto;
		right: 50%;
		bottom: 28px;
		transform: translateX(50%);
		flex-direction: row;
		gap: 10px;
	}
}

/* -----------------------------------------------------------------------
   Reduced motion — the brief is explicit about respecting this. Movement
   collapses to a short, simple crossfade. No slides, no scaling.
----------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
	.csg-slide {
		transition: opacity 250ms linear;
		transform: translate3d(-50%, -50%, 0) !important;
		filter: none;
	}

	.csg-slide.csg-leaving-next,
	.csg-slide.csg-leaving-prev,
	.csg-slide.csg-enter-from-right-start,
	.csg-slide.csg-enter-from-left-start {
		transform: translate3d(-50%, -50%, 0) !important;
	}

	.csg-dot,
	.csg-dot.is-active {
		transition: none;
	}
}
