/**
 * Construction Progress Timeline for Elementor
 * All visual values are driven by CSS variables so Elementor controls can override them.
 */

.cpte-timeline {
	--cpte-marker-size: 26px;
	--cpte-icon-size: 11px;
	--cpte-marker-border-width: 2px;
	--cpte-marker-gap: 16px;
	--cpte-item-spacing: 28px;
	--cpte-line-width: 2px;
	--cpte-line-style: solid;
	--cpte-line-gap: 4px;
	--cpte-reveal-delay: 120ms;

	box-sizing: border-box;
	position: relative;
	margin: 0;
	padding: 0;
}

.cpte-timeline *,
.cpte-timeline *::before,
.cpte-timeline *::after {
	box-sizing: border-box;
}

/* ---------- Header ---------- */
.cpte-timeline .cpte-header {
	margin: 0 0 22px;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	line-height: 1.3;
}

/* ---------- Items ---------- */
.cpte-timeline .cpte-items {
	display: flex;
	flex-direction: column;
}

.cpte-timeline .cpte-item {
	display: flex;
	flex-direction: row;
	align-items: stretch;
	gap: var(--cpte-marker-gap);
}

/* ---------- Marker column ---------- */
.cpte-timeline .cpte-marker-col {
	display: flex;
	flex-direction: column;
	align-items: center;
	flex: 0 0 auto;
	width: var(--cpte-marker-size);
}

.cpte-timeline .cpte-marker {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: var(--cpte-marker-size);
	height: var(--cpte-marker-size);
	border-radius: 50%;
	border: var(--cpte-marker-border-width) solid currentColor;
	font-size: var(--cpte-icon-size);
	line-height: 1;
	transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}

.cpte-timeline .cpte-marker i,
.cpte-timeline .cpte-marker svg {
	font-size: inherit;
	width: 1em;
	height: 1em;
	display: block;
}

.cpte-timeline .cpte-marker svg {
	fill: currentColor;
}

.cpte-timeline .cpte-marker-number {
	font-size: calc(var(--cpte-marker-size) * 0.42);
	font-weight: 600;
	line-height: 1;
}

/* ---------- Connector line ---------- */
.cpte-timeline .cpte-line {
	flex: 1 1 auto;
	width: 0;
	min-height: 16px;
	margin: var(--cpte-line-gap) 0;
	border-left: var(--cpte-line-width) var(--cpte-line-style) currentColor;
}

/* ---------- Content ---------- */
.cpte-timeline .cpte-content {
	flex: 1 1 auto;
	min-width: 0;
	padding: 0;
}

.cpte-timeline .cpte-item:not(:last-child) .cpte-content {
	padding-bottom: var(--cpte-item-spacing);
}

.cpte-timeline .cpte-label,
.cpte-timeline .cpte-title,
.cpte-timeline .cpte-meta {
	display: block;
}

.cpte-timeline .cpte-label {
	font-size: 14px;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	line-height: 1.3;
	margin-bottom: 3px;
}

.cpte-timeline .cpte-title {
	font-size: 13px;
	font-weight: 500;
	line-height: 1.4;
	margin-bottom: 4px;
}

.cpte-timeline .cpte-meta {
	font-size: 12px;
	line-height: 1.5;
}

.cpte-timeline .cpte-link {
	display: block;
	color: inherit;
	text-decoration: none;
}

.cpte-timeline .cpte-link:hover .cpte-title {
	text-decoration: underline;
}

.cpte-timeline .cpte-link:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
}

/* ---------- Completion box ---------- */
.cpte-timeline .cpte-completion {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	margin-top: 12px;
}

.cpte-timeline .cpte-completion-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 22px;
	line-height: 1;
}

.cpte-timeline .cpte-completion-icon svg {
	width: 1em;
	height: 1em;
	fill: currentColor;
}

.cpte-timeline .cpte-completion-text {
	display: flex;
	flex-direction: column;
	line-height: 1.25;
}

