/**
 * QB - Hero Slider — v1.0.0
 * Calm fade hero. Loaded only on pages that contain the widget
 * (registered handle, enqueued via get_style_depends()).
 * Logical properties throughout → RTL works without extra CSS.
 */

/* ---- Tokens ---- */
.qbhs {
	--qbhs-accent: #EE5A24;
	--qbhs-ink: #0B1016;
	--qbhs-h: 88vh;
	--qbhs-min: 520px;
	--qbhs-max: none;
	--qbhs-cw: 860px;
	--qbhs-speed: 1200ms;
	--qbhs-delay: 7000ms;
	--qbhs-ease: cubic-bezier(.22, .61, .36, 1);
	--qbhs-vzoom: 1.15;
	--qbhs-pos: 50% 50%;
	--qbhs-jc: center;
	--qbhs-ta: center;
	--qbhs-ai: center;
	--qbhs-ms: auto;
	--qbhs-me: auto;
	--qbhs-la: block;
	--qbhs-pad-x: clamp(20px, 5vw, 80px);
	--qbhs-arrow: 50px;
	--qbhs-arrow-off: clamp(14px, 2.4vw, 40px);

	position: relative;
	inline-size: 100%;
	block-size: var(--qbhs-h);
	min-block-size: var(--qbhs-min);
	max-block-size: var(--qbhs-max);
	overflow: hidden;
	background-color: var(--qbhs-ink);
	color: #fff;
	isolation: isolate;
	touch-action: pan-y;
	contain: layout paint;
	-webkit-tap-highlight-color: transparent;
}

.qbhs:focus { outline: none; }

.qbhs--bleed {
	inline-size: 100vw;
	max-inline-size: 100vw;
	margin-inline: calc(50% - 50vw);
}

/* ---- Slides (stacked, cross-fade) ---- */
.qbhs__track {
	position: absolute;
	inset: 0;
}

.qbhs__slide {
	position: absolute;
	inset: 0;
	z-index: 0;
	opacity: 0;
	visibility: hidden;
	container-type: size;
	transition: opacity var(--qbhs-speed) var(--qbhs-ease), visibility 0s linear var(--qbhs-speed);
}

.qbhs__slide.is-active {
	z-index: 2;
	opacity: 1;
	visibility: visible;
	transition: opacity var(--qbhs-speed) var(--qbhs-ease), visibility 0s;
}

.qbhs__slide.is-leaving {
	z-index: 1;
	opacity: 1;
	visibility: visible;
	transition: none;
}

/* ---- Media ---- */
.qbhs__media {
	position: absolute;
	inset: 0;
	z-index: 0;
	overflow: hidden;
}

.qbhs__pic { display: contents; }

.qbhs .qbhs__poster {
	position: absolute;
	inset: 0;
	inline-size: 100%;
	block-size: 100%;
	max-inline-size: none;
	margin: 0;
	object-fit: cover;
	object-position: var(--qbhs-pos);
	border-radius: 0;
	transform-origin: 50% 50%;
	will-change: transform;
}

.qbhs__video,
.qbhs__mp4 {
	position: absolute;
	inset: 0;
	opacity: 0;
	transition: opacity 1.4s var(--qbhs-ease);
}

.qbhs__slide.is-playing .qbhs__video,
.qbhs__slide.is-playing .qbhs__mp4 { opacity: 1; }

.qbhs__mp4 {
	inline-size: 100%;
	block-size: 100%;
	object-fit: cover;
	object-position: var(--qbhs-pos);
}

/* 16:9 iframe that always covers the slide (fallback first, container units after) */
.qbhs__video iframe {
	position: absolute;
	top: 50%;
	left: 50%;
	inline-size: max(100%, 177.78vh);
	block-size: max(100%, 56.25vw);
	max-inline-size: none;
	border: 0;
	pointer-events: none;
	transform: translate(-50%, -50%) scale(var(--qbhs-vzoom));
}

@supports (width: 1cqw) {
	.qbhs__video iframe {
		inline-size: max(100cqw, 177.78cqh);
		block-size: max(100cqh, 56.25cqw);
	}
}

/* Slow zoom on still images (stops mattering once video is visible) */
.qbhs--kb .qbhs__slide.is-active .qbhs__poster,
.qbhs--kb .qbhs__slide.is-leaving .qbhs__poster {
	animation: qbhsKB calc(var(--qbhs-delay) + var(--qbhs-speed) * 2) linear both;
}

@keyframes qbhsKB {
	from { transform: scale(1.08); }
	to   { transform: scale(1); }
}

/* ---- Overlay ---- */
.qbhs__overlay {
	position: absolute;
	inset: 0;
	z-index: 1;
	pointer-events: none;
}

.qbhs--vignette .qbhs__slide::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	pointer-events: none;
	background: radial-gradient(ellipse 70% 60% at 50% 50%, rgba(0, 0, 0, .28), rgba(0, 0, 0, 0) 72%);
}

