/* Raiz */
.tem-timeline {
  --tem-line-color: #2c2c2c;
  --tem-line-width: 3px;
  --tem-vertical-gap: 48px;
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Cada linha da timeline */
.tem-timeline__row {
  display: grid;
  grid-template-columns: 1fr 1fr; /* esquerda | direita */
  align-items: start;
  margin: 0;
  gap: 0; /* espaço entre colunas */
}


/* Card */
.tem-timeline__card {
  position: relative;
  display: flex;
}
/* Card à esquerda */
.tem-timeline__card--left {
  grid-column: 1 / 2;
  justify-self: end;
  text-align: right;
  margin-right: 50px;
}

/* Card à direita */
.tem-timeline__card--right {
  grid-column: 2 / 4;
  justify-self: start;
  text-align: left;
  margin-left: 50px;
}
.tem-timeline__inner.right:before {
  content: "";
  height: 40px;
  width: 40px;
  display: block;
  background: #e22228;
  position: absolute;
  top: 20px;
  left: -40px;
  border-radius: 50px;
}
.tem-timeline__inner.left:after {
  content: "";
  height: 40px;
  width: 40px;
  display: block;
  background: #01456e;
  position: absolute;
  top: 20px;
  right: -40px;
  border-radius: 50px;
  z-index: 1;
}

.tem-timeline__card.has-line-left::before {
  content: "";
  display: block;
  width: 120px; /* largura da linha */
  height: 100%;
  background-image: var(--line-image);
  background-repeat: repeat-y;
  background-position: center;
  position: absolute;
  top: 0;
  left: -110px;
}


/* Se o card estiver à esquerda, a linha aparece à direita */
.tem-timeline__card--left.has-line-right::after {
  content: "";
  display: block;
  width: 120px;
  height: 100%;
  background-image: var(--line-image);
  background-repeat: repeat-y;
  background-position: center;
  margin-left: 20px;
  position: absolute;
  right: -110px;
  top: 0;
}


/* Conteúdo interno do card */
.tem-timeline__media {
  max-width: 40%;
}
.tem-timeline__media img {
  width: 100%;
  height: auto;
  display: block;
  margin-bottom: 12px;
  border-radius: 8px;
}
.tem-timeline__title {
  margin: 0 0 6px;
  font-size: 20px;
  line-height: 1.3;
}
.tem-timeline__subtitle {
  margin: 0 0 8px;
  font-size: 16px;
  color: #555;
}
.tem-timeline__desc {
  margin: 0;
  font-size: 15px;
  color: #333;
}

.tem-timeline__cart {
  position: sticky;         /* gruda ao rolar dentro da stack */
  top: 100px;                /* distância do topo da stack */
  margin: 0 auto;           /* centraliza horizontalmente */
  display: block;
  width: 100px;
  text-align: center;
  height: 0;
  pointer-events: none;
}
.tem-timeline__cart img {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  height: auto;
  display: block;
}










/* Grupo da timeline */
.tem-timeline__group {
  position: relative;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0;
  background-repeat: repeat-y;   /* repete verticalmente */
  background-position: center;   /* centraliza no meio */
  background-size: auto 50px;   /* ajusta altura dos segmentos */
}



/* Estrutura interna do card: imagem principal + conteúdo */
.tem-timeline__inner {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}
.tem-timeline__inner.left {
  flex-direction: row-reverse;
} 
.tem-timeline__inner.right {
  flex-direction: row;
}




.tem-timeline__card {
  opacity: 0;
  transform: translateY(60px); /* deslocado para baixo */
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.tem-timeline__card.is-visible {
  opacity: 1;
  transform: translateY(0);
}


/* Responsivo */
@media (max-width: 920px) {
  .tem-timeline__row {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .tem-timeline__card--left,
  .tem-timeline__card--right {
    grid-column: 1 / -1;
    justify-self: center;
  }
  .tem-timeline__cart {
    position: relative; /* em mobile não precisa sticky */
    top: auto;
    margin-bottom: 20px;
  }
}
