/**
 * wearseraiah/hero-slideshow
 * Full-bleed multi-slide hero under transparent header.
 * Fade-loop crossfade + rise-up copy (luxury jewellery motion).
 */

.wp-block-wearseraiah-hero-slideshow.wsr-hero-slideshow,
.wsr-hero-slideshow.wp-block-wearseraiah-hero-slideshow {
	position: relative;
	display: block;
	width: 100%;
	/* Fill the first viewport: JS sets --wsr-chrome-h to the chrome height
	   above the hero; never shrink below the authored height. */
	min-height: max(
		var(--wsr-hero-min-height, 80vh),
		calc(100svh - var(--wsr-chrome-h, 0px))
	);
	overflow: hidden;
	isolation: isolate;
	background: var(--wp--preset--color--ink, #3A3228);
	color: var(--wp--preset--color--base, #F7F3EB);
	box-sizing: border-box;
	/* Vertical page scroll OK; JS locks horizontal drag. */
	touch-action: pan-y;
	-webkit-user-select: none;
	user-select: none;
	-webkit-touch-callout: none;
	--wsr-slide-ease: cubic-bezier(0.26, 0.54, 0.32, 1);
	--wsr-slide-fade: 0.9s;
	--wsr-copy-ease: cubic-bezier(0.26, 0.54, 0.32, 1);

}

.wsr-hero-slideshow.has-drag {
	cursor: grab;
}

.wsr-hero-slideshow.has-drag.is-dragging {
	cursor: grabbing;
	/* Hard-stop selection / ghost-image while dragging. */
	-webkit-user-select: none;
	user-select: none;
}

/* Keep CTAs / controls feeling clickable over grab cursor. */
.wsr-hero-slideshow.has-drag a,
.wsr-hero-slideshow.has-drag button,
.wsr-hero-slideshow.has-drag input,
.wsr-hero-slideshow.has-drag textarea,
.wsr-hero-slideshow.has-drag select,
.wsr-hero-slideshow.has-drag label {
	cursor: pointer;
	-webkit-user-select: auto;
	user-select: auto;
}

/* Images must never start a native HTML drag (steals pointer). */
.wsr-hero-slideshow img,
.wsr-hero-slideshow__image {
	-webkit-user-drag: none;
	user-drag: none;
	-webkit-user-select: none;
	user-select: none;
	pointer-events: none;
}

@media (max-width: 781px) {
	.wsr-hero-slideshow.wp-block-wearseraiah-hero-slideshow {
		min-height: max(
			min(var(--wsr-hero-min-height, 80vh), 78vh),
			calc(100svh - var(--wsr-chrome-h, 0px))
		);
	}
}

@media (min-width: 782px) and (max-height: 700px) {
	.wsr-hero-slideshow.wp-block-wearseraiah-hero-slideshow {
		min-height: max(
			min(var(--wsr-hero-min-height, 80vh), 88vh),
			calc(100svh - var(--wsr-chrome-h, 0px))
		);
	}
}

/* -------------------------------------------------------------------------- */
/* Track — stacked fade stage (not a horizontal strip)                         */
/* -------------------------------------------------------------------------- */

.wsr-hero-slideshow__track {
	position: absolute;
	inset: 0;
	z-index: 0;
	display: block;
	height: 100%;
	width: 100%;
	touch-action: pan-y;
	cursor: inherit;
}


.wsr-hero-slideshow__slide {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	overflow: hidden;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	z-index: 0;
	/* Default resting state for inactive slides. */
	transition:
		opacity var(--wsr-slide-fade) var(--wsr-slide-ease),
		visibility 0s linear var(--wsr-slide-fade);
	touch-action: pan-y;
	will-change: opacity, transform;
}

/* Active slide sits on top and receives pointer. */
.wsr-hero-slideshow__slide.is-active {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	z-index: 2;
	transition:
		opacity var(--wsr-slide-fade) var(--wsr-slide-ease),
		visibility 0s linear 0s;
}

/* Outgoing slide stays visible briefly while fading. */
.wsr-hero-slideshow__slide.is-exit {
	opacity: 0;
	visibility: visible;
	pointer-events: none;
	z-index: 1;
	transition:
		opacity 0.7s var(--wsr-slide-ease),
		visibility 0s linear 0.7s;
}

/* Soft image settle on enter — opacity only, no slide drift. */
.wsr-hero-slideshow__slide.is-enter .wsr-hero-slideshow__image {
	animation: wsr-hero-image-in 1.05s var(--wsr-slide-ease) both;
}

.wsr-hero-slideshow__image {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
	display: block;
	will-change: opacity;
}

.wsr-hero-slideshow__image.is-placeholder {
	background:
		linear-gradient(135deg, var(--wp--preset--color--gold, #C9BDA4) 0%, var(--wp--preset--color--bronze, #A08F6E) 45%, var(--wp--preset--color--ink, #3A3228) 100%);
}

.wsr-hero-slideshow__dim {
	position: absolute;
	inset: 0;
	z-index: 1;
	pointer-events: none;
	background: rgba(var(--wsr-ink-rgb), var(--wsr-hero-dim, 0.25));
}

/* -------------------------------------------------------------------------- */
/* Content stage                                                               */
/* -------------------------------------------------------------------------- */

.wsr-hero-slideshow__inner {
	position: absolute;
	inset: 0;
	z-index: 2;
	display: flex;
	align-items: flex-end;
	justify-content: flex-start;
	padding-block: clamp(1.75rem, 5vh, 3.5rem);
	padding-inline: var(--wsr-rail-pad, 1.5rem);
	box-sizing: border-box;
	pointer-events: none;
}

.wsr-hero-slideshow.has-content-left .wsr-hero-slideshow__inner {
	justify-content: flex-start;
}

.wsr-hero-slideshow.has-content-center .wsr-hero-slideshow__inner {
	justify-content: center;
}

.wsr-hero-slideshow.has-content-right .wsr-hero-slideshow__inner {
	justify-content: flex-end;
}

.wsr-hero-slideshow.has-content-y-top .wsr-hero-slideshow__inner {
	align-items: flex-start;
}

.wsr-hero-slideshow.has-content-y-center .wsr-hero-slideshow__inner {
	align-items: center;
}

.wsr-hero-slideshow.has-content-y-bottom .wsr-hero-slideshow__inner {
	align-items: flex-end;
}

.wsr-hero-slideshow__content {
	pointer-events: auto;
	width: min(100%, var(--wsr-hero-content-width, 30rem));
	max-width: 100%;
	display: flex;
	flex-direction: column;
	gap: 0.45rem;
	text-shadow: 0 1px 18px rgba(var(--wsr-ink-rgb), 0.35);
}

.wsr-hero-slideshow.has-content-left .wsr-hero-slideshow__content {
	text-align: left;
	align-items: flex-start;
}

.wsr-hero-slideshow.has-content-center .wsr-hero-slideshow__content {
	text-align: center;
	align-items: center;
}

.wsr-hero-slideshow.has-content-right .wsr-hero-slideshow__content {
	text-align: right;
	align-items: flex-end;
}

/* Cropped rise-up wrappers — mirror reference animation-cropper. */
.wsr-hero-slideshow__reveal {
	display: block;
	overflow: hidden;
	/* Avoid clipping descenders on italic headings. */
	padding-bottom: 0.12em;
	margin-bottom: -0.12em;
}

.wsr-hero-slideshow__reveal-inner {
	display: block;
	will-change: transform, opacity;
}

/* Resting (inactive / pre-animate) copy is hidden. */
.wsr-hero-slideshow__slide:not(.is-active) .wsr-hero-slideshow__reveal-inner,
.wsr-hero-slideshow__slide:not(.has-animated) .wsr-hero-slideshow__reveal-inner {
	opacity: 0;
	transform: translate3d(0, 110%, 0);
}

.wsr-hero-slideshow__slide:not(.is-active) .wsr-hero-slideshow__button,
.wsr-hero-slideshow__slide:not(.has-animated) .wsr-hero-slideshow__button {
	opacity: 0;
}

/* Exit: copy rises out upward. */
.wsr-hero-slideshow__slide.is-exit .wsr-hero-slideshow__reveal-inner {
	animation: wsr-hero-rise-out 0.45s var(--wsr-copy-ease) both;
}

.wsr-hero-slideshow__slide.is-exit .wsr-hero-slideshow__button {
	animation: wsr-hero-fade-out 0.35s ease both;
}

/* Enter: staggered rise-up — title → text → CTA. */
.wsr-hero-slideshow__slide.is-active.has-animated
	.wsr-eyebrow
	.wsr-hero-slideshow__reveal-inner {
	animation: wsr-hero-rise-up 0.85s var(--wsr-copy-ease) 0.18s both;
}

.wsr-hero-slideshow__slide.is-active.has-animated
	.wsr-hero-slideshow__heading
	.wsr-hero-slideshow__reveal-inner {
	animation: wsr-hero-rise-up 0.9s var(--wsr-copy-ease) 0.28s both;
}

.wsr-hero-slideshow__slide.is-active.has-animated
	.wsr-hero-slideshow__text
	.wsr-hero-slideshow__reveal-inner {
	animation: wsr-hero-rise-up 1s var(--wsr-copy-ease) 0.55s both;
}

.wsr-hero-slideshow__slide.is-active.has-animated .wsr-hero-slideshow__button {
	animation: wsr-hero-fade-in 1.4s ease 0.95s both;
}

/* Direct children without reveal wrappers still fade (editor/legacy markup). */
.wsr-hero-slideshow__slide.is-active.has-animated
	> .wsr-hero-slideshow__inner
	.wsr-hero-slideshow__content
	> .wsr-eyebrow:not(:has(.wsr-hero-slideshow__reveal-inner)),
.wsr-hero-slideshow__slide.is-active.has-animated
	> .wsr-hero-slideshow__inner
	.wsr-hero-slideshow__content
	> .wsr-hero-slideshow__heading:not(:has(.wsr-hero-slideshow__reveal-inner)),
.wsr-hero-slideshow__slide.is-active.has-animated
	> .wsr-hero-slideshow__inner
	.wsr-hero-slideshow__content
	> .wsr-hero-slideshow__text:not(:has(.wsr-hero-slideshow__reveal-inner)) {
	animation: wsr-hero-fade-rise 0.9s var(--wsr-copy-ease) 0.3s both;
}

.wsr-hero-slideshow__content .wsr-eyebrow,
.wsr-hero-slideshow__content p.wsr-eyebrow {
	margin: 0;
	font-size: 0.6875rem;
	font-weight: 500;
	letter-spacing: 0.28em;
	text-transform: uppercase;
	color: var(--wp--preset--color--surface, #EFE8DB);
	line-height: 1.35;
}

.wsr-hero-slideshow__heading,
.wsr-hero-slideshow__content h1,
.wsr-hero-slideshow__content h2 {
	margin: 0;
	font-family: var(--wp--preset--font-family--heading, Georgia, serif);
	font-size: clamp(2.15rem, 1.4rem + 2.6vw, 3.35rem);
	/* Italic face ships as 500 — keep that so strokes read fuller. */
	font-weight: 500;
	font-style: italic;
	line-height: 1.08;
	letter-spacing: 0.005em;
	color: var(--wp--preset--color--base, #F7F3EB);
	max-width: 14ch;
}

.wsr-hero-slideshow.has-content-center .wsr-hero-slideshow__heading {
	max-width: 18ch;
}

.wsr-hero-slideshow__text,
.wsr-hero-slideshow__content p:not(.wsr-eyebrow) {
	margin: 0.35rem 0 0;
	font-family: var(--wp--preset--font-family--body, system-ui, sans-serif);
	font-size: clamp(0.6875rem, 0.64rem + 0.18vw, 0.75rem);
	font-weight: 500;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	line-height: 1.45;
	color: var(--wp--preset--color--surface, #EFE8DB);
	/* Letter-spacing eats ch budget — use content rail, not tight ch cap. */
	max-width: min(100%, 32rem);
	white-space: normal;
}

.wsr-hero-slideshow__actions {
	margin-top: 0.65rem;
}

.wsr-hero-slideshow__button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 0;
	padding: 0.62rem 1.25rem;
	border: 1px solid color-mix(in srgb, var(--wp--preset--color--base, #F7F3EB) 95%, transparent);
	border-radius: 0;
	color: var(--wp--preset--color--base, #F7F3EB);
	background: transparent;
	font-size: 0.6875rem;
	font-weight: 500;
	letter-spacing: 0.16em;
	line-height: 1.2;
	text-transform: uppercase;
	text-decoration: none;
	transition:
		background-color 0.25s ease,
		color 0.25s ease,
		border-color 0.25s ease;
}

.wsr-hero-slideshow__button:hover,
.wsr-hero-slideshow__button:focus-visible {
	background: var(--wp--preset--color--bronze, #A08F6E);
	border-color: var(--wp--preset--color--bronze, #A08F6E);
	color: var(--wp--preset--color--base, #F7F3EB);
	outline: none;
}


/* -------------------------------------------------------------------------- */
/* Dots                                                                        */
/* -------------------------------------------------------------------------- */

.wsr-hero-slideshow__dots {
	position: absolute;
	left: 50%;
	bottom: 1rem;
	z-index: 4;
	display: flex;
	gap: 0.45rem;
	transform: translateX(-50%);
}

.wsr-hero-slideshow__dot {
	width: 0.45rem;
	height: 0.45rem;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: color-mix(in srgb, var(--wp--preset--color--base, #F7F3EB) 45%, transparent);
	cursor: pointer;
	transition:
		background-color 0.25s ease,
		transform 0.25s var(--wsr-slide-ease),
		width 0.25s ease,
		height 0.25s ease;
}

.wsr-hero-slideshow__dot.is-active,
.wsr-hero-slideshow__dot:hover,
.wsr-hero-slideshow__dot:focus-visible {
	background: var(--wp--preset--color--base, #F7F3EB);
	outline: none;
}

.wsr-hero-slideshow__dot.is-active {
	transform: scale(1.35);
}

/* -------------------------------------------------------------------------- */
/* Under transparent header                                                    */
/* -------------------------------------------------------------------------- */

.wsr-hero-slideshow.wsr-hero-under-header {
	margin-top: 0 !important;
}

header.wsr-header--overlay:not(.is-scrolled)
	+ main
	> .wsr-hero-slideshow.wsr-hero-under-header.has-content-y-top
	.wsr-hero-slideshow__inner,
header.wp-block-template-part.wsr-header--overlay:not(.is-scrolled)
	+ main
	> .wsr-hero-slideshow.wsr-hero-under-header.has-content-y-top
	.wsr-hero-slideshow__inner {
	padding-top: clamp(5.5rem, 12vh, 7.5rem);
}

/* -------------------------------------------------------------------------- */
/* Keyframes                                                                   */
/* -------------------------------------------------------------------------- */

@keyframes wsr-hero-rise-up {
	0% {
		opacity: 1;
		transform: translate3d(0, 110%, 0);
	}
	100% {
		opacity: 1;
		transform: translate3d(0, 0, 0);
	}
}

@keyframes wsr-hero-rise-out {
	0% {
		opacity: 1;
		transform: translate3d(0, 0, 0);
	}
	100% {
		opacity: 1;
		transform: translate3d(0, -110%, 0);
	}
}

@keyframes wsr-hero-fade-in {
	0% {
		opacity: 0;
	}
	100% {
		opacity: 1;
	}
}

@keyframes wsr-hero-fade-out {
	0% {
		opacity: 1;
	}
	100% {
		opacity: 0;
	}
}

@keyframes wsr-hero-fade-rise {
	0% {
		opacity: 0;
		transform: translate3d(0, 18px, 0);
	}
	100% {
		opacity: 1;
		transform: translate3d(0, 0, 0);
	}
}

@keyframes wsr-hero-image-in {
	0% {
		opacity: 0.85;
	}
	100% {
		opacity: 1;
	}
}

/* -------------------------------------------------------------------------- */
/* Reduced motion                                                              */
/* -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
	.wsr-hero-slideshow__slide,
	.wsr-hero-slideshow__slide.is-active,
	.wsr-hero-slideshow__slide.is-exit,
	.wsr-hero-slideshow__track,
	.wsr-hero-slideshow__image,
	.wsr-hero-slideshow__button,
	.wsr-hero-slideshow__dot {
		transition: none !important;
		animation: none !important;
	}

	.wsr-hero-slideshow__slide.is-active .wsr-hero-slideshow__reveal-inner,
	.wsr-hero-slideshow__slide.is-active .wsr-hero-slideshow__button {
		opacity: 1 !important;
		transform: none !important;
		animation: none !important;
	}

	.wsr-hero-slideshow.is-ready:not(.is-paused)
		.wsr-hero-slideshow__slide.is-active
		.wsr-hero-slideshow__image {
		animation: none !important;
		transform: none;
	}
}

/* -------------------------------------------------------------------------- */
/* Mobile                                                                      */
/* -------------------------------------------------------------------------- */

@media (max-width: 600px) {
	.wsr-hero-slideshow__content {
		width: min(100%, 20rem);
	}

	.wsr-hero-slideshow__heading {
		font-size: clamp(1.5rem, 7vw, 2rem);
	}

	.wsr-hero-slideshow__button {
		font-size: 0.6875rem;
		padding-inline: 1.1rem;
	}
}
