/**
 * Feature Carousel.
 *
 * Cards are a FIXED width (Figma: 400px) and Swiper runs slidesPerView:'auto',
 * so how many fit is whatever the viewport allows and the last one is cut by the
 * screen edge — which is what produces the bleed in the design, rather than a
 * fractional slidesPerView that would rescale the cards.
 *
 * The lead panel is slide one, so the whole row — panel included — moves when the
 * arrow is pressed.
 *
 * Figma: track 2142:47, lead 2125:541 (#C5A47E, r30, 400x519),
 * arrow 2143:348 (55px white circle, chevron-right 24px #5F3D31),
 * lead CTA 2175:485 (#5F3D31, white Bold 14/28 uppercase, r5, 9/23/11/23).
 */

.ashers-carousel {
	--ashers-carousel-card-width: 400px;
	--ashers-carousel-gap: 21px;
	--ashers-carousel-bleed-right: calc(50vw - 50%);
	--ashers-carousel-bleed-left: calc(50vw - 50%);
	--ashers-carousel-arrow-size: 55px;
	--ashers-carousel-arrow-icon: 24px;
	--ashers-carousel-arrow-hover-scale: 1.18;
	--ashers-carousel-arrow-ink: #5f3d31;
	--ashers-carousel-arrow-ease: 240ms cubic-bezier(0.4, 0, 0.2, 1);
	--ashers-carousel-fade: 0.4;
	--ashers-carousel-radius: 30px;
	--ashers-carousel-lead-bg: #c5a47e;
	--ashers-carousel-ink: #24150b;
	--ashers-carousel-brown: #5f3d31;
	--ashers-carousel-ease: 240ms cubic-bezier(0.4, 0, 0.2, 1);

	position: relative;
}

.ashers-carousel__track-wrap {
	position: relative;
	min-width: 0;
}

/*
 * The track spans the full viewport in both directions. The first slide is held
 * at the content edge by Swiper's slidesOffsetBefore rather than by padding, so
 * that snapping stays correct — which means slides leaving to the left travel
 * into the left gutter and stay visible out to the screen edge, instead of being
 * clipped at the content column.
 */
.ashers-carousel.is-full-bleed .ashers-carousel__track-wrap {
	margin-right: calc(-1 * var(--ashers-carousel-bleed-right));
	margin-left: calc(-1 * var(--ashers-carousel-bleed-left));
}

.ashers-carousel__swiper {
	width: 100%;
	overflow: hidden;
}

/* Stretch so the lead panel matches the tallest card rather than hugging its text. */
.ashers-carousel__swiper .swiper-wrapper {
	align-items: stretch;
}

.ashers-carousel__slide {
	width: var(--ashers-carousel-card-width);
	height: auto;
	flex-shrink: 0;
}

/* ------------------------------------------------------------ lead panel */

.ashers-carousel__slide--lead {
	display: flex;
}

.ashers-carousel__lead {
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	gap: 30px;
	width: 100%;
	padding: 48px;
	box-sizing: border-box;
	border-radius: var(--ashers-carousel-radius);
	background-color: var(--ashers-carousel-lead-bg);
}

.ashers-carousel__lead-body {
	color: var(--ashers-carousel-ink);
	font-family: sweet-sans-pro, "Helvetica Neue", Arial, sans-serif;
	font-weight: 500;
	font-size: 28px;
	line-height: 38px;
	letter-spacing: -0.84px;
}

.ashers-carousel__lead-body :last-child {
	margin-bottom: 0;
}

.ashers-carousel__lead-cta {
	align-self: flex-start;
	padding: 9px 23px 11px;
	border-radius: 5px;
	background-color: var(--ashers-carousel-brown);
	color: #ffffff;
	font-family: sweet-sans-pro, "Helvetica Neue", Arial, sans-serif;
	font-weight: 700;
	font-size: 14px;
	line-height: 28px;
	text-transform: uppercase;
	text-decoration: none;
	transition: background-color var(--ashers-carousel-ease);
}

.ashers-carousel__lead-cta:hover {
	background-color: transparent;
	background-image: linear-gradient(180deg, #5F3D31 0%, #24150B 64.9%);
	color: #ffffff;
}

/* ----------------------------------------------------------------- arrow */

/*
 * The design parks the arrow in the gutter just outside the content column —
 * at 1600px that is 21px (one gap) past the content's right edge. Deriving it
 * from the bleed distance keeps that relationship at any width, and max() stops
 * it leaving the screen once the bleed gets small.
 */
.ashers-carousel__arrow {
	/* Appearance is in carousel-arrows.css; only the placement is local. The
	   arrow lines up with the middle of the card media, not the whole card, so
	   it stays put when titles wrap to a second line. */
	top: calc(var(--ashers-card-media-height, 400px) / 2);
}

/* Next sits one gap outside the content column's right edge; prev mirrors it
   exactly on the left, on the same horizontal line. */
.ashers-carousel__arrow--next {
	right: max(10px, calc(var(--ashers-carousel-bleed-right) - var(--ashers-carousel-gap) - var(--ashers-carousel-arrow-size)));
}

.ashers-carousel__arrow--prev {
	left: max(10px, calc(var(--ashers-carousel-bleed-left) - var(--ashers-carousel-gap) - var(--ashers-carousel-arrow-size)));
}

/* ------------------------------------------------------------- edge fade */

/*
 * Slides the screen edge is cutting off are dimmed. JS tags them, because the
 * partly-visible slide is not something CSS can identify on its own.
 */
.ashers-carousel.is-fading .ashers-carousel__slide {
	transition: opacity var(--ashers-carousel-ease);
}

.ashers-carousel.is-fading .ashers-carousel__slide.is-clipped {
	opacity: var(--ashers-carousel-fade);
}

/* ------------------------------------------------------------------ misc */

.ashers-carousel a:focus-visible,
.ashers-carousel button:focus-visible {
	outline: 3px solid var(--ashers-carousel-ink) !important;
	outline-offset: 3px !important;
}

.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

/* ------------------------------------------------------------ responsive */

@media (max-width: 1024px) {
	.ashers-carousel {
		--ashers-carousel-gap: 16px;
	}

	.ashers-carousel__lead {
		padding: 36px;
	}

	.ashers-carousel__lead-body {
		font-size: 24px;
		line-height: 32px;
		letter-spacing: -0.72px;
	}
}

@media (max-width: 767px) {
	.ashers-carousel {
		--ashers-carousel-gap: 12px;
		--ashers-carousel-arrow-size: 44px;
		--ashers-carousel-arrow-icon: 18px;
	}

	.ashers-carousel__lead {
		padding: 28px;
		gap: 24px;
	}

	.ashers-carousel__lead-body {
		font-size: 22px;
		line-height: 30px;
		letter-spacing: -0.66px;
	}

	.ashers-card--carousel {
		--ashers-card-media-height: 280px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ashers-carousel__lead-cta,
	.ashers-carousel.is-fading .ashers-carousel__slide {
		transition-duration: 1ms;
	}
}
