/**
 * Add-on Papoca - Estilos do widget "Timeline Papoca".
 *
 * Prefixo de classe: papoca-timeline
 * No desktop a linha do tempo e horizontal e alterna ano/conteudo.
 * No mobile (<= 767px) ela empilha na vertical.
 */

.papoca-timeline {
	/* Variaveis controladas tambem pelos controles do Elementor. */
	--papoca-line-color: rgba(255, 255, 255, 0.35);
	--papoca-line-thickness: 2px;
	position: relative;
	padding: 60px 24px;
}

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

/* ---------- Cabecalho ---------- */
.papoca-timeline__heading-wrap {
	margin-bottom: 70px;
	text-align: center;
}

.papoca-timeline__heading {
	position: relative;
	display: inline-block;
	margin: 0;
	padding-bottom: 14px;
	color: #ffffff;
	font-size: 38px;
	font-weight: 700;
	line-height: 1.2;
}

.papoca-timeline__heading::after {
	content: "";
	position: absolute;
	left: 50%;
	bottom: 0;
	width: 64px;
	height: 3px;
	background-color: #1aa5b8;
	transform: translateX(-50%);
}

/* ---------- Trilha ---------- */
/* Grade de 3 linhas (topo / no / base) compartilhada por todos os
   marcos via subgrid. Garante que a linha e os pontos fiquem num
   eixo unico, independentemente da altura do texto de cada marco. */
.papoca-timeline__track {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: 1fr;
	grid-template-rows: auto auto auto;
	width: 100%;
}

.papoca-timeline__item {
	min-width: 0;
	display: grid;
	grid-row: span 3;
	grid-template-rows: subgrid;
}

/* ---------- Slots (metade superior / inferior) ---------- */
.papoca-timeline__slot {
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 0 14px;
}

.papoca-timeline__slot--top {
	justify-content: flex-end;
}

.papoca-timeline__slot--bottom {
	justify-content: flex-start;
}

/* ---------- No central e linha ---------- */
.papoca-timeline__node {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	height: 44px;
}

.papoca-timeline__node::before {
	content: "";
	position: absolute;
	top: 50%;
	left: 0;
	right: 0;
	height: var(--papoca-line-thickness);
	background-color: var(--papoca-line-color);
	transform: translateY(-50%);
}

/* A linha comeca no primeiro ponto e termina no ultimo. */
.papoca-timeline__item:first-child .papoca-timeline__node::before {
	left: 50%;
}

.papoca-timeline__item:last-child .papoca-timeline__node::before {
	right: 50%;
}

/* ---------- Ponto ---------- */
.papoca-timeline__dot {
	position: relative;
	z-index: 2;
	width: 16px;
	height: 16px;
	border: 3px solid #ffffff;
	border-radius: 50%;
	background-color: #ffffff;
}

.papoca-timeline__dot--highlight {
	border-color: #1aa5b8;
	background-color: #1aa5b8;
}

/* ---------- Ponto com icone ou imagem ---------- */
.papoca-timeline__dot--has-marker {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 46px;
	height: 46px;
	overflow: hidden;
}

.papoca-timeline__dot-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	color: #ffffff;
	font-size: 20px;
	line-height: 1;
}

.papoca-timeline__dot-icon svg {
	width: 20px;
	height: 20px;
	fill: currentColor;
}

.papoca-timeline__dot-img {
	width: 100%;
	height: 100%;
	border-radius: 50%;
	object-fit: cover;
}

/* ---------- Layout "Passo a passo": icone + titulo do icone ---------- */
.papoca-timeline__step-head {
	display: flex;
	flex-direction: column;
	align-items: center;
	margin-bottom: 22px;
}

.papoca-timeline__step-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	color: #1aa5b8;
	font-size: 48px;
	line-height: 1;
}

.papoca-timeline__step-icon svg {
	width: 48px;
	height: 48px;
	fill: currentColor;
}

.papoca-timeline__step-icon img {
	width: 48px;
	height: 48px;
	object-fit: contain;
}

.papoca-timeline__step-label {
	margin-top: 12px;
	color: #ffffff;
	font-size: 15px;
	font-weight: 600;
	text-align: center;
}

/* ---------- Ano ---------- */
.papoca-timeline__year {
	color: #2e7d99;
	font-size: 74px;
	font-weight: 700;
	line-height: 1;
	text-align: center;
}

.papoca-timeline__slot--top .papoca-timeline__year {
	margin-bottom: 20px;
}

.papoca-timeline__slot--bottom .papoca-timeline__year {
	margin-top: 20px;
}

