/* Torres Timeline Static — línea estática (no depende del scroll).
 * Se dibuja una vez (y se redibuja en resize) a partir de la posición real
 * de cada marcador. Colores, tipografías, tamaños y espaciados se controlan
 * desde el propio widget de Elementor (pestaña Estilo).
 */

.ttx-timeline {
	position: relative;
	width: 100%;
	padding: 20px 0 40px;
	box-sizing: border-box;
	--ttx-marker-start: #E6007E;
	--ttx-marker-end: #FF7AB6;
	--ttx-marker-angle: 135deg;
	--ttx-line-width: 4px;
}

.ttx-timeline * {
	box-sizing: border-box;
}

/* --- Línea central: SVG cuya caja (top/left/width/height) coloca JS para
   envolver exactamente el camino entre el primer y el último marcador. --- */
.ttx-timeline__line-wrap {
	position: absolute;
	left: 50%;
	top: 0;
	width: 0;
	height: 0;
	z-index: 1;
	pointer-events: none;
	overflow: visible;
}

.ttx-timeline__svg {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	overflow: visible;
	display: block;
}

.ttx-timeline__path {
	fill: none;
	stroke-width: var(--ttx-line-width);
	stroke: #E6007E;
	stroke-linecap: round;
	stroke-linejoin: round;
	vector-effect: non-scaling-stroke;
}

.ttx-timeline__path-halo {
	stroke: rgba(0, 0, 0, 0.18);
	stroke-width: calc(var(--ttx-line-width) + 6px);
	display: none;
}

.ttx-timeline[data-line-halo="yes"] .ttx-timeline__path-halo {
	display: block;
}

/* --- Cada hito --- */
.ttx-item {
	position: relative;
	margin-bottom: 90px;
	min-height: 60px;
}

.ttx-item:last-child {
	margin-bottom: 0 !important;
}

/* --- Bloques de color por hito --- */
.ttx-item--has-bg {
	background-color: var(--ttx-item-bg);
}

.ttx-item--has-bg.ttx-item--bleed {
	background-color: transparent;
}

.ttx-item--has-bg.ttx-item--bleed::before {
	content: '';
	position: absolute;
	top: 0;
	bottom: 0;
	left: 50%;
	width: 100vw;
	transform: translateX(-50%);
	background-color: var(--ttx-item-bg);
	border-radius: inherit;
	z-index: -1;
}

/* --- Eje (contenedor del marcador): centrado en la línea, más el
   desplazamiento fijado en PHP para este hito en concreto (crea el
   efecto de zigzag/escalera). --- */
.ttx-item__axis {
	position: absolute;
	left: calc(50% + var(--ttx-offset, 0px));
	top: 50%;
	transform: translate(-50%, -50%);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 5;
}

/* --- Marcador --- */
.ttx-item__marker {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background-color: #FFFFFF;
	border: 2px solid #E6007E;
	color: #fff;
	line-height: 1;
	transition: transform 0.25s ease;
}

.ttx-item__dot {
	display: block;
	width: 45%;
	height: 45%;
	border-radius: 50%;
	background-color: #E6007E;
}

.ttx-timeline[data-hover-scale="yes"] .ttx-item__marker:hover {
	transform: scale(1.15);
}

/* --- Marcador estilo "esfera con degradado" (opcional) --- */
.ttx-timeline[data-marker-style="orb"] .ttx-item__marker {
	background-image: linear-gradient(var(--ttx-marker-angle), var(--ttx-marker-start), var(--ttx-marker-end));
	border: 0;
	color: #fff;
}

.ttx-timeline[data-marker-style="orb"] .ttx-item__dot {
	display: none;
}

/* --- Fila del hito: texto y (si existe) imagen en LADOS OPUESTOS de la
   línea, con el marcador en el centro. Los anchos de cada bloque se
   controlan por separado en "Bloque de texto" e "Imagen / Galería". --- */
.ttx-item__row {
	position: relative;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 40px;
	width: 100%;
}

.ttx-item__content {
	flex: 1 1 260px;
	max-width: 460px;
	min-width: 0;
}

.ttx-item__media {
	flex: 1 1 260px;
	max-width: 460px;
	min-width: 0;
}