.cpte-timeline .cpte-completion-label {
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.cpte-timeline .cpte-completion-value {
	font-size: 16px;
	font-weight: 700;
}

/* =========================================================
   VERTICAL — marker side
   ======================================================= */
.cpte-vpos-right .cpte-item {
	flex-direction: row-reverse;
}

/* =========================================================
   HORIZONTAL — all stages in one row.
   Each stage is its own column: the marker sits in its own
   .cpte-marker-col div, the text block sits under (or over) it.
   ======================================================= */
.cpte-layout-horizontal .cpte-items {
	flex-direction: row;
	align-items: flex-start;
	gap: var(--cpte-item-spacing);
}

.cpte-layout-horizontal .cpte-item {
	flex: 1 1 0;
	min-width: 0;
	flex-direction: column;
	align-items: stretch;
}

.cpte-layout-horizontal.cpte-hpos-bottom .cpte-item {
	flex-direction: column-reverse;
}

/* Marker row: its own div, marker centred inside the column. */
.cpte-layout-horizontal .cpte-marker-col {
	position: relative;
	flex-direction: row;
	justify-content: center;
	width: 100%;
	height: var(--cpte-marker-size);
}

/* Connector runs from this marker to the next one. */
.cpte-layout-horizontal .cpte-line {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	left: calc(50% + (var(--cpte-marker-size) / 2) + var(--cpte-line-gap));
	right: calc(-50% - var(--cpte-item-spacing) + (var(--cpte-marker-size) / 2) + var(--cpte-line-gap));
	width: auto;
	height: 0;
	min-height: 0;
	margin: 0;
	border-left: 0;
	border-top: var(--cpte-line-width) var(--cpte-line-style) currentColor;
}

.cpte-layout-horizontal .cpte-content {
	text-align: center;
}

.cpte-layout-horizontal .cpte-item:not(:last-child) .cpte-content {
	padding-bottom: 0;
}

/* Optional: fixed column width + scrolling row. */
.cpte-layout-horizontal.cpte-hscroll-yes .cpte-items {
	overflow-x: auto;
	overflow-y: hidden;
	padding-bottom: 8px;
	scrollbar-width: thin;
	-webkit-overflow-scrolling: touch;
}

.cpte-layout-horizontal.cpte-hscroll-yes .cpte-item {
	flex: 0 0 var(--cpte-col-width, 180px);
	min-width: var(--cpte-col-width, 180px);
}

/* =========================================================
   HORIZONTAL -> VERTICAL fallback on smaller screens
   ======================================================= */
@media (max-width: 1024px) {
	.cpte-layout-horizontal.cpte-stack-tablet .cpte-items {
		flex-direction: column;
		gap: 0;
		overflow: visible;
		padding-bottom: 0;
	}

	.cpte-layout-horizontal.cpte-stack-tablet .cpte-item,
	.cpte-layout-horizontal.cpte-stack-tablet.cpte-hpos-bottom .cpte-item {
		flex: 0 1 auto;
		min-width: 0;
		flex-direction: row;
		align-items: stretch;
	}

	.cpte-layout-horizontal.cpte-stack-tablet .cpte-marker-col {
		position: static;
		flex-direction: column;
		justify-content: flex-start;
		width: var(--cpte-marker-size);
		height: auto;
	}

	.cpte-layout-horizontal.cpte-stack-tablet .cpte-line {
		position: static;
		transform: none;
		flex: 1 1 auto;
		width: 0;
		height: auto;
		min-height: 16px;
		margin: var(--cpte-line-gap) 0;
		border-top: 0;
		border-left: var(--cpte-line-width) var(--cpte-line-style) currentColor;
	}

	.cpte-layout-horizontal.cpte-stack-tablet :where(.cpte-content) {
		text-align: start;
	}

	.cpte-layout-horizontal.cpte-stack-tablet .cpte-item:not(:last-child) .cpte-content {
		padding-bottom: var(--cpte-item-spacing);
	}
}

@media (max-width: 767px) {
	.cpte-layout-horizontal.cpte-stack-mobile .cpte-items {
		flex-direction: column;
		gap: 0;
		overflow: visible;
		padding-bottom: 0;
	}

	.cpte-layout-horizontal.cpte-stack-mobile .cpte-item,
	.cpte-layout-horizontal.cpte-stack-mobile.cpte-hpos-bottom .cpte-item {
		flex: 0 1 auto;
		min-width: 0;
		flex-direction: row;
		align-items: stretch;
	}

	.cpte-layout-horizontal.cpte-stack-mobile .cpte-marker-col {
		position: static;
		flex-direction: column;
		justify-content: flex-start;
		width: var(--cpte-marker-size);
		height: auto;
	}

	.cpte-layout-horizontal.cpte-stack-mobile .cpte-line {
		position: static;
		transform: none;
		flex: 1 1 auto;
		width: 0;
		height: auto;
		min-height: 16px;
		margin: var(--cpte-line-gap) 0;
		border-top: 0;
		border-left: var(--cpte-line-width) var(--cpte-line-style) currentColor;
	}

	.cpte-layout-horizontal.cpte-stack-mobile :where(.cpte-content) {
		text-align: start;
	}

	.cpte-layout-horizontal.cpte-stack-mobile .cpte-item:not(:last-child) .cpte-content {
		padding-bottom: var(--cpte-item-spacing);
	}
}

/* ---------- Active pulse ---------- */
.cpte-pulse-yes .cpte-item.cpte-status-active .cpte-marker::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 100%;
	height: 100%;
	transform: translate(-50%, -50%);
	border-radius: inherit;
	border: 2px solid currentColor;
	opacity: 0;
	pointer-events: none;
	animation: cpte-pulse 2s ease-out infinite;
}

@keyframes cpte-pulse {
	0% {
		opacity: 0.55;
		transform: translate(-50%, -50%) scale(1);
	}
	70% {
		opacity: 0;
		transform: translate(-50%, -50%) scale(1.9);
	}
	100% {
		opacity: 0;
		transform: translate(-50%, -50%) scale(1.9);
	}
}

/* ---------- Reveal on scroll ---------- */
.cpte-reveal-yes .cpte-timeline.cpte-has-js .cpte-item {
	opacity: 0;
	transform: translateY(14px);
	transition: opacity 0.5s ease, transform 0.5s ease;
	transition-delay: calc(var(--cpte-reveal-index, 1) * var(--cpte-reveal-delay));
}

.cpte-reveal-yes .cpte-timeline.cpte-has-js.cpte-visible .cpte-item {
	opacity: 1;
	transform: none;
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
	.cpte-pulse-yes .cpte-item.cpte-status-active .cpte-marker::after {
		animation: none;
	}

	.cpte-reveal-yes .cpte-timeline.cpte-has-js .cpte-item {
		opacity: 1;
		transform: none;
		transition: none;
	}
}
