/**
 * Marielle Carousel — featured-image slider (no Swiper, custom state-based layout).
 *
 * Mirrors the reference prototype:
 *   - Active slide large, slightly to the left.
 *   - Two side thumbnails clipped on each edge.
 *   - Inactive slides dimmed (brightness + sepia).
 *   - Navigation arrows aligned with the left edge of the next thumbnail.
 */

.marielle-carousel {
	/* Variables driven by the widget controls. */
	--mc-height: 100vh;
	--mc-active-w: 48vw;
	--mc-thumb-w: 18vw;
	--mc-next1-w: 24vw;
	--mc-inactive-opacity: 0.9;
	--mc-inactive-brightness: 0.4;

	--mc-arrow-size: 40px;
	--mc-arrow-color: #FFFFFF;
	--mc-arrow-hover-color: #1F3327;
	--mc-arrow-hover-bg: #FFFFFF;
	--mc-arrow-bg: transparent;
	--mc-arrow-border: rgba(255, 255, 255, 0.5);

	position: relative;
	width: 100%;
	height: var(--mc-height);
	overflow: hidden;
	display: flex;
	align-items: center;
}

.marielle-carousel__stage {
	position: relative;
	width: 100%;
	height: 100%;
}

/* ---------- Slide base ---------- */

.marielle-carousel__slide {
	position: absolute;
	bottom: 10%;
	aspect-ratio: 1188 / 760;
	overflow: hidden;
	box-shadow: none;
	transition: all 0.8s cubic-bezier(0.25, 1, 0.45, 1);
	user-select: none;
	-webkit-user-drag: none;
	background: rgba(0, 0, 0, 0.05);
}

.marielle-carousel__slide .marielle-carousel__link,
.marielle-carousel__slide .marielle-carousel__img {
	display: block;
	width: 100%;
	height: 100%;
	user-select: none;
	-webkit-user-drag: none;
}

.marielle-carousel__img {
	object-fit: cover;
	transition: all 0.8s ease;
}

/* ---------- State classes ---------- */

.marielle-carousel__slide.is-hidden-left {
	left: -30%;
	width: var(--mc-thumb-w);
	height: 30vh;
	opacity: 0;
	z-index: 0;
	filter: brightness(var(--mc-inactive-brightness)) sepia(0.3);
	pointer-events: none;
}

.marielle-carousel__slide.is-prev {
	left: -3%;
	width: var(--mc-thumb-w);
	height: 30vh;
	opacity: var(--mc-inactive-opacity);
	z-index: 10;
	filter: brightness(var(--mc-inactive-brightness)) sepia(0.3);
	cursor: pointer;
}

.marielle-carousel__slide.is-active {
	left: 17%;
	width: var(--mc-active-w);
	opacity: 1;
	z-index: 20;
	filter: brightness(1) sepia(0);
}

.marielle-carousel__slide.is-next-1 {
	left: 67.2%;
	width: var(--mc-next1-w);
	height: 30vh;
	opacity: var(--mc-inactive-opacity);
	z-index: 10;
	filter: brightness(var(--mc-inactive-brightness)) sepia(0.3);
	cursor: pointer;
}

.marielle-carousel__slide.is-next-2 {
	left: 93%;
	width: var(--mc-thumb-w);
	height: 30vh;
	opacity: var(--mc-inactive-opacity);
	z-index: 10;
	filter: brightness(var(--mc-inactive-brightness)) sepia(0.3);
	pointer-events: none;
}

.marielle-carousel__slide.is-hidden-right {
	left: 120%;
	width: var(--mc-thumb-w);
	opacity: 0;
	z-index: 0;
	filter: brightness(var(--mc-inactive-brightness)) sepia(0.3);
	pointer-events: none;
}

.marielle-carousel__slide:not(.is-active) .marielle-carousel__link {
	pointer-events: none;
}

/* ---------- Navigation (arrows) ---------- */