/* Hitos sin imagen: el texto solo, alineado al lado que le corresponda. */
.ttx-item--text-only.ttx-item--left .ttx-item__row {
	justify-content: flex-start;
}

.ttx-item--text-only.ttx-item--right .ttx-item__row {
	justify-content: flex-end;
}

/* --- Galería de imágenes --- */
.ttx-item__gallery {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 16px;
}

.ttx-item__img {
	flex: 1 1 0;
	min-width: 80px;
	width: 100%;
	height: 220px;
	border-radius: 12px;
	object-fit: cover;
	display: block;
}

.ttx-item__gallery .ttx-item__img:only-child {
	flex: 1 1 100%;
}

/* --- Texto --- */
.ttx-item__date {
	display: block;
	font-weight: 800;
	line-height: 1;
	margin-bottom: 18px;
}

.ttx-item__title {
	margin: 0 0 12px;
}

.ttx-item__description {
	margin: 0;
	line-height: 1.6;
}

/* --- Animación de aparición (solo del contenido; la línea es siempre
   estática y visible desde el primer momento). --- */
.ttx-timeline.ttx-js-ready[data-animations="yes"] .ttx-item__content,
.ttx-timeline.ttx-js-ready[data-animations="yes"] .ttx-item__media {
	opacity: 0;
	transform: translateY(24px);
	transition: opacity 0.6s ease, transform 0.6s ease;
}

.ttx-timeline.ttx-js-ready[data-animations="yes"] .ttx-item--left .ttx-item__content,
.ttx-timeline.ttx-js-ready[data-animations="yes"] .ttx-item--right .ttx-item__media {
	transform: translateX(-24px) translateY(0);
}

.ttx-timeline.ttx-js-ready[data-animations="yes"] .ttx-item--right .ttx-item__content,
.ttx-timeline.ttx-js-ready[data-animations="yes"] .ttx-item--left .ttx-item__media {
	transform: translateX(24px) translateY(0);
}

.ttx-timeline.ttx-js-ready[data-animations="yes"] .ttx-item.is-inview .ttx-item__content,
.ttx-timeline.ttx-js-ready[data-animations="yes"] .ttx-item.is-inview .ttx-item__media {
	opacity: 1;
	transform: translate(0, 0);
}

/* Respetar preferencia de "reducir movimiento" del sistema operativo */
@media (prefers-reduced-motion: reduce) {
	.ttx-timeline.ttx-js-ready[data-animations="yes"] .ttx-item__content,
	.ttx-timeline.ttx-js-ready[data-animations="yes"] .ttx-item__media {
		transition: none !important;
		opacity: 1 !important;
		transform: none !important;
	}
	.ttx-timeline[data-hover-scale="yes"] .ttx-item__marker:hover {
		transform: none;
	}
}

/* --- Responsive: columna única, línea recta pegada a la izquierda --- */
@media (max-width: 900px) {
	.ttx-item {
		padding-left: 60px;
	}

	.ttx-item--has-bg {
		padding-left: 60px !important;
	}

	.ttx-item--has-bg.ttx-item--bleed::before {
		left: 0;
		width: 100%;
		transform: none;
	}

	.ttx-item__axis {
		left: 28px !important;
		top: 30px;
		transform: translate(-50%, -50%);
	}

	/* En móvil: fecha/título/descripción arriba, imagen debajo, siempre en
	   una sola columna (sin alternar lados ni ir en el lado contrario). */
	.ttx-item__row,
	.ttx-item--left .ttx-item__row,
	.ttx-item--right .ttx-item__row {
		flex-direction: column;
		justify-content: flex-start !important;
		align-items: stretch;
		gap: 20px;
	}

	.ttx-item__content,
	.ttx-item__media {
		flex: 1 1 auto !important;
		flex-basis: auto !important;
		width: 100% !important;
		max-width: 100% !important;
	}

	/* En móvil el texto va siempre primero y la imagen debajo,
	   independientemente de qué lado le tocara en escritorio. */
	.ttx-item__content {
		order: 1 !important;
	}

	.ttx-item__media {
		order: 2 !important;
	}
}
