/* ==================================================================
   26 - HOME HERO SLIDER
   Loaded on the front page only (inc/hero-slider.php). Scoped to
   .wo-hs, so it cannot affect any other section or page. The shared
   copy styles (.wo-hero__eyebrow / __title / __text / __actions)
   still live in 09-home.css.

   Layout
     phones + tablets (<992px)  text first, picture below it
     desktop (992px and up)     text left, picture right
   The picture is always shown in FULL (object-fit: contain) at its
   own shape, capped by a max height that suits the screen, so any
   upload size re-fits itself on every device.
   ================================================================== */

.wo-hs {
	--wo-hs-maxh: min(50vh, 380px);
	position: relative;
	isolation: isolate;
	overflow: hidden;
	background: var(--wo-bg-soft, #1B1338);
}

/* ---- Background: the slide picture, blurred and dimmed ---- */
.wo-hs__bgs {
	position: absolute;
	inset: 0;
	z-index: -2;
	overflow: hidden;
}

.wo-hs__bg {
	position: absolute;
	inset: -6%;
	background-size: cover;
	background-position: center;
	filter: blur(24px) saturate(1.2) brightness(0.55);
	opacity: 0;
	transition: opacity 0.9s var(--wo-ease);
}

.wo-hs__bg.is-active {
	opacity: 1;
}

/* Gradient so text stays readable and the section melts into the page */
.wo-hs__scrim {
	position: absolute;
	inset: 0;
	z-index: -1;
	pointer-events: none;
	background:
		linear-gradient(180deg, rgba(15, 10, 32, 0.25) 0%, rgba(15, 10, 32, 0.55) 60%, var(--wo-bg, #140E2A) 100%),
		radial-gradient(60% 60% at 80% 40%, rgba(124, 92, 255, 0.22), transparent 70%);
}

.wo-hs--no-media .wo-hs__scrim {
	background: var(--wo-grad-hero, linear-gradient(160deg, #2E2361, #140E2A));
}

/* ---- Layout ---- */
.wo-hs__inner {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	align-items: center;
	gap: clamp(1.5rem, 4vw, 2.5rem);
	/* The fixed navbar floats over the page, so first clear it
	   (its top inset + its height), then leave the SAME gap that sits
	   between two home sections (previous section's bottom padding +
	   next section's top padding). Same on desktop, tablet and phone. */
	padding-top: calc(var(--wo-space-4) + var(--wo-header-height) + var(--wo-section-y) + clamp(1.5rem, 4vw, 3rem));
	padding-bottom: clamp(2rem, 5vw, 4rem);
}

.wo-hs__media {
	position: relative;
	min-width: 0;
}

.wo-hs__copy {
	min-width: 0;
	max-width: 620px;
	margin-inline: auto;
	text-align: center;
}

.wo-hs__copy .wo-hero__text {
	margin-inline: auto;
}

.wo-hs__copy .wo-hero__actions {
	justify-content: center;
}

/* ---- Slides ----
   The frame takes the shape of the FIRST picture (--ar = width/height,
   set by the template) and never grows taller than --wo-hs-maxh, so the
   hero keeps a steady size while sliding. Every picture is shown in
   full inside it (object-fit: contain). */
.wo-hs__viewport {
	position: relative;
	width: min(100%, calc(var(--wo-hs-maxh) * var(--ar, 1.5)));
	aspect-ratio: var(--ar, 1.5);
	margin-inline: auto;
	overflow: hidden;
	border-radius: var(--wo-radius-lg);
	box-shadow: var(--wo-shadow-lg);
}

.wo-hs__slide {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 0;
	opacity: 0;
	visibility: hidden;
	transform: translateX(10%);
	transition:
		opacity 0.7s var(--wo-ease),
		transform 0.8s var(--wo-ease-out),
		visibility 0s linear 0.8s;
}

.wo-hs__slide.is-prev {
	transform: translateX(-10%);
}

.wo-hs__slide.is-active {
	opacity: 1;
	visibility: visible;
	transform: none;
	transition-delay: 0s;
}

.wo-hs .wo-hs__img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: 100%;
	max-height: none;
	object-fit: contain;
}

/* ---- Arrows ---- */
.wo-hs .wo-hs__arrow {
	min-width: 0;
	min-height: 0;
	position: absolute;
	top: 50%;
	z-index: 2;
	display: grid;
	place-items: center;
	width: 38px;
	height: 38px;
	margin-top: -19px;
	padding: 0;
	border-radius: 50%;
	border: 1px solid rgba(255, 255, 255, 0.22);
	background: rgba(20, 14, 42, 0.6);
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
	color: var(--wo-text);
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
	transition: background 0.25s var(--wo-ease), border-color 0.25s var(--wo-ease);
}

.wo-hs__arrow--prev { left: 0.4rem; }
.wo-hs__arrow--next { right: 0.4rem; }

.wo-hs__arrow:hover,
.wo-hs__arrow:focus-visible {
	background: var(--wo-primary);
	border-color: var(--wo-primary-hover, var(--wo-primary));
}

.wo-hs__arrow:focus-visible,
.wo-hs__dot:focus-visible {
	outline: 2px solid var(--wo-gold);
	outline-offset: 2px;
}

.wo-hs__arrow svg {
	width: 18px;
	height: 18px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2.4;
	stroke-linecap: round;
	stroke-linejoin: round;
}

/* ---- Dots ---- */
.wo-hs__dots {
	display: flex;
	justify-content: center;
	gap: 0.5rem;
	margin-top: 0.85rem;
}

.wo-hs .wo-hs__dot {
	position: relative;
	flex: none;
	width: 9px;
	height: 9px;
	min-width: 0;
	min-height: 0;
	padding: 0;
	border: 0;
	border-radius: var(--wo-radius-pill);
	background: rgba(255, 255, 255, 0.35);
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
	transition: width 0.35s var(--wo-ease-out), background 0.25s var(--wo-ease);
}

/* Bigger invisible tap area, without making the dot itself bigger */
.wo-hs .wo-hs__dot::after {
	content: '';
	position: absolute;
	inset: -12px -6px;
}

.wo-hs .wo-hs__dot.is-active {
	width: 26px;
	background: var(--wo-gold);
}

/* ---- Owner-only note (no pictures yet) ---- */
.wo-hs__notice {
	margin: 0;
	padding: 0.8rem 1rem;
	border-radius: var(--wo-radius-sm);
	border: 1px dashed var(--wo-gold);
	background: var(--wo-gold-soft, rgba(245, 197, 66, 0.12));
	color: var(--wo-text-muted);
	font-size: 0.85rem;
	text-align: center;
}

/* No pictures: single centred column */
.wo-hs--no-media .wo-hs__inner {
	padding-bottom: clamp(3rem, 8vw, 6rem);
}


/* ==================================================================
   BIGGER SCREENS
   ================================================================== */

/* Tablets: a little more room for the picture */
@media (min-width: 600px) {
	.wo-hs { --wo-hs-maxh: min(54vh, 460px); }
}

/* Text left, picture right */
@media (min-width: 992px) {

	.wo-hs { --wo-hs-maxh: min(68vh, 560px); }

	.wo-hs__inner {
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
		gap: clamp(2rem, 4vw, 4rem);
		min-height: min(80vh, 640px);
	}


	.wo-hs__copy {
		margin-inline: 0;
		text-align: left;
	}

	.wo-hs__copy .wo-hero__text { margin-inline: 0; }
	.wo-hs__copy .wo-hero__actions { justify-content: flex-start; }

	.wo-hs--no-media .wo-hs__inner {
		grid-template-columns: minmax(0, 1fr);
	}

	.wo-hs--no-media .wo-hs__copy {
		margin-inline: auto;
		text-align: center;
	}

	.wo-hs--no-media .wo-hs__copy .wo-hero__text { margin-inline: auto; }
	.wo-hs--no-media .wo-hs__copy .wo-hero__actions { justify-content: center; }

	.wo-hs__arrow {
		width: 44px;
		height: 44px;
		margin-top: -22px;
	}

	.wo-hs__arrow--prev { left: 0.75rem; }
	.wo-hs__arrow--next { right: 0.75rem; }
}

@media (min-width: 1200px) {
	.wo-hs { --wo-hs-maxh: min(72vh, 620px); }
}

/* Short landscape phones: keep the picture from filling the whole screen */
@media (max-height: 480px) and (orientation: landscape) {
	.wo-hs { --wo-hs-maxh: 70vh; }
}

@media (prefers-reduced-motion: reduce) {
	.wo-hs__bg,
	.wo-hs__slide,
	.wo-hs__dot {
		transition: none !important;
	}
}
