:root {
  --corAzulPrincipal: #2f3559;
  --corBrancoPrincipal: #fffaf6;
}

main {
  padding-top: 9rem;
}
.header {
  position: initial;
  top: 0;
  left: 0;
  width: 100%;
  padding: 1rem 18%;
  backdrop-filter: blur(10px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 9999;
  background-color: #ffffffa4;
}

.section-okan-ilu {
  height: 330px;
  display: flex;
  background-color: var(--corAzulPrincipal);
}

.section-okan-ilu #img-okan-ilu {
  margin: 47px 20px 0px 0px;
  padding-top: 8px;
  width: 26rem;
}

.section-okan-ilu #img-okan-ilu img {
  width: 28rem;
  height: auto;
  display: none;
}

.section-okan-ilu #informacoes-okan-ilu {
  display: flex;
  flex-direction: column;
  font-size: 12px;
  color: var(--corBrancoPrincipal);
  text-align: justify;
  margin: 20px 20px 0px 0px;
}

.section-okan-ilu #informacoes-okan-ilu img {
  align-self: center;
  margin: 30px 0px 10px 0px;
  width: 22rem;
  height: auto;
}

.timeline-wrapper {
  width: 90%;
  max-width: 1000px;
  margin: 40px auto;
  text-align: center;
}

.timeline-wrapper h2 {
  font-family: "Katibeh", serif;
  text-transform: uppercase;
  color: #2f3559;
  font-size: 64px;
  font-weight: 400;
  margin-bottom: 24px;
  line-height: 1.2;
  margin: 0 auto 20px auto;
  padding-bottom: 12px;
  position: relative;
}

.timeline-wrapper h2::after {
  content: "";
  display: block;
  width: 35%;
  height: 6px;
  background: #2f3559;
  border-radius: 2px;
  margin: auto;
}

.timeline {
  display: flex;
  flex-direction: column;
  position: relative;
  width: 100%;
}

/*Itens da Linha do Tempo */

.timeline-item {
  display: flex;
  position: relative;
  margin-bottom: 30px;
  width: 100%;
  padding-left: 45px; /* Espaço para a linha na esquerda */
  box-sizing: border-box; /* Garante que o padding não estoure a tela */
}

.timeline-card {
  display: flex;
  flex-direction: column;
  padding: 15px;
  border-radius: 8px;
  width: 100%; /* Largura total no celular */
  box-sizing: border-box;
  text-align: left;
  position: relative;
  z-index: 10;
}

.timeline-card h3 {
  font-size: 3rem; /* Um pouco menor no celular para não quebrar */
  margin-top: 0;
  margin-bottom: 10px;
}
.timeline-card p {
  text-align: justify;
  font-size: 1.1rem;
  line-height: 1.4;
  margin-bottom: 15px;
}
.timeline-card button {
  width: 100%; /* Botão full width no celular fica melhor */
  max-width: 10rem;
  height: 30px; /* Um pouco mais alto para toque */
  align-self: center;
  border-radius: 7px;
  cursor: pointer;
  font-weight: bold;
  font-size: 0.9rem;
}
.card-dark {
  background-color: var(--corAzulPrincipal);
  color: var(--corBrancoPrincipal);
}

.card-dark button {
  background-color: var(--corBrancoPrincipal);
  color: var(--corAzulPrincipal);
}

.card-light {
  background-color: var(--corBrancoPrincipal);
  color: var(--corAzulPrincipal);
  border: 2px solid var(--corAzulPrincipal);
}

.card-light button {
  background-color: var(--corAzulPrincipal);
  color: var(--corBrancoPrincipal);
}

/* Itens ÍMPARES (1, 3, 5...) - Card na Esquerda */
.timeline-item:nth-child(odd) {
  justify-content: flex-start;
}

/* Itens PARES (2, 4, 6...) - Card na Direita */
.timeline-item:nth-child(even) {
  justify-content: flex-end;
}

.div-aranha-direita {
  display: flex;
  position: absolute;
  top: 92%;
  right: -8px;
  transform: rotate(-10deg);
}

.div-aranha-esquerda {
  display: flex;
  position: absolute;
  top: 92%;
  left: -8px;
  transform: rotate(10deg);
}

.div-aranha-direita img {
  width: 2.3rem;
  height: auto;
}

.div-aranha-esquerda img {
  width: 2.3rem;
  height: auto;
}

#teia-planoFundo-topo {
  display: flex;
  position: absolute;
  top: 50rem;
  right: -30rem;
}

#teia-planoFundo-baixo {
  display: flex;
  position: absolute;
  bottom: -110rem;
  left: -40rem;
}