/* ---- Content ---- */
.qbhs__inner {
	position: relative;
	z-index: 3;
	box-sizing: border-box;
	block-size: 100%;
	display: flex;
	align-items: var(--qbhs-ai);
	justify-content: var(--qbhs-jc);
	padding-block: clamp(84px, 11vh, 130px) clamp(72px, 10vh, 120px);
	padding-inline: var(--qbhs-pad-x);
}

.qbhs__content {
	inline-size: 100%;
	max-inline-size: var(--qbhs-cw);
	text-align: var(--qbhs-ta);
}

.qbhs__eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 14px;
	margin: 0 0 20px;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.4;
	letter-spacing: .26em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, .86);
}

.qbhs--line .qbhs__eyebrow::before,
.qbhs--line .qbhs__eyebrow::after {
	content: "";
	flex: none;
	inline-size: 28px;
	block-size: 1px;
	background-color: var(--qbhs-accent);
}

.qbhs--line .qbhs__eyebrow::after { display: var(--qbhs-la); }

.qbhs .qbhs__title {
	margin: 0;
	padding: 0;
	font-family: inherit;
	font-size: clamp(2rem, 1.15rem + 3.9vw, 4.6rem);
	font-weight: 600;
	line-height: 1.06;
	letter-spacing: .015em;
	color: #fff;
	text-wrap: balance;
}

.qbhs .qbhs__title em {
	font-style: normal;
	color: var(--qbhs-accent);
}

.qbhs .qbhs__desc {
	max-inline-size: 620px;
	margin-block: 22px 0;
	margin-inline-start: var(--qbhs-ms);
	margin-inline-end: var(--qbhs-me);
	padding: 0;
	font-size: clamp(.95rem, .88rem + .32vw, 1.14rem);
	font-weight: 400;
	line-height: 1.75;
	color: rgba(255, 255, 255, .8);
	text-wrap: pretty;
}

.qbhs__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	justify-content: var(--qbhs-jc);
	margin-block-start: 34px;
}

.qbhs .qbhs__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	box-sizing: border-box;
	min-block-size: 50px;
	padding: 0 30px;
	border: 1px solid transparent;
	border-radius: 2px;
	font-family: inherit;
	font-size: 12.5px;
	font-weight: 600;
	line-height: 1;
	letter-spacing: .16em;
	text-transform: uppercase;
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
	transition: background-color .4s var(--qbhs-ease), color .4s var(--qbhs-ease), border-color .4s var(--qbhs-ease);
}

.qbhs .qbhs__btn--solid {
	background-color: var(--qbhs-accent);
	border-color: var(--qbhs-accent);
	color: #fff;
}

.qbhs .qbhs__btn--solid:hover,
.qbhs .qbhs__btn--solid:focus-visible {
	background-color: #fff;
	border-color: #fff;
	color: var(--qbhs-ink);
}

.qbhs .qbhs__btn--ghost {
	background-color: transparent;
	border-color: rgba(255, 255, 255, .5);
	color: #fff;
}

.qbhs .qbhs__btn--ghost:hover,
.qbhs .qbhs__btn--ghost:focus-visible {
	background-color: #fff;
	border-color: #fff;
	color: var(--qbhs-ink);
}

.qbhs .qbhs__btn:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 3px;
}

.qbhs__btn-ico {
	flex: none;
	transition: transform .4s var(--qbhs-ease);
}

.qbhs__btn:hover .qbhs__btn-ico { transform: translateX(4px); }

/* ---- Content animation (pure CSS → runs on first paint, no JS needed) ---- */
.qbhs__slide.is-active .qbhs__anim {
	animation-duration: 1.1s;
	animation-timing-function: var(--qbhs-ease);
	animation-fill-mode: both;
	animation-delay: calc(.3s + var(--i, 0) * .13s);
}

.qbhs[data-anim="up"]   .qbhs__slide.is-active .qbhs__anim { animation-name: qbhsUp; }
.qbhs[data-anim="fade"] .qbhs__slide.is-active .qbhs__anim { animation-name: qbhsFade; }
.qbhs[data-anim="blur"] .qbhs__slide.is-active .qbhs__anim { animation-name: qbhsBlur; }
.qbhs[data-anim="none"] .qbhs__slide.is-active .qbhs__anim { animation: none; }

@keyframes qbhsUp {
	from { opacity: 0; transform: translate3d(0, 22px, 0); }
	to   { opacity: 1; transform: none; }
}

@keyframes qbhsFade {
	from { opacity: 0; }
	to   { opacity: 1; }
}

@keyframes qbhsBlur {
	from { opacity: 0; filter: blur(10px); transform: scale(1.02); }
	to   { opacity: 1; filter: blur(0); transform: none; }
}

