/* ==========================================================================
   LPCW Timeline Widget
   Clean, accessible, responsive vertical timeline with scroll progress.
   ========================================================================== */

.lpcw-timeline {
	--lpcw-line-width: 3px;
	--lpcw-line-color: #c5d5eb;
	--lpcw-line-progress-color: #196bde;
	--lpcw-marker-size: 36px;
	--lpcw-marker-bg: #ffc107;
	--lpcw-marker-icon-color: #1a1a1a;
	--lpcw-card-gap: 28px;

	position: relative;
	width: 100%;
	padding: 20px 0;
}

/* ── Start / End markers ────────────────────────────────────────────────── */

.lpcw-timeline-start-wrapper,
.lpcw-timeline-end-wrapper {
	display: flex;
	justify-content: center;
	margin-bottom: 24px;
	position: relative;
	z-index: 2;
}

.lpcw-timeline-end-wrapper {
	margin-top: 24px;
	margin-bottom: 0;
}

.lpcw-timeline-start,
.lpcw-timeline-end {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-weight: 700;
	font-size: 14px;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	line-height: 1.2;
	white-space: nowrap;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* ── Track & Line ───────────────────────────────────────────────────────── */

.lpcw-timeline-track {
	position: relative;
	width: 100%;
}

.lpcw-timeline-line {
	position: absolute;
	top: 0;
	bottom: 0;
	left: 50%;
	width: var(--lpcw-line-width);
	transform: translateX(-50%);
	background-color: var(--lpcw-line-color);
	border-radius: 999px;
	z-index: 0;
	overflow: hidden;
}

.lpcw-timeline-line-progress {
	display: block;
	width: 100%;
	height: 0%;
	background-color: var(--lpcw-line-progress-color);
	border-radius: 999px;
	transition: height 0.15s linear;
	will-change: height;
}

/* ── Items ──────────────────────────────────────────────────────────────── */

.lpcw-timeline-item {
	position: relative;
	display: grid;
	grid-template-columns: 1fr var(--lpcw-marker-size) 1fr;
	align-items: center;
	gap: 0 var(--lpcw-card-gap);
	z-index: 1;
}

/* Content (card) column – default (odd items): LEFT side of the line */
.lpcw-timeline-content {
	display: flex;
	justify-content: flex-end; /* push card toward the center line */
	order: 1;
}

/* Even items (reverse): content goes to the RIGHT side */
.lpcw-timeline-item--reverse .lpcw-timeline-content {
	justify-content: flex-start;
	order: 3;
}

/* Marker column (always center) */
.lpcw-timeline-marker {
	width: var(--lpcw-marker-size);
	height: var(--lpcw-marker-size);
	border-radius: 50%;
	background-color: var(--lpcw-marker-bg);
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	position: relative;
	z-index: 2;
	order: 2;
	border: 2px solid transparent;
	transition: background-color 0.35s ease, color 0.35s ease, border-color 0.35s ease, transform 0.25s ease;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.lpcw-timeline-marker .lpcw-marker-icon {
	color: var(--lpcw-marker-icon-color);
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
	transition: color 0.35s ease;
}

.lpcw-timeline-marker .lpcw-marker-icon i,
.lpcw-timeline-marker .lpcw-marker-icon svg {
	display: block;
}

/* Step label column – default (odd): RIGHT side */
.lpcw-timeline-step {
	display: flex;
	justify-content: flex-start;
	order: 3;
}

/* Even items: step label moves to the LEFT side */
.lpcw-timeline-item--reverse .lpcw-timeline-step {
	justify-content: flex-end;
	order: 1;
}

.lpcw-timeline-step-label {
	display: inline-block;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.3;
	white-space: nowrap;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

/* ── Cards ──────────────────────────────────────────────────────────────── */

.lpcw-timeline-card {
	width: 100%;
	color: #fff;
	box-sizing: border-box;
}

.lpcw-timeline-card-title {
	margin: 0 0 12px;
	font-size: 1.15rem;
	font-weight: 700;
	line-height: 1.35;
	color: inherit;
}

.lpcw-timeline-card-desc {
	font-size: 0.95rem;
	line-height: 1.55;
	opacity: 0.95;
}

.lpcw-timeline-card-desc p {
	margin: 0 0 0.6em;
}

.lpcw-timeline-card-desc p:last-child {
	margin-bottom: 0;
}

/* ── Layout variants ────────────────────────────────────────────────────── */

/* Left layout – everything on the left of the line */
.lpcw-timeline--left .lpcw-timeline-item {
	grid-template-columns: 1fr var(--lpcw-marker-size);
}

.lpcw-timeline--left .lpcw-timeline-content {
	justify-content: flex-end;
	order: 1;
}

.lpcw-timeline--left .lpcw-timeline-marker {
	order: 2;
}

.lpcw-timeline--left .lpcw-timeline-step {
	display: none; /* or position differently if needed */
}

/* Right layout */
.lpcw-timeline--right .lpcw-timeline-item {
	grid-template-columns: var(--lpcw-marker-size) 1fr;
}

.lpcw-timeline--right .lpcw-timeline-content {
	justify-content: flex-start;
	order: 2;
}

.lpcw-timeline--right .lpcw-timeline-marker {
	order: 1;
}

.lpcw-timeline--right .lpcw-timeline-step {
	display: none;
}

/* ── Progress active states ─────────────────────────────────────────────── */

.lpcw-timeline-marker.is-active {
	--lpcw-marker-bg: #196bde;
	--lpcw-marker-icon-color: #ffffff;
	transform: scale(1.08);
}

/* ── Responsive – Mobile (centered vertical stack) ──────────────────────── */

@media (max-width: 767px) {
	.lpcw-timeline {
		--lpcw-card-gap: 0;
		padding: 12px 16px;
	}

	/* Force single-column centered layout on every item */
	.lpcw-timeline-item,
	.lpcw-timeline-item--reverse {
		display: flex;
		flex-direction: column;
		align-items: center;
		grid-template-columns: none;
		gap: 0;
		text-align: center;
		margin-bottom: 28px;
	}

	.lpcw-timeline-item:last-child {
		margin-bottom: 0;
	}

	/* Marker always on top of its item */
	.lpcw-timeline-marker {
		order: 1;
		margin: 0 0 14px;
		position: relative;
		z-index: 2;
	}

	/* Step label comes right under the marker */
	.lpcw-timeline-step,
	.lpcw-timeline-item--reverse .lpcw-timeline-step {
		order: 2;
		display: flex;
		justify-content: center;
		width: 100%;
		margin: 0 0 16px;
	}

	.lpcw-timeline-step-label {
		display: block;
		width: 100%;
		max-width: 320px;
		text-align: center;
		padding: 10px 20px;
		font-size: 15px;
		font-weight: 600;
	}

	/* Content card last */
	.lpcw-timeline-content,
	.lpcw-timeline-item--reverse .lpcw-timeline-content {
		order: 3;
		width: 100%;
		justify-content: center;
	}

	.lpcw-timeline-card {
		max-width: 100% !important;
		width: 100%;
		text-align: center;
	}

	/* Central line stays perfectly centered */
	.lpcw-timeline-line {
		left: 50%;
		transform: translateX(-50%);
	}

	/* Start / End markers also centered */
	.lpcw-timeline-start-wrapper,
	.lpcw-timeline-end-wrapper {
		justify-content: center;
		padding-left: 0;
		margin-bottom: 20px;
	}

	.lpcw-timeline-end-wrapper {
		margin-top: 20px;
	}
}

/* Very small screens */
@media (max-width: 480px) {
	.lpcw-timeline-card-title {
		font-size: 1.1rem;
	}

	.lpcw-timeline-card-desc {
		font-size: 0.92rem;
	}

	.lpcw-timeline-step-label {
		font-size: 14px;
		padding: 9px 16px;
	}
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
	.lpcw-timeline-line-progress,
	.lpcw-timeline-marker {
		transition: none;
	}
}
