/**
 * Horizontal timeline section (About-style).
 *
 * @package Matta_Utility
 */

.matta-timeline {
	color: #fff;
	padding: 30px 0;
	border-radius: 12px;
}

/* Timeline rail */
.matta-timeline .ab-rail-wrap {
	position: relative;
}

.matta-timeline .ab-rail {
	position: relative;
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 16px 0;
}

.matta-timeline .ab-track {
	position: absolute;
	left: 0;
	right: 0;
	top: 50%;
	height: 2px;
	background: #fff;
	opacity: 0.25;
	transform: translateY(-50%);
	pointer-events: none;
}

.matta-timeline .ab-ti {
	position: relative;
	display: flex;
	flex-direction: column-reverse;
	align-items: center;
	gap: 6px;
	justify-self: center;
	background: transparent;
	border: 0;
	color: #fff;
	cursor: pointer;
	white-space: nowrap;
	flex: 0 1 auto;
	margin-top: -23px;
	padding: 0;
}

.matta-timeline .ab-ti:first-child {
	justify-self: flex-start;
}

.matta-timeline .ab-ti:last-child {
	justify-self: flex-end;
}

.matta-timeline .ab-ti .ab-dot {
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: #fff;
	display: inline-block;
}

.matta-timeline .ab-ti .ab-yr {
	font-weight: 600;
	font-size: 14px;
	opacity: 0.85;
	transition: opacity 0.2s, color 0.2s, transform 0.2s;
	transform: translateY(-6px);
}

.matta-timeline .ab-ti.active .ab-dot {
	background: #e63946;
}

.matta-timeline .ab-ti.active .ab-yr {
	color: #e63946;
	opacity: 1;
	transform: translateY(-8px);
}

/* Slides + nav */
.matta-timeline .ab-slides-wrap {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 55px;
	max-width: 1200px;
	margin: 25px auto;
	position: relative;
}

.matta-timeline .ab-nav {
	background: transparent url("../images/white-arrow.svg") center/contain no-repeat;
	border: 0;
	color: #000;
	cursor: pointer;
	width: 47px;
	height: 47px;
	border-radius: 0;
	display: grid;
	place-items: center;
	opacity: 0.9;
	flex: 0 0 auto;
	transition: background 0.2s, opacity 0.2s;
}

.matta-timeline .ab-nav:hover {
	opacity: 0.8;
	background-color: transparent;
}

.matta-timeline .ab-nav span {
	display: none;
}

.matta-timeline[data-prev-arrow="1"] .ab-prev span,
.matta-timeline[data-next-arrow="1"] .ab-next span {
	display: none;
}

.matta-timeline[data-prev-arrow="1"] .ab-prev {
	background-image: var(--sgmat-tl-arrow-prev);
}

.matta-timeline[data-next-arrow="1"] .ab-next {
	background-image: var(--sgmat-tl-arrow-next);
}

.matta-timeline .ab-prev {
	transform: rotate(180deg);
}

.matta-timeline .ab-slides {
	flex: 1;
	max-width: 1100px;
}

.matta-timeline .ab-slide {
	display: none;
	animation: sgmat-timeline-fade-in 0.4s ease;
}

.matta-timeline .ab-slide.active {
	display: grid;
	grid-template-columns: 40% 60%;
	gap: 28px;
	align-items: center;
}

.matta-timeline .ab-slide.active.ab-slide-no-image {
	grid-template-columns: 1fr;
	justify-items: center;
	text-align: center;
}

.matta-timeline .ab-slide.active.ab-slide-no-image .ab-body {
	display: flex;
	justify-content: center;
}

.matta-timeline .ab-img img {
	width: 100%;
	max-height: 420px;
	object-fit: cover;
	border-radius: 12px;
}

.matta-timeline .ab-desc {
	font-size: 18px;
	line-height: 1.6;
	opacity: 0.9;
	margin: 0;
	max-width: 950px;
	width: 100%;
	text-align: center;
}

@keyframes sgmat-timeline-fade-in {
	from {
		opacity: 0;
		transform: translateY(6px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@media (max-width: 991px) {
	.matta-timeline .ab-desc {
		max-width: none;
		width: auto;
		text-align: center;
	}

	.matta-timeline .ab-slides-wrap {
		position: relative;
		padding-bottom: 72px;
		overflow: visible;
	}

	.matta-timeline .ab-slide.active {
		grid-template-columns: 1fr;
	}

	.matta-timeline .ab-prev,
	.matta-timeline .ab-next {
		position: absolute !important;
		bottom: 16px;
		top: auto !important;
		z-index: 10;
		display: inline-flex;
		justify-content: center;
		align-items: center;
	}

	.matta-timeline .ab-prev {
		left: calc(50% - 52px);
	}

	.matta-timeline .ab-next {
		left: calc(50% + 6px);
	}

	.matta-timeline .ab-nav {
		width: 46px;
		height: 46px;
	}
}