/* ---- Arrows ---- */
.qbhs__arrow {
	position: absolute;
	top: 50%;
	z-index: 6;
	display: grid;
	place-items: center;
	box-sizing: border-box;
	inline-size: var(--qbhs-arrow);
	block-size: var(--qbhs-arrow);
	margin: 0;
	padding: 0;
	border: 1px solid rgba(255, 255, 255, .28);
	border-radius: 50%;
	background-color: rgba(255, 255, 255, .06);
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
	color: #fff;
	cursor: pointer;
	transform: translateY(-50%);
	transition: background-color .35s var(--qbhs-ease), color .35s var(--qbhs-ease), border-color .35s var(--qbhs-ease), opacity .35s;
}

.qbhs__arrow--prev { inset-inline-start: var(--qbhs-arrow-off); }
.qbhs__arrow--next { inset-inline-end: var(--qbhs-arrow-off); }
.qbhs__arrow--next svg { transform: scaleX(-1); }

/* RTL (kept as separate rules so an unsupported :dir() never drops the [dir] fallback) */
[dir="rtl"] .qbhs__arrow--prev svg { transform: scaleX(-1); }
[dir="rtl"] .qbhs__arrow--next svg { transform: none; }
[dir="rtl"] .qbhs__btn-ico { scale: -1 1; }
.qbhs:dir(rtl) .qbhs__arrow--prev svg { transform: scaleX(-1); }
.qbhs:dir(rtl) .qbhs__arrow--next svg { transform: none; }
.qbhs:dir(rtl) .qbhs__btn-ico { scale: -1 1; }

.qbhs__arrow:hover {
	background-color: #fff;
	border-color: #fff;
	color: var(--qbhs-ink);
}

.qbhs__arrow:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 3px;
}

.qbhs__arrow[disabled] {
	opacity: .3;
	pointer-events: none;
}

/* ---- Progress dots ---- */
.qbhs__dots {
	position: absolute;
	z-index: 6;
	inset-inline: 0;
	inset-block-end: clamp(22px, 4.5vh, 40px);
	display: flex;
	justify-content: center;
	gap: 10px;
	pointer-events: none;
}

.qbhs__dot {
	position: relative;
	inline-size: 36px;
	block-size: 2px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 2px;
	background-color: rgba(255, 255, 255, .28);
	cursor: pointer;
	pointer-events: auto;
	overflow: visible;
}

.qbhs__dot::before {
	content: "";
	position: absolute;
	inset: -12px -4px;
}

.qbhs__dot-bar {
	position: absolute;
	inset: 0;
	border-radius: inherit;
	background-color: #fff;
	transform: scaleX(0);
	transform-origin: 0 50%;
}

[dir="rtl"] .qbhs__dot-bar { transform-origin: 100% 50%; }
.qbhs:dir(rtl) .qbhs__dot-bar { transform-origin: 100% 50%; }

.qbhs__dot.is-active .qbhs__dot-bar { transform: scaleX(1); }

.qbhs.is-auto .qbhs__dot.is-active .qbhs__dot-bar {
	animation: qbhsBar var(--qbhs-delay) linear both;
}

.qbhs.is-paused .qbhs__dot-bar { animation-play-state: paused; }

.qbhs__dot:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 6px;
}

@keyframes qbhsBar {
	from { transform: scaleX(0); }
	to   { transform: scaleX(1); }
}

/* ---- Tablet ---- */
@media (max-width: 1024px) {
	.qbhs { --qbhs-arrow: 44px; }
}

/* ---- Mobile: calmer, smaller, no clutter ---- */
@media (max-width: 767px) {
	.qbhs { --qbhs-pad-x: 22px; }

	.qbhs__inner { padding-block: 72px 76px; }

	.qbhs__eyebrow {
		gap: 10px;
		margin-block-end: 14px;
		font-size: 10.5px;
		letter-spacing: .22em;
	}

	.qbhs--line .qbhs__eyebrow::before,
	.qbhs--line .qbhs__eyebrow::after { inline-size: 20px; }

	.qbhs .qbhs__title { line-height: 1.1; letter-spacing: .01em; }

	.qbhs .qbhs__desc {
		margin-block-start: 14px;
		font-size: .94rem;
		line-height: 1.65;
	}

	.qbhs__actions {
		gap: 10px;
		margin-block-start: 24px;
	}

	.qbhs .qbhs__btn {
		min-block-size: 44px;
		padding: 0 22px;
		font-size: 11.5px;
		letter-spacing: .14em;
	}

	.qbhs--no-arrows-m .qbhs__arrow { display: none; }

	.qbhs__dot { inline-size: 26px; }

	.qbhs__dots { inset-block-end: 24px; }

	.qbhs--vignette .qbhs__slide::after {
		background: radial-gradient(ellipse 90% 60% at 50% 50%, rgba(0, 0, 0, .3), rgba(0, 0, 0, 0) 75%);
	}
}

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
	.qbhs__slide,
	.qbhs__slide.is-active { transition-duration: .01ms; }

	.qbhs .qbhs__poster,
	.qbhs__slide.is-active .qbhs__anim,
	.qbhs.is-auto .qbhs__dot.is-active .qbhs__dot-bar { animation: none !important; }

	.qbhs__btn-ico { transition: none; }
}