.marielle-carousel__nav {
	position: absolute;
	left: 67.2%;
	top: 45%;
	bottom: calc(30vh - 150px);
	transform: translateY(-50%);
	z-index: 30;
	display: flex;
	gap: 1rem;
	transition: all 0.5s ease;
}

.marielle-carousel__arrow {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: var(--mc-arrow-size);
	height: var(--mc-arrow-size);
	padding: 0;
	margin: 0;
	border-radius: 50%;
	background: var(--mc-arrow-bg);
	border: 1px solid var(--mc-arrow-border);
	color: var(--mc-arrow-color);
	cursor: pointer;
	transition: color 300ms ease, background 300ms ease, border-color 300ms ease, opacity 300ms ease;
}

.marielle-carousel__arrow:hover,
.marielle-carousel__arrow:focus-visible {
	color: var(--mc-arrow-hover-color);
	background: var(--mc-arrow-hover-bg);
	border-color: var(--mc-arrow-hover-bg);
	outline: none;
}

.marielle-carousel__arrow-icon {
	width: 50%;
	height: 50%;
}

/* ---------- Tablet (<=1024px) ---------- */
@media (max-width: 1024px) {
	.marielle-carousel__slide.is-prev {
		left: -7%;
		width: 16vw;
		height: 22vh;
	}

	.marielle-carousel__slide.is-active {
		left: 12%;
		width: 70vw;
		height: auto;
	}

	.marielle-carousel__slide.is-next-1 {
		left: 85%;
		width: 20vw;
		height: 22vh;
	}

	.marielle-carousel__slide.is-next-2 {
		left: 102%;
		width: 16vw;
		height: 22vh;
	}

	.marielle-carousel__slide.is-hidden-left {
		height: 22vh;
	}

	.marielle-carousel__nav {
		left: 80%;
		top: 42%;
	}
}

/* ---------- Mobile (<=768px) ---------- */
@media (max-width: 768px) {
	.marielle-carousel {
		--mc-mobile-active-w: 64vw;
		height: min(var(--mc-height), calc((var(--mc-mobile-active-w) * 0.7802) + 18px));
		overflow: visible;
	}

	.marielle-carousel__slide {
		bottom: 18%;
		top: auto;
	}

	.marielle-carousel__slide.is-prev {
		left: -8%;
		width: 18vw;
		height: 14vh;
	}

	.marielle-carousel__slide.is-active {
		left: 12%;
		width: var(--mc-mobile-active-w);
		height: auto;
	}

	.marielle-carousel__slide.is-next-1 {
		left: 78%;
		width: 22vw;
		height: 14vh;
	}

	.marielle-carousel__slide.is-next-2 {
		left: 102%;
		width: 18vw;
		height: 14vh;
	}

	.marielle-carousel__slide.is-hidden-left {
		height: 14vh;
	}

	.marielle-carousel__nav {
		left: 50%;
		top: auto;
		bottom: -10px;
		transform: translateX(-50%);
	}
}

/* Accessibility helper. */
.marielle-carousel .screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	-webkit-clip-path: inset(50%);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
	word-wrap: normal !important;
}

/* ---------- Button focus ---------- */

selector [type=button]:focus {
	background-color: #fff;
	color: #000;
}

/* ---------- Small mobile (<=400px) ---------- */
@media (max-width: 400px) {
	.marielle-carousel__slide {
		bottom: 18%;
		top: auto;
	}

	.marielle-carousel__slide.is-active {
		left: 14%;
		width: 60vw;
	}

	.marielle-carousel__slide.is-prev {
		left: -8%;
    width: 18vw;
    height: 12vh;
	}

	.marielle-carousel__slide.is-next-1 {
		left: 78%;
		width: 25vw;
		height: 12vh;
	}

	.marielle-carousel__slide.is-next-2 {
		left: 100%;
		width: 16vw;
		height: 10vh;
	}

	.marielle-carousel__slide.is-hidden-left {
		height: 10vh;
	}

	.marielle-carousel__nav {
		left: 50%;
		top: auto;
		transform: translateX(-50%);
	}
}
