/**
 * Hero Slider - Front-end Styles
 *
 * Layout variants (class on .hero-slider__slide):
 *   .hero-slider__slide--content-left    Text group in left column.
 *   .hero-slider__slide--content-right   Text group in right column.
 *   .hero-slider__slide--content-center  Text group centered, single column.
 *
 * CSS custom properties on the slide element:
 *   --slide-overlay   rgba() overlay colour
 *   --hs-text-color   unified text colour inherited by all text children
 *   --hs-cta-bg       CTA button accent / fill colour
 *   --hs-cta-color    CTA button text colour (filled style)
 *   --hs-mobile-bg    mobile solid background colour
 *
 * CSS custom properties on the block wrapper:
 *   --hs-slide-height    optional fixed desktop height (set by render.php)
 *   --hero-slider-height responsive height (set by view.js)
 *
 * Breakpoints (max-width — mobile-last cascade):
 *   Mobile      : ≤ 767px
 *   Tablet      : ≤ 1023px
 *   Wide-tablet : ≤ 1280px  (use only when needed for complex layouts)
 *
 * @package WayfinderBlocks
 */

/* ----------------------------------------------------------------
   Block wrapper — fluid height
   ---------------------------------------------------------------- */
.wp-block-wayfinder-hero-slider {
	position: relative;
	width: 100%;
	height: var(--hs-slide-height, var(--hero-slider-height, 70vh));
	overflow: hidden;
	background-color: var(--color-navy, #2B3157);
	outline: none;
}

/* ----------------------------------------------------------------
   Visually hidden live region (screen reader announcements)
   ---------------------------------------------------------------- */
.hero-slider__live {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* ----------------------------------------------------------------
   Track wrapper + track
   ---------------------------------------------------------------- */
.hero-slider__track-wrapper {
	position: absolute;
	inset: 0;
	overflow: hidden;
}

.hero-slider__track {
	display: flex;
	height: 100%;
	transition: transform 400ms ease;
	will-change: transform;
}

/* ----------------------------------------------------------------
   Individual slide
   ---------------------------------------------------------------- */
.hero-slider__slide {
	position: relative;
	flex: 0 0 100%;
	width: 100%;
	height: 100%;
	overflow: hidden;
}

/* ----------------------------------------------------------------
   Background image
   ---------------------------------------------------------------- */
.hero-slider__bg {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
	display: block;
}

/* Mobile background image — hidden by default, shown at ≤ 767px */
.hero-slider__bg--mobile {
	display: none;
}

.hero-slider__bg-placeholder {
	position: absolute;
	inset: 0;
	background-color: #1a1f3a;
}

/* ----------------------------------------------------------------
   Overlay
   ---------------------------------------------------------------- */
.hero-slider__overlay {
	position: absolute;
	inset: 0;
	z-index: 1;
	pointer-events: none;
	background-color: var(--slide-overlay, rgba(0, 0, 0, 0.4));
}

/* ----------------------------------------------------------------
   Inner container — absolute fill, CSS grid, z-index above overlay
   ---------------------------------------------------------------- */
.hero-slider__inner {
	position: absolute;
	inset: 0;
	z-index: 2;
	display: grid;
	align-items: center;
	padding: clamp(2rem, 5vw, 5rem) clamp(1.5rem, 5vw, 4rem);
	/* default (content-left) */
	grid-template-columns: minmax(0, 36rem) 1fr;
}

/* ----------------------------------------------------------------
   Variant: content-left (default, already set on .hero-slider__inner)
   ---------------------------------------------------------------- */
.hero-slider__slide--content-left .hero-slider__inner {
	grid-template-columns: minmax(0, 36rem) 1fr;
}

/* ----------------------------------------------------------------
   Variant: content-right — text in right column
   ---------------------------------------------------------------- */
.hero-slider__slide--content-right .hero-slider__inner {
	grid-template-columns: 1fr minmax(0, 36rem);
}

.hero-slider__slide--content-right .hero-slider__content {
	grid-column: 2;
}

/* ----------------------------------------------------------------
   Variant: content-center — single centered column
   ---------------------------------------------------------------- */
.hero-slider__slide--content-center .hero-slider__inner {
	grid-template-columns: minmax(0, 56rem);
	justify-content: center;
}

.hero-slider__slide--content-center .hero-slider__content {
	text-align: center;
	align-items: center;
}

/* ----------------------------------------------------------------
   Content — flex column, inherits text colour from slide vars
   ---------------------------------------------------------------- */
.hero-slider__content {
	display: flex;
	flex-direction: column;
	gap: clamp(0.5rem, 1.5vw, 1rem);
	color: var(--hs-text-color, #ffffff);
}

/* ----------------------------------------------------------------
   Typography — fluid via clamp()
   ---------------------------------------------------------------- */
.hero-slider__eyebrow {
	margin: 0;
	font-family: var(--font-body, 'Roboto', sans-serif);
	font-size: clamp(12px, 1.1vw, 15px);
	font-weight: 400;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	line-height: 1.4;
}

.hero-slider__headline {
	margin: 0;
	font-family: var(--font-heading, 'Bebas Neue', sans-serif);
	font-size: clamp(36px, 6vw, 80px);
	font-weight: 400;
	line-height: 1;
	letter-spacing: 0.01em;
}

.hero-slider__subhead {
	margin: 0;
	font-family: var(--font-body, 'Roboto', sans-serif);
	font-size: clamp(15px, 1.6vw, 22px);
	font-weight: 400;
	line-height: 1.5;
}

/* ----------------------------------------------------------------
   Content vertical alignment — per-slide class
   ---------------------------------------------------------------- */
.hero-slider__content--vc-top    { align-self: start; }
.hero-slider__content--vc-center { align-self: center; }
.hero-slider__content--vc-bottom { align-self: end; }

/* ----------------------------------------------------------------
   CTA wrap + button — three styles via data-style attribute
   ---------------------------------------------------------------- */
.hero-slider__cta-wrap {
	margin-top: clamp(0.25rem, 1vw, 0.75rem);
}

.hero-slider__cta {
	display: inline-flex;
	align-items: center;
	padding: 12px 28px;
	font-family: var(--font-body, 'Roboto', sans-serif);
	font-size: 15px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	line-height: 1;
	border-radius: 4px;
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
	transition: opacity 150ms ease, box-shadow 150ms ease;
	background-color: var(--hs-cta-bg, #FF7A3D);
	color:            var(--hs-cta-color, #ffffff);
	border:           1px solid transparent;
}

.hero-slider__cta[data-style="outline"] {
	background-color: transparent;
	color:  var(--hs-cta-bg, #FF7A3D);
	border: 2px solid var(--hs-cta-bg, #FF7A3D);
}

.hero-slider__cta[data-style="ghost"] {
	background-color: transparent;
	color:  #ffffff;
	border: 2px solid #ffffff;
}

.hero-slider__cta[data-style="text-only"] {
	background-color: transparent;
	border:        none;
	color:         var(--hs-cta-bg, #FF7A3D);
	padding:       10px 0;
	border-radius: 0;
}

.hero-slider__cta:hover {
	opacity: 0.88;
	text-decoration: none;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.hero-slider__cta[data-style="text-only"]:hover {
	box-shadow: none;
}

.hero-slider__cta:focus-visible {
	outline: 3px solid #ffffff;
	outline-offset: 3px;
}

.hero-slider__cta--no-url {
	cursor: default;
}

/* ----------------------------------------------------------------
   Prev / Next arrows
   ---------------------------------------------------------------- */
.hero-slider__arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 10;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	min-width: 44px;
	min-height: 44px;
	background-color: var(--color-navy, #2B3157);
	color: #ffffff;
	border: none;
	border-radius: 50%;
	cursor: pointer;
	transition: background-color 150ms ease, box-shadow 150ms ease;
}

.hero-slider__arrow--prev {
	left: clamp(12px, 2vw, 24px);
}

.hero-slider__arrow--next {
	right: clamp(12px, 2vw, 24px);
}

.hero-slider__arrow:hover {
	background-color: #1e2340;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.hero-slider__arrow:focus-visible {
	outline: 3px solid #ffffff;
	outline-offset: 2px;
}

/* ----------------------------------------------------------------
   Dot pagination
   ---------------------------------------------------------------- */
.hero-slider__dots {
	position: absolute;
	bottom: 20px;
	left: 50%;
	transform: translateX(-50%);
	z-index: 10;
	display: flex;
	gap: 8px;
	align-items: center;
}

.hero-slider__dot {
	width: 10px;
	height: 10px;
	min-width: 10px;
	min-height: 10px;
	border-radius: 50%;
	border: 2px solid #ffffff;
	background-color: transparent;
	cursor: pointer;
	padding: 0;
	transition: background-color 200ms ease, transform 200ms ease;
}

.hero-slider__dot--active,
.hero-slider__dot[aria-selected="true"] {
	background-color: #ffffff;
	transform: scale(1.3);
}

.hero-slider__dot:focus-visible {
	outline: 2px solid var(--color-orange, #FF7A3D);
	outline-offset: 3px;
}

/* ----------------------------------------------------------------
   Responsive — Tablet (≤ 1023px): collapse all variants to single
   centered column
   ---------------------------------------------------------------- */
@media (max-width: 1023px) {
	.wp-block-wayfinder-hero-slider {
		height: clamp(280px, 55vh, 520px);
	}

	/* Override all variant grid layouts with a single centered column. */
	.hero-slider__slide .hero-slider__inner {
		grid-template-columns: minmax(0, 36rem);
		justify-content: center;
	}

	/* Reset any grid-column placement from variants; force vertical center. */
	.hero-slider__slide .hero-slider__content {
		grid-column: 1;
		text-align: center;
		align-items: center;
	}

	/* Override per-slide vertical align on tablet and below. */
	.hero-slider__content {
		align-self: center !important;
	}
}

/* ----------------------------------------------------------------
   Responsive — Mobile (≤ 767px)
   ---------------------------------------------------------------- */
@media (max-width: 767px) {
	.wp-block-wayfinder-hero-slider {
		height: var(--hero-slider-height, 50vh);
	}

	/* Hide desktop bg image; mobile bg image (if set) shows instead. */
	.hero-slider__bg:not(.hero-slider__bg--mobile) {
		display: none;
	}

	.hero-slider__bg--mobile {
		display: block;
	}

	/* Mobile background colour applies when no mobile image is set. */
	.hero-slider__slide {
		background-color: var(--hs-mobile-bg, #2B3157);
	}

	.hero-slider__inner {
		padding: 2rem 1.25rem;
	}

	.hero-slider__headline {
		font-size: clamp(28px, 8vw, 48px);
	}

	.hero-slider__subhead {
		font-size: clamp(13px, 3.5vw, 17px);
	}

	.hero-slider__arrow {
		width: 40px;
		height: 40px;
	}

	.hero-slider__cta {
		padding: 10px 20px;
		font-size: 13px;
	}

	.hero-slider__dots {
		bottom: 8px;
	}
}

/* ----------------------------------------------------------------
   Reduced motion
   ---------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
	.hero-slider__track {
		transition: none;
	}
}
