/* ==========================================================
   Custom Timeline Widget - Estilos de Frontend
   ========================================================== */

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

/* ---------- Linha principal ---------- */
.ctw-timeline .ctw-line {
	position: absolute;
	background-color: #d6d6d6;
}

.ctw-timeline.ctw-layout-zigzag .ctw-line,
.ctw-timeline.ctw-layout-left .ctw-line,
.ctw-timeline.ctw-layout-right .ctw-line {
	top: 0;
	bottom: 0;
	left: 50%;
	transform: translateX(-50%);
}

.ctw-timeline.ctw-layout-left .ctw-line,
.ctw-timeline.ctw-layout-right .ctw-line {
	left: 30px;
	transform: none;
}

.ctw-timeline.ctw-layout-horizontal .ctw-line {
	top: var( --ctw-axis-top );
	left: 0;
	right: 0;
	transform: none;
	z-index: 1;
}

/* ---------- Lista de itens (vertical) ---------- */
.ctw-timeline .ctw-items {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 40px;
}

.ctw-timeline .ctw-item {
	position: relative;
	width: 50%;
}

.ctw-timeline.ctw-layout-zigzag .ctw-item.ctw-side-a {
	left: 0;
	padding-right: 40px;
	text-align: right;
}

.ctw-timeline.ctw-layout-zigzag .ctw-item.ctw-side-b {
	left: 50%;
	padding-left: 40px;
	text-align: left;
}

.ctw-timeline.ctw-layout-left .ctw-item,
.ctw-timeline.ctw-layout-right .ctw-item {
	width: 100%;
	padding-left: 70px;
}

/* ---------- Marcador / ícone ---------- */
.ctw-marker {
	position: absolute;
	top: 0;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background-color: #ffffff;
	border: 2px solid #605be5;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 16px;
	z-index: 2;
}

.ctw-timeline.ctw-layout-zigzag .ctw-item.ctw-side-a .ctw-marker {
	right: -22px;
}

.ctw-timeline.ctw-layout-zigzag .ctw-item.ctw-side-b .ctw-marker {
	left: -22px;
}

.ctw-timeline.ctw-layout-left .ctw-marker,
.ctw-timeline.ctw-layout-right .ctw-marker {
	left: 8px;
}

/* ---------- Carrossel horizontal: eixo Data > Linha/Ícone > Card ----------
   As variáveis abaixo são a única fonte de verdade para o alinhamento:
   a linha e as setas usam --ctw-axis-top para ficar exatamente no centro
   do marcador, que por sua vez fica logo abaixo da data. */
.ctw-timeline.ctw-layout-horizontal {
	--ctw-date-height: 20px;
	--ctw-date-gap: 10px;
	--ctw-marker-size: 44px;
	--ctw-axis-top: calc( var( --ctw-date-height ) + var( --ctw-date-gap ) + ( var( --ctw-marker-size ) / 2 ) );
}

.ctw-timeline.ctw-layout-horizontal .ctw-marker {
	position: relative;
	width: var( --ctw-marker-size );
	height: var( --ctw-marker-size );
	margin: 0 auto;
}

/* Wrapper que agrupa a Data + o Ícone, centralizados entre si */
.ctw-timeline.ctw-layout-horizontal .ctw-date-marker {
	display: flex;
	flex-direction: column;
	align-items: center;
	position: relative;
	z-index: 2;
}

.ctw-timeline.ctw-layout-horizontal .ctw-date {
	height: var( --ctw-date-height );
	line-height: var( --ctw-date-height );
	margin: 0 0 var( --ctw-date-gap );
	text-align: center;
	white-space: nowrap;
}

/* ---------- Card ---------- */
.ctw-card {
	background-color: #ffffff;
	border-radius: 8px;
	padding: 20px;
	box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
}

.ctw-item-link {
	text-decoration: none;
	color: inherit;
	display: block;
}

.ctw-date {
	font-size: 13px;
	font-weight: 600;
	color: #605be5;
	margin-bottom: 6px;
	display: block;
}

.ctw-title {
	font-size: 18px;
	margin: 0 0 8px;
	color: #222222;
}

.ctw-description {
	font-size: 14px;
	line-height: 1.6;
	color: #666666;
	margin: 0;
}

.ctw-image {
	margin-bottom: 12px;
}

.ctw-image img {
	width: 100%;
	height: auto;
	border-radius: 6px;
	display: block;
}

/* ---------- Carrossel horizontal ---------- */
.ctw-timeline.ctw-layout-horizontal {
	padding: 0 45px;
}

.ctw-timeline.ctw-layout-horizontal .ctw-swiper {
	overflow: hidden;
	padding: 0 0 40px;
}

.ctw-timeline.ctw-layout-horizontal .swiper-slide {
	display: flex;
	flex-direction: column;
	align-items: center;
	height: auto;
	text-align: center;
}

.ctw-timeline.ctw-layout-horizontal .ctw-card {
	margin-top: 24px;
	width: 100%;
	flex-grow: 1;
	display: flex;
	flex-direction: column;
}

.ctw-nav {
	position: absolute;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background-color: #ffffff;
	border: 1px solid #e8e8e8;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	z-index: 4;
	transition: background-color 0.2s ease;
}

/* As setas ficam no mesmo eixo vertical da linha/ícones (--ctw-axis-top)
   e "flutuam" sobre a borda do carrossel, sobrepostas à linha. */
.ctw-timeline.ctw-layout-horizontal .ctw-nav {
	top: var( --ctw-axis-top );
	transform: translateY(-50%);
}

.ctw-nav:hover {
	background-color: #605be5;
	color: #ffffff;
}

.ctw-nav-prev {
	left: -20px;
}

.ctw-nav-next {
	right: -20px;
}

/* ---------- Responsivo ---------- */
@media (max-width: 767px) {
	.ctw-timeline.ctw-layout-zigzag .ctw-line {
		left: 30px;
		transform: none;
	}

	.ctw-timeline.ctw-layout-zigzag .ctw-item,
	.ctw-timeline.ctw-layout-zigzag .ctw-item.ctw-side-a,
	.ctw-timeline.ctw-layout-zigzag .ctw-item.ctw-side-b {
		width: 100%;
		left: 0;
		padding-left: 70px;
		padding-right: 0;
		text-align: left;
	}

	.ctw-timeline.ctw-layout-zigzag .ctw-item.ctw-side-a .ctw-marker,
	.ctw-timeline.ctw-layout-zigzag .ctw-item.ctw-side-b .ctw-marker {
		left: 8px;
		right: auto;
	}
}
