/**
 * CPT Timeline Lavori 2.1.0 — layout strutturale.
 * Colori, dimensioni e tipografia si regolano dal widget in Elementor.
 */

.cpt-timeline-wrapper {
	position: relative;
	overflow: hidden;
}

.cpt-timeline-list {
	list-style: none;
	padding: 0;
	margin: 0;
	width: 100%;
}

.cpt-timeline-line-container {
	position: absolute;
	left: 50%;
	transform: translateX(-50%);
	width: 4px;
	z-index: 1;
}

.cpt-timeline-line-bg {
	position: absolute;
	inset: 0;
	background-color: #e0e0e0;
}

.cpt-timeline-line-progress {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 0%;
	background-color: #0073aa;
}

.cpt-timeline-item {
	position: relative;
	width: 100%;
	margin-bottom: 80px;
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 60px;
}

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

.cpt-timeline-item:nth-child(odd) {
	flex-direction: row;
}

.cpt-timeline-item:nth-child(even) {
	flex-direction: row-reverse;
}

.cpt-timeline-card {
	width: 42%;
	background-color: #ffffff;
	border-radius: 12px;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
	overflow: hidden;
	z-index: 3;
}

.cpt-timeline-date {
	width: 42%;
	font-weight: 700;
	color: #999;
	transition: color 0.35s cubic-bezier(0.25, 1, 0.5, 1);
}

.cpt-timeline-item:nth-child(odd) .cpt-timeline-date {
	text-align: left;
}

.cpt-timeline-item:nth-child(even) .cpt-timeline-date {
	text-align: right;
}

.cpt-timeline-dot {
	position: absolute;
	left: 50%;
	top: 30px;
	width: 24px;
	height: 24px;
	background: #fff;
	border: 4px solid #e0e0e0;
	border-radius: 50%;
	transform: translateX(-50%);
	z-index: 4;
	transition: border-color 0.35s cubic-bezier(0.25, 1, 0.5, 1);
}

.cpt-timeline-media {
	width: 100%;
}

.cpt-timeline-media img,
.cpt-timeline-media iframe {
	width: 100%;
	height: auto;
	display: block;
	object-fit: cover;
	aspect-ratio: 16/9;
	border: 0;
}

/* Video: anteprima cliccabile, l'iframe nasce solo al clic. */
.cpt-timeline-video-container {
	position: relative;
	width: 100%;
	background: #000;
}

.cpt-timeline-video-placeholder {
	position: relative;
	display: block;
	width: 100%;
	aspect-ratio: 16/9;
	overflow: hidden;
	background: #1d2327;
	color: #fff;
	text-decoration: none;
	cursor: pointer;
}

.cpt-timeline-video-placeholder img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	aspect-ratio: auto;
	opacity: 0.85;
	transition: opacity 0.2s ease;
}

.cpt-timeline-video-placeholder:hover img,
.cpt-timeline-video-placeholder:focus-visible img {
	opacity: 0.65;
}

.cpt-timeline-video-placeholder:focus-visible {
	outline: 3px solid #0073aa;
	outline-offset: -3px;
}

.cpt-timeline-play {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 68px;
	height: 48px;
	transform: translate(-50%, -50%);
	line-height: 0;
}

.cpt-timeline-play-bg {
	fill: #212121;
	fill-opacity: 0.85;
	transition: fill 0.2s ease, fill-opacity 0.2s ease;
}

.cpt-timeline-video-placeholder:hover .cpt-timeline-play-bg,
.cpt-timeline-video-placeholder:focus-visible .cpt-timeline-play-bg {
	fill: #f00;
	fill-opacity: 1;
}

.cpt-timeline-video-note {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	padding: 24px 14px 10px;
	font-size: 0.75rem;
	line-height: 1.3;
	text-align: left;
	color: #fff;
	background: linear-gradient(transparent, rgba(0, 0, 0, 0.75));
}

.cpt-timeline-content {
	padding: 25px;
}

.cpt-timeline-title {
	margin: 0 0 10px;
	font-size: 1.4rem;
	font-weight: 700;
	color: #333;
}

.cpt-timeline-desc {
	margin: 0;
	font-size: 0.95rem;
	color: #666;
	line-height: 1.6;
}

.cpt-timeline-desc > :last-child {
	margin-bottom: 0;
}

.cpt-timeline-item.is-active .cpt-timeline-dot {
	border-color: #0073aa;
}

.cpt-timeline-item.is-active .cpt-timeline-date {
	color: #0073aa;
}

/* Box mostrato solo nell'editor quando non ci sono step. */
.cpt-timeline-placeholder-box {
	padding: 40px;
	background: #f6f7f7;
	border: 2px dashed #c3c4c7;
	border-radius: 12px;
	text-align: center;
	color: #50575e;
	margin: 30px 0;
}

.cpt-timeline-placeholder-box h4 {
	margin: 0 0 10px 0;
	color: #1d2327;
	font-size: 1.4rem;
	font-weight: 700;
}

.cpt-timeline-placeholder-box p {
	margin: 0;
	font-size: 0.95rem;
	line-height: 1.5;
}

@media (max-width: 768px) {
	.cpt-timeline-line-container,
	.cpt-timeline-dot {
		left: 24px;
	}

	.cpt-timeline-item {
		flex-direction: column !important;
		align-items: flex-start;
		padding-left: 60px;
		gap: 15px;
	}

	.cpt-timeline-card,
	.cpt-timeline-date {
		width: 100% !important;
		text-align: left !important;
	}

	.cpt-timeline-date {
		order: -1;
		margin-top: 10px;
		font-size: 1.1rem;
	}

	.cpt-timeline-date:empty {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.cpt-timeline-date,
	.cpt-timeline-dot,
	.cpt-timeline-video-placeholder img,
	.cpt-timeline-play-bg {
		transition: none;
	}
}
