.periodico {
  position: relative;
  padding: 50px;
  color: white;
}

.periodico::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 1799px;
  background-size: contain;
  opacity: 0.3;
  z-index: -1;
  background-image: url('../img/galeria_historica/prensa_horizontal.webp')
}

@media (max-width: 944px) {
  .periodico::before {
    display: none;
  }
}

/* ========================= */
/* 🔥 FIX BOOTSTRAP GUTTERS */
/* ========================= */


/* ========================= */
/* TIMELINE */
/* ========================= */

.timeline {
  position: relative;
  max-width: 900px;
  margin: 40px auto;
  padding: 0 20px;
}

/* LÍNEA CENTRAL */
.timeline::after {
  content: '';
  position: absolute;
  width: 4px;
  background: linear-gradient(to bottom, #af884d, #784a05);
  top: 0;
  bottom: 0;
  left: 50%;
  margin-left: -2px;
  transform: scaleY(0);
  transform-origin: top;
  animation: lineGrow 2s ease-out forwards;
}

@keyframes lineGrow {
  to {
    transform: scaleY(1);
  }
}

/* EVENTOS */
.timeline-event {
  padding: 1rem;
  position: relative;
  width: 100%;
  background-color: black;
  border: solid 4px #b08d57;
  border-radius: 12px;
  margin-bottom: 2rem;
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.4s ease;
  cursor: pointer;
}

@media (min-width: 992px) {
  .timeline-event {
    width: 50%;
  }
}

/* ANIMACIONES */
.timeline-event:nth-child(1) { animation: slideInUp 0.6s 0.2s forwards; }
.timeline-event:nth-child(2) { animation: slideInUp 0.6s 0.4s forwards; }
.timeline-event:nth-child(3) { animation: slideInUp 0.6s 0.6s forwards; }
.timeline-event:nth-child(4) { animation: slideInUp 0.6s 0.8s forwards; }
.timeline-event:nth-child(5) { animation: slideInUp 0.6s 1s forwards; }
.timeline-event:nth-child(6) { animation: slideInUp 0.6s 1.2s forwards; }

@keyframes slideInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.timeline-event:hover {
  transform: scale(1.02);
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.3);
}

/* POSICIONES DESKTOP */
.timeline-event.left {
  left: 0;
}

.timeline-event.right {
  left: 50%;
}

/* PUNTOS */
.timeline-event::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: radial-gradient(circle, #b08d57, #333);
  top: 25px;
  z-index: 2;
  animation: bounceIn 0.6s ease forwards;
  opacity: 0;
}

.timeline-event:nth-child(1)::before { animation-delay: 0.3s; }
.timeline-event:nth-child(2)::before { animation-delay: 0.5s; }
.timeline-event:nth-child(3)::before { animation-delay: 0.7s; }
.timeline-event:nth-child(4)::before { animation-delay: 0.9s; }
.timeline-event:nth-child(5)::before { animation-delay: 1.1s; }
.timeline-event:nth-child(6)::before { animation-delay: 1.3s; }

@keyframes bounceIn {
  0% { transform: scale(0); opacity: 0; }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); opacity: 1; }
}

.timeline-event.left::before {
  right: -10px;
}

.timeline-event.right::before {
  left: -10px;
}

/* IMÁGENES */
.timeline-event img {
  width: 100%;
  max-width: 200px;
  border-radius: 8px;
  margin-bottom: 0.5rem;
  transition: all 0.4s;
  filter: grayscale(20%);
}

.timeline-event:hover img {
  transform: scale(1.05);
  filter: grayscale(0%) brightness(1.1);
}

/* TEXTO */
.event-text {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.timeline-event.left .event-text {
  flex-direction: row-reverse;
}

/* EXTRA INFO */
.extra-info {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  background: white;
  color: black;
  padding: 1rem;
  border-radius: 8px;
  opacity: 0;
  transform: translateY(15px) scale(0.95);
  transition: all 0.3s ease;
  pointer-events: none;
}

.timeline-event:hover .extra-info {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* ========================= */
/* 📱 RESPONSIVE DEFINITIVO */
/* ========================= */

@media screen and (max-width: 768px) {

  .periodico {
    padding: 15px 5px;
  }

  .timeline {
    padding: 0;
    margin: 0;
    max-width: 100%;
  }

  .timeline::after {
    left: 12px;
  }

  .timeline-event {
    width: 100%;
    left: 0 !important;
    padding: 1rem 0.8rem 1rem 28px;
    animation: none;
  }

  .timeline-event::before {
    left: 4px !important;
  }

  .event-text {
    flex-direction: column;
    align-items: flex-start;
  }

  .timeline-event.left .event-text {
    flex-direction: column;
  }

  .timeline-event img {
    max-width: 100%;
  }

  .extra-info {
    position: relative;
    opacity: 1;
    transform: none;
    margin-top: 0.5rem;
    pointer-events: auto;
  }
}

/* BOTÓN */
.boton {
  background-color: black;
  color: #b08d57;
}

/* FONDO EXTRA */
.fondolitiempo {
  position: relative;
  padding: 50px;
  color: white;
  margin-bottom: 213px;
}

.fondolitiempo::before {
  background-image: url(../img/linea_tiempo/prensa_horizontal.webp);
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 1899px;
  background-size: contain;
  opacity: 0.3;
  z-index: -1;
}