/* ---------- Conteudo (titulo + descricao) ---------- */
.papoca-timeline__content {
	max-width: 260px;
	text-align: center;
}

.papoca-timeline__slot--top .papoca-timeline__content {
	margin-bottom: 20px;
}

.papoca-timeline__slot--bottom .papoca-timeline__content {
	margin-top: 20px;
}

.papoca-timeline__item-title {
	margin: 0 0 8px;
	color: #ffffff;
	font-size: 17px;
	font-weight: 700;
	line-height: 1.3;
}

.papoca-timeline__item-desc {
	margin: 0;
	color: rgba(255, 255, 255, 0.75);
	font-size: 14px;
	line-height: 1.6;
}

/* =========================================================
 * ANIMACAO DE ENTRADA (ativada pela classe --animated via JS/PHP)
 * ========================================================= */
.papoca-timeline--animated .papoca-timeline__item {
	opacity: 0;
	transform: translateY(28px);
	transition-property: opacity, transform;
	transition-duration: var(--papoca-anim-duration, 600ms);
	transition-timing-function: ease;
	will-change: opacity, transform;
}

.papoca-timeline--animated .papoca-timeline__item.is-visible {
	opacity: 1;
	transform: translateY(0);
}

/* Respeita "movimento reduzido": mostra tudo sem animar. */
@media (prefers-reduced-motion: reduce) {
	.papoca-timeline--animated .papoca-timeline__item {
		opacity: 1;
		transform: none;
		transition: none;
	}
}

/* =========================================================
 * RESPONSIVO - empilha na vertical no mobile
 * ========================================================= */
@media (max-width: 767px) {

	.papoca-timeline {
		padding: 40px 20px;
	}

	.papoca-timeline__heading-wrap {
		margin-bottom: 40px;
	}

	.papoca-timeline__heading {
		font-size: 28px;
	}

	.papoca-timeline__track {
		display: flex;
		flex-direction: column;
	}

	/* Cada marco vira uma grade: rail (no) a esquerda, textos a direita. */
	.papoca-timeline__item {
		display: grid;
		grid-row: auto;
		grid-template-columns: minmax(44px, max-content) 1fr;
		grid-template-rows: auto auto;
		grid-template-areas:
			"node top"
			"node bottom";
	}

	.papoca-timeline__node {
		grid-area: node;
		min-width: 44px;
		width: auto;
		height: auto;
		align-items: flex-start;
		padding-top: 4px;
	}

	.papoca-timeline__node::before {
		top: 0;
		bottom: 0;
		left: 50%;
		right: auto;
		width: var(--papoca-line-thickness);
		height: auto;
		transform: translateX(-50%);
	}

	.papoca-timeline__item:first-child .papoca-timeline__node::before {
		top: 12px;
		left: 50%;
	}

	.papoca-timeline__item:last-child .papoca-timeline__node::before {
		top: 0;
		bottom: auto;
		height: 12px;
	}

	.papoca-timeline__slot {
		align-items: flex-start;
		padding: 0 0 8px 14px;
	}

	.papoca-timeline__slot--top {
		grid-area: top;
		justify-content: flex-start;
	}

	.papoca-timeline__slot--bottom {
		grid-area: bottom;
		justify-content: flex-start;
		padding-bottom: 32px;
	}

	/* Inverte a ordem dos slots nos marcos com ano embaixo para que o ano sempre fique no topo e a descrição embaixo no mobile. */
	.papoca-timeline__item--year-bottom .papoca-timeline__slot--top {
		grid-area: bottom;
		padding-bottom: 32px;
	}

	.papoca-timeline__item--year-bottom .papoca-timeline__slot--bottom {
		grid-area: top;
		padding-bottom: 8px;
	}

	.papoca-timeline__year {
		font-size: 44px;
		text-align: left;
	}

	.papoca-timeline__content {
		max-width: none;
		text-align: left;
	}

	/* Passo a passo: alinha icone e titulo a esquerda no mobile. */
	.papoca-timeline__step-head {
		align-items: flex-start;
	}

	.papoca-timeline__step-label {
		text-align: left;
	}

	/* No mobile o espacamento vertical e uniforme. */
	.papoca-timeline__slot--top .papoca-timeline__year,
	.papoca-timeline__slot--top .papoca-timeline__content,
	.papoca-timeline__slot--bottom .papoca-timeline__year,
	.papoca-timeline__slot--bottom .papoca-timeline__content {
		margin: 0 0 4px;
	}
}