#teia-planoFundo-topo img {
  width: 80rem;
  height: auto;
  opacity: 0.1;
}

#teia-planoFundo-baixo img {
  width: 90rem;
  height: auto;
  opacity: 0.1;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 15px; /* Linha fixa na esquerda */
  top: 0; 
  bottom: 0;
  width: 2px;
  background-color: var(--corAzulPrincipal);
  z-index: 0;
}

.timeline-item::after {
  content: '';
  position: absolute;
  left: 15px; /* Começa na linha vertical */
  top: 45px; /* Altura do ano */
  width: 30px; /* Bracinho curto fixo */
  height: 2px;
  background-color: var(--corAzulPrincipal);
  z-index: 1;
}

.timeline-card {
  z-index: 10;
  position: relative; 
}

/* Configuração para cards na ESQUERDA (Ímpares) */
.timeline-item:nth-child(odd)::after {
  right: 50%; /* Sai do centro para a esquerda */
}

/* Configuração para cards na DIREITA (Pares) */
.timeline-item:nth-child(even)::after {
  left: 50%; /* Sai do centro para a direita */
}

/* --- TABLET E DESKTOP (ZIG-ZAG) --- */
/* --- TABLET E DESKTOP (ZIG-ZAG) --- */
@media screen and (min-width: 768px) {
  
  /* Retorna a linha para o MEIO */
  .timeline::before {
    left: 50%;
    transform: translateX(-50%);
    
    /* CORREÇÃO AQUI: Mudamos de 50px para 45px para bater exato com o braço */
    /* Se quiser que a linha suba mais, pode colocar 0 */
    top: 45px; 
  }

  /* Remove o padding lateral do item pois agora é centralizado */
  .timeline-item {
    padding-left: 0;
  }

  /* Define o tamanho do card para caber lado a lado */
  .timeline-card {
    width: calc(40% - 25px);
  }

  .timeline-card h3 {
    font-size: 4.5rem;
  }


  /* LÓGICA DO ZIG-ZAG */
  
  /* ÍMPARES (Esquerda) */
  .timeline-item:nth-child(odd) {
    justify-content: flex-start;
  }
  .timeline-item:nth-child(odd)::after {
    left: auto; 
    right: 50%; 
    width: calc(10% + 80px); 
  }

  /* PARES (Direita) */
  .timeline-item:nth-child(even) {
    justify-content: flex-end;
  }
  .timeline-item:nth-child(even)::after {
    left: 50%; 
    width: calc(10% + 80px);
  }
  
  /* Ajustes gerais de layout */
  .section-okan-ilu {
    height: 339px;
  }
  .section-okan-ilu #img-okan-ilu {
    margin: 0px 20px 0px 0px;
    width: 50rem;
  }
  .section-okan-ilu #img-okan-ilu img {
    display: block;
    width: 34rem;
  }
  .header {
  position: initial !important;
  }
  /* Aranhas e Teias */
  #teia-planoFundo-topo { top: 60rem; right: -20rem; }
  #teia-planoFundo-baixo { bottom: -150rem; left: -40rem; }
}

@media screen and (min-width: 1200px) {

.timeline-item:nth-child(odd)::after,
  .timeline-item:nth-child(even)::after {
    width: calc(15% + 80px);
  }

  .timeline-card {
    width: calc(35% - 25px);
  }
  
  .section-okan-ilu {
    height: 500px;
  }

  .section-okan-ilu #img-okan-ilu {
    margin: 0px 20px 0px 0px;
    width: 160rem;
  }

  .section-okan-ilu #img-okan-ilu img {
    width: 50rem;
    height: auto;
    display: block;
  }

  .section-okan-ilu #informacoes-okan-ilu {
    font-size: 16px;
    margin: 20px 25px 0px 0px;
    padding: 0px 150px 0px 150px;
  }

  .section-okan-ilu #informacoes-okan-ilu img {
    align-self: center;
    margin: 30px 0px 10px 0px;
    width: 39rem;
    height: auto;
  }

  .timeline-card {
    width: calc(35% - 25px);
  }

  .timeline-card h3 {
    font-size: 4.5rem;
  }

  .timeline-card p {
    font-size: 1.8rem;
  }

  .timeline-card button {
    width: 14rem;
    height: 26px;
    font-size: 1.7rem;
  }

  #teia-planoFundo-topo {
    top: 70rem;
    right: -70rem;
  }

  #teia-planoFundo-topo img {
    width: 160rem;
    height: auto;
    opacity: 0.1;
  }

  #teia-planoFundo-baixo {
    bottom: -200rem;
    left: -40rem;
  }

  #teia-planoFundo-baixo img {
    width: 150rem;
    height: auto;
    opacity: 0.1;
  }
}
