/**
 * Sahliyeh Timeline Component
 *
 * Interactive step-based timeline with prev/next navigation.
 * Displays 2 entries at a time on desktop, 1 on mobile.
 *
 * @package Kindling
 * @since 1.0.0
 */

/* ==========================================================================
 * Layout: Outer container
 * ========================================================================== */

.sahliyeh-timeline {
	display: flex;
	flex-direction: row;
	gap: 60px;
	align-items: flex-start;
}

/* ==========================================================================
 * Sidebar: Kicker, heading, and nav arrows
 * ========================================================================== */

/* Timeline kicker: Great Vibes script in gold per Figma spec */
.sahliyeh-timeline .is-style-type-style-kicker {
	font-family: var(--wp--preset--font-family--great-vibes) !important;
	font-size: 40px !important;
	font-weight: 400 !important;
	line-height: 1.2 !important;
	color: var(--wp--preset--color--theme-04) !important;
}

.sahliyeh-timeline__sidebar {
	flex: 0 0 345px;
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--30);
}

.sahliyeh-timeline__nav {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-top: var(--wp--preset--spacing--40);
}

.sahliyeh-timeline__prev,
.sahliyeh-timeline__next {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 33px;
	height: 33px;
	background: none;
	border: none;
	cursor: pointer;
	padding: 0;
	transition: opacity 0.2s ease;
}

.sahliyeh-timeline__prev svg,
.sahliyeh-timeline__next svg {
	width: 20px;
	height: 20px;
	fill: none;
	stroke: var(--wp--preset--color--theme-04);
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.sahliyeh-timeline__prev:hover svg,
.sahliyeh-timeline__next:hover svg {
	stroke: var(--wp--preset--color--theme-01);
}

.sahliyeh-timeline__prev:focus-visible,
.sahliyeh-timeline__next:focus-visible {
	outline: 2px solid var(--wp--preset--color--theme-04);
	outline-offset: 2px;
}

.sahliyeh-timeline__prev.is-disabled,
.sahliyeh-timeline__next.is-disabled {
	opacity: 0.3;
	cursor: default;
	pointer-events: none;
}

/* Nav dots (between arrows) — dark circles, active one is gold */
.sahliyeh-timeline__nav-dots {
	display: flex;
	align-items: center;
	gap: 6px;
}

.sahliyeh-timeline__nav-dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background-color: color-mix(in srgb, var(--wp--preset--color--theme-01) 20%, transparent);
	transition: background-color 0.3s ease;
	border: none;
	padding: 0;
	cursor: pointer;
	min-width: 0;
	min-height: 0;
}

.sahliyeh-timeline__nav-dot.is-active {
	background-color: var(--wp--preset--color--theme-04);
}

/* ==========================================================================
 * Content area: Progress bar + entries
 * ========================================================================== */

.sahliyeh-timeline__content {
	flex: 1 1 0%;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--50);
}

/* Progress bar — horizontal line; dots slide in sync with the entry track.
 * overflow:hidden clips dots that slide past the edges. */
.sahliyeh-timeline__progress,
.sahliyeh-timeline__progress.wp-block-group {
	position: relative;
	width: 100%;
	height: 14px;
	margin-bottom: var(--wp--preset--spacing--50);
	overflow: hidden;
	min-height: 0;
	padding: 0;
	gap: 0;
}

/* The line itself — centered vertically */
.sahliyeh-timeline__progress::before {
	content: "";
	position: absolute;
	top: 50%;
	left: 0;
	right: 0;
	height: 2px;
	background-color: color-mix(in srgb, var(--wp--preset--color--theme-01) 20%, transparent);
	transform: translateY(-50%);
}

.sahliyeh-timeline__progress-dot {
	width: 14px;
	height: 14px;
	border-radius: 50%;
	/* Invisible by default — only gold when active/past */
	background-color: transparent;
	position: absolute;
	top: 0;
	z-index: 1;
	transition: background-color 0.4s ease, box-shadow 0.4s ease, left 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
	margin-top: 0 !important; /* Override WP block spacing (blockGap) which adds margins to child elements */
	margin-bottom: 0 !important;
}

.sahliyeh-timeline__progress-dot.is-active {
	background-color: var(--wp--preset--color--theme-04);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--wp--preset--color--theme-04) 30%, transparent);
}

.sahliyeh-timeline__progress-dot.is-past {
	background-color: var(--wp--preset--color--theme-04);
}

/* Entries container */
.sahliyeh-timeline__entries {
	overflow: hidden;
	position: relative;
}

/* Sliding track */
.sahliyeh-timeline__track {
	display: flex;
	flex-direction: row;
	gap: 40px;
	align-items: flex-start;
	transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
	will-change: transform;
}

/* Individual entry */
.sahliyeh-timeline__entry {
	flex: 0 0 calc(50% - 20px);
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--40);
	margin-block-start: 0 !important; /* Override WP is-layout-flow gap on non-first entries */
}


/* Year heading */
.sahliyeh-timeline__year {
	font-family: var(--wp--preset--font-family--collier);
	font-size: 36px;
	font-weight: 400;
	color: var(--wp--preset--color--theme-04);
	text-transform: uppercase;
	letter-spacing: -0.03em;
	line-height: 1.1;
	margin: 0;
}

/* Description text */
.sahliyeh-timeline__text {
	font-family: var(--wp--preset--font-family--montserrat);
	font-size: 16px;
	font-weight: 400;
	color: var(--wp--preset--color--theme-01);
	line-height: 1.5;
	margin: 0;
}

/* Image placeholder */
.sahliyeh-timeline__image {
	width: 100%;
	aspect-ratio: 16 / 9;
	background-color: color-mix(in srgb, var(--wp--preset--color--theme-01) 10%, transparent);
	border-radius: 0;
	overflow: hidden;
}

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

/* ==========================================================================
 * Responsive: Tablet and below
 * ========================================================================== */

@media (max-width: 1023px) {
	.sahliyeh-timeline {
		gap: 40px;
	}

	.sahliyeh-timeline__sidebar {
		flex: 0 0 260px;
	}

	.sahliyeh-timeline__entry {
		flex: 0 0 calc(50% - 20px);
	}
}

/* ==========================================================================
 * Responsive: Mobile (<768px)
 * ========================================================================== */

@media (max-width: 767px) {
	.sahliyeh-timeline {
		flex-direction: column;
		gap: var(--wp--preset--spacing--50);
	}

	.sahliyeh-timeline__sidebar {
		flex: none;
		width: 100%;
		flex-direction: row;
		flex-wrap: wrap;
		align-items: center;
		justify-content: space-between;
	}

	.sahliyeh-timeline__sidebar-text {
		display: flex;
		flex-direction: column;
		gap: 4px;
	}

	.sahliyeh-timeline__nav {
		margin-top: 0;
	}

	.sahliyeh-timeline__content {
		width: 100%;
	}

	.sahliyeh-timeline__entry {
		flex: 0 0 100%;
	}

	.sahliyeh-timeline__track {
		gap: 24px;
	}
}

/* ==========================================================================
 * Accessibility: Reduced motion
 * ========================================================================== */

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

	.sahliyeh-timeline__progress-dot {
		transition: none;
	}

	.sahliyeh-timeline__nav-dot {
		transition: none;
	}
}

/* ==========================================================================
 * Screen reader text utility (if not already global)
 * ========================================================================== */

.sahliyeh-timeline .sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}
