/* ==========================================================================
   Homepage hero slider  (renders the `home_slider` table on home.tpl)
   --------------------------------------------------------------------------
   Markup contract (see templates/includes/home.tpl):

   <div class="buft-slider" data-autoplay="6000" data-interval="6000">
     <div class="buft-slider__viewport">
       <div class="buft-slider__slide is-active"><img src="..." alt=""></div>
       <div class="buft-slider__slide"><img src="..." alt=""></div>
     </div>
     <button class="buft-slider__arrow buft-slider__arrow--prev" ...></button>
     <button class="buft-slider__arrow buft-slider__arrow--next" ...></button>
     <div class="buft-slider__dots"></div>
   </div>

   The viewport height is set by js/home_slider.js from the natural aspect
   ratio of the first image, so slides are never distorted and the hero
   keeps the exact same look as the old single <img>.
   ========================================================================== */

.buft-slider {
	position: relative;
	width: 100%;
	overflow: hidden;
	background: #0d2d62;
	-webkit-tap-highlight-color: transparent;
}

.buft-slider__viewport {
	position: relative;
	width: 100%;
	height: 420px;
	overflow: hidden;
}

.buft-slider__slide {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.7s ease;
	-webkit-transition: opacity 0.7s ease;
}

.buft-slider__slide.is-active {
	opacity: 1;
	visibility: visible;
	z-index: 1;
}

.buft-slider__slide img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* ---------- Optional per-slide link ------------------------------------ */

.buft-slider__slide.has-link {
	cursor: pointer;
}

/* The anchor must fill the slide so the whole image is the click target. */
.buft-slider__link {
	display: block;
	width: 100%;
	height: 100%;
	color: inherit;
	text-decoration: none;
}

/* Arrow glyphs and dots sit above slides; a focused link needs a visible
   focus ring that is not hidden behind the next slide. */
.buft-slider__slide.has-link .buft-slider__link:focus {
	outline: 3px solid #b80924;
	outline-offset: -3px;
}

/* ---------- Previous / next arrows ------------------------------------ */

.buft-slider__arrow {
	position: absolute;
	top: 50%;
	z-index: 5;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 52px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.92);
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.28);
	color: #0d2d62;
	cursor: pointer;
	opacity: 0;
	transform: translateY(-50%) scale(0.85);
	transition: opacity 0.3s ease, transform 0.3s ease,
	            background-color 0.25s ease, box-shadow 0.25s ease;
	-webkit-appearance: none;
	appearance: none;
}

.buft-slider:hover .buft-slider__arrow,
.buft-slider.is-touch .buft-slider__arrow {
	opacity: 1;
	transform: translateY(-50%) scale(1);
}

.buft-slider__arrow--prev { left: 26px; }
.buft-slider__arrow--next { right: 26px; }

.buft-slider__arrow:hover,
.buft-slider__arrow:focus-visible {
	background: #b80924;
	color: #fff;
	box-shadow: 0 8px 26px rgba(184, 9, 36, 0.5);
	transform: translateY(-50%) scale(1.1);
	outline: none;
}

.buft-slider__arrow:focus-visible {
	box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.55), 0 8px 26px rgba(0, 0, 0, 0.3);
}

.buft-slider__arrow:active {
	transform: translateY(-50%) scale(0.95);
}

/* Chevron drawn with borders so no icon font is required. */
.buft-slider__arrow::before {
	content: "";
	display: block;
	width: 13px;
	height: 13px;
	border-top: 3px solid currentColor;
	border-right: 3px solid currentColor;
}

.buft-slider__arrow--prev::before {
	transform: rotate(-135deg);
	margin-left: 4px;
}

.buft-slider__arrow--next::before {
	transform: rotate(45deg);
	margin-right: 4px;
}

/* ---------- Dot indicators -------------------------------------------- */

.buft-slider__dots {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 22px;
	z-index: 5;
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 10px;
	padding: 0 60px;
	opacity: 0;
	transition: opacity 0.3s ease;
}

.buft-slider:hover .buft-slider__dots,
.buft-slider.is-touch .buft-slider__dots {
	opacity: 1;
}

.buft-slider__dot {
	width: 11px;
	height: 11px;
	padding: 0;
	border: 2px solid rgba(255, 255, 255, 0.9);
	border-radius: 50%;
	background: transparent;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
	cursor: pointer;
	transition: width 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
	-webkit-appearance: none;
	appearance: none;
}

.buft-slider__dot:hover {
	border-color: #b80924;
}

.buft-slider__dot.is-active {
	width: 30px;
	border-radius: 6px;
	background: #b80924;
	border-color: #b80924;
}

/* ---------- Fallback when there is a single slide ---------------------- */

.buft-slider--single .buft-slider__arrow,
.buft-slider--single .buft-slider__dots {
	display: none;
}

.buft-slider--static .buft-slider__viewport {
	height: auto;
}

.buft-slider--static .buft-slider__slide {
	position: static;
	opacity: 1;
	visibility: visible;
	height: auto;
}

.buft-slider--static .buft-slider__slide:not(:first-child) {
	display: none;
}

.buft-slider--static .buft-slider__slide img {
	height: auto;
}

/* ---------- Responsive ------------------------------------------------- */

@media (max-width: 992px) {
	.buft-slider__arrow { width: 44px; height: 44px; }
	.buft-slider__arrow--prev { left: 14px; }
	.buft-slider__arrow--next { right: 14px; }
	.buft-slider__dots { bottom: 16px; }
}

@media (max-width: 600px) {
	.buft-slider__viewport { height: 260px; }
	.buft-slider__arrow { width: 36px; height: 36px; opacity: 1; transform: translateY(-50%) scale(1); }
	.buft-slider__arrow::before { width: 10px; height: 10px; border-width: 2px; }
	.buft-slider__arrow--prev { left: 8px; }
	.buft-slider__arrow--next { right: 8px; }
	.buft-slider__dots { bottom: 12px; gap: 8px; padding: 0 46px; opacity: 1; }
	.buft-slider__dot { width: 9px; height: 9px; }
	.buft-slider__dot.is-active { width: 22px; }
}

@media (prefers-reduced-motion: reduce) {
	.buft-slider__slide,
	.buft-slider__arrow,
	.buft-slider__dot,
	.buft-slider__dots {
		transition: none;
	}
}
