/**
 * Autoplay-driven carousel (no swipe); tablet/desktop overlap unchanged (Figma 886:1363).
 *
 * @package Love_Beauty_Skin
 */

.history-timeline {
	--ht-bg: #f6eeea;
	--ht-subtitle-color: #d9a9a9;
	--ht-text: #636363;
	--ht-title: #3a3a3a;
	--ht-card-bg: #ffffff;
	--ht-card-border: rgba(58, 58, 58, 0.1);

	background-color: var(--ht-bg);
	padding: clamp(2.5rem, 6vw, 4.25rem) var(--lbs-space-header-x, 1.25rem);
	overflow-x: hidden;
	overflow-y: hidden;
	overscroll-behavior-x: none;
}

.history-timeline__inner {
	max-width: var(--lbs-container-max);
	margin-inline: auto;
	width: 100%;
	box-sizing: border-box;
}

.history-timeline__header {
	text-align: left;
	max-width: 46rem;
	margin-inline: 0;
	margin-bottom: clamp(2rem, 4vw, 3rem);
}

.history-timeline__subtitle {
	margin: 0 0 0.5rem;
	font-family: var(--lbs-font-body);
	font-weight: 300;
	font-size: clamp(1.25rem, 2.5vw, 1.75rem);
	line-height: 1.1;
	color: var(--ht-subtitle-color);
}

.history-timeline__title {
	margin: 0;
	font-family: var(--lbs-font-display);
	font-weight: 300;
	font-size: clamp(2.25rem, 5vw, 3.5rem);
	line-height: 1.2;
	color: var(--ht-text);
}

/*
 * Carousel full-bleed; horizontal inset on Swiper (box-sizing consistent).
 */
.history-timeline__carousel {
	position: relative;
	box-sizing: border-box;
	overflow: hidden;
	width: 100vw;
	max-width: none;
	margin-inline: calc(50% - 50vw);
	padding-inline: 0;
}

.history-timeline__swiper {
	box-sizing: border-box;
	width: 100%;
	min-width: 0;
	overflow: hidden;
	padding-inline: max(var(--lbs-space-header-x), 1rem);
	padding-block: clamp(2rem, 5vw, 3.5rem);
	/* Vertical scroll passes through area; carousel does not use horizontal drag (autoplay-only). */
	touch-action: pan-y;
	-webkit-touch-callout: none;
	cursor: default;
}

.history-timeline__swiper .swiper-wrapper {
	align-items: stretch;
	overflow: visible;
}

.history-timeline__slide {
	position: relative;
	z-index: 1;
	height: auto;
	box-sizing: border-box;
	transform-style: preserve-3d;
}

.history-timeline__slide.swiper-slide-active {
	z-index: 6;
}

.history-timeline__slide.swiper-slide-next {
	z-index: 4;
}

.history-timeline__slide.swiper-slide-prev {
	z-index: 4;
}

/* Tablet+ only: alternating tilt & overlap stacking (mobile stays straight / single column). */
@media (min-width: 768px) {
	/* Stack tilted overlaps read front-to-back */
	.history-timeline__slide:nth-child(odd) {
		z-index: 2;
	}

	.history-timeline__slide:nth-child(even) {
		z-index: 1;
	}

	/* Alternate tilt — pivots from top (hanging banner / fabric) */
	.history-timeline__slide--tilt-left .history-timeline__card,
	.history-timeline__slide--tilt-right .history-timeline__card {
		transform-origin: 50% 0;
	}

	.history-timeline__slide--tilt-left .history-timeline__card {
		transform: rotate(-5deg);
	}

	.history-timeline__slide--tilt-right .history-timeline__card {
		transform: rotate(5deg);
	}

	.history-timeline__slide.swiper-slide-active.history-timeline__slide--tilt-left .history-timeline__card {
		transform: rotate(-5deg) scale(1.02);
	}

	.history-timeline__slide.swiper-slide-active.history-timeline__slide--tilt-right .history-timeline__card {
		transform: rotate(5deg) scale(1.02);
	}

	/* Focused slide reads above neighbours (keyboard / assistive tech) */
	.history-timeline__carousel .history-timeline__slide:focus-within {
		z-index: 60;
	}
}

/* Fine pointer only — avoids sticky :hover stacking on coarse touch tablets */
@media (min-width: 768px) and (hover: hover) {
	.history-timeline__carousel .history-timeline__slide:hover {
		z-index: 60;
	}
}

.history-timeline__card {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: clamp(0.5rem, 1.5vw, 0.75rem);
	width: 100%;
	max-width: none;
	margin-inline: 0;
	background: var(--ht-card-bg);
	padding: 10px;
	box-sizing: border-box;
	border: 1px solid var(--ht-card-border);
	border-radius: 2px;
	box-shadow:
		0 4px 6px #CCC;
	transition: transform 0.9s cubic-bezier(0.26, 0.88, 0.32, 1.04);
}

.history-timeline__figure {
	position: relative;
	margin: 0;
	width: 100%;
	line-height: 0;
	overflow: hidden;
	background: rgba(217, 169, 169, 0.12);
	aspect-ratio: 343 / 380;
	box-sizing: border-box;
}

.history-timeline__img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	max-height: none;
	object-fit: cover;
	object-position: center;
	-webkit-user-drag: none;
	user-select: none;
}

.history-timeline__body {
	max-width: 100%;
	padding: 0;
	text-align: center;
}

.history-timeline__year-label {
	margin: 0 0 0.625rem;
	font-family: var(--lbs-font-display);
	font-weight: 300;
	font-size: clamp(1.5rem, 2.75vw, 2rem);
	line-height: 1.2;
	letter-spacing: 0.03em;
	color: var(--ht-subtitle-color);
}

.history-timeline__desc {
	font-family: var(--lbs-font-body);
	font-weight: 300;
	font-size: clamp(1rem, 2vw, 1.125rem);
	line-height: 1.45;
	color: var(--ht-text);
	text-align: center;
	padding-bottom: 1.5rem;
}

.history-timeline__desc p {
	margin: 0 0 1em;
}

.history-timeline__desc p:last-child {
	margin-bottom: 0;
}

@media (prefers-reduced-motion: reduce) {
	.history-timeline__card {
		transition: none;
	}
}
