body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  min-height: 100vh;
}

.tittle {
  margin: 0;
  margin-top: 4rem;
  width: 100%;
  text-align: center;
  padding: 0;
  font-size: 2rem;
  font-weight: bold;
  color: #065da6;
  background-color: transparent;
  box-shadow: none;
  z-index: 2;
}

.timeline-container {
  display: flex;
  top: -3rem;
  align-items: center;
  overflow-x: auto;
  white-space: nowrap;
  min-height: 90vh;
  position: relative;
  -webkit-overflow-scrolling: touch;
  background: #f4f4f4;
  padding: 0 1rem;
  background-image: url('../assets/img/fondo.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: 0;
}

.timeline {
  display: flex;
  align-items: center;
  background: #007bff;
  height: 8px;
  width: 200%;
  position: relative;
  transition: height 0.5s ease;
  z-index: 2;
}

.timeline-event {
  position: relative;
  margin-right: 10px;
  padding: 10px;
  background: #1a3b82;
  border-radius: 8px;
  width: 100px;
  transition: width 0.5s ease, height 0.5s ease, opacity 0.5s ease, background-color 0.3s ease;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 1s forwards;
  animation-delay: var(--delay);
  cursor: pointer;
  height: 40px;
  z-index: 2;
}

.timeline-event.expanded {
  width: auto;
  height: auto;
}

.timeline-event:hover,
.timeline-event.expanded {
  background-color: transparent;
}

.timeline-event:nth-child(1) {
  --delay: 0.1s;
}

.timeline-event:nth-child(2) {
  --delay: 0.3s;
}

.timeline-event:nth-child(3) {
  --delay: 0.5s;
}

.timeline-event:nth-child(4) {
  --delay: 0.7s;
}

.timeline-event:nth-child(5) {
  --delay: 1.1s;
}

.timeline-event:nth-child(6) {
  --delay: 1.3s;
}

.timeline-event:nth-child(7) {
  --delay: 1.5s;
}

.timeline-event:nth-child(8) {
  --delay: 1.7s;
}

.timeline-event:nth-child(9) {
  --delay: 1.9s;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.timeline-date {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-40%);
  font-size: 20px;
  font-weight: bold;
  color: #ffffff;
  background: #1565b5;
  padding: 10px 20px;
  border-radius: 5px;
  transition: color 0.3s, background 0.3s, transform 0.3s;
  white-space: nowrap;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  z-index: 2;
}

.timeline-event:hover .timeline-date,
.timeline-event.expanded .timeline-date {
  color: #ffffff;
  background: #0a2341;
  transform: scale(1.2);
}

.timeline-content {
  display: inline-block;
  width: auto;
  transition: max-height 0.5s ease, padding 0.5s ease, opacity 0.5s ease;
  overflow: hidden;
  max-height: 0;
  padding: 0 10px;
  z-index: 2;
}

.timeline-content h3 {
  margin-top: 0;
}

.image-group {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.image-card {
  display: flex;
  flex-direction: column;
  background-color: transparent;
  border-radius: 3px;
  padding: 0px;
  width: 250px;
  /* Ajustar según sea necesario */
}

.image-card img {
  max-width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 4px;
}

.image-description {
  background-color: transparent;
  margin-top: 2px;
  font-size: 1rem;
  font-style: italic;
  color: #000000;
  text-align: center;
  font-weight: bold;
  padding: 0 5px;
  word-wrap: break-word;
}

.timeline-content.expanded {
  display: block;
  max-height: 80vh;
  overflow-y: auto;
  padding: 10px;
  opacity: 1;
}

.timeline-content.collapsing {
  animation: fadeOutDown 0.5s forwards;
}

@keyframes fadeOutDown {
  from {
    opacity: 1;
    transform: translateY(0);
  }

  to {
    opacity: 0;
    transform: translateY(20px);
  }
}

.timeline-event.collapsing .timeline-content {
  display: block;
}

.timeline-event.collapsing {
  animation: collapse 0.5s forwards;
}

@keyframes collapse {
  from {
    width: 300px;
    height: auto;
  }

  to {
    width: 100px;
    height: 40px;
  }
}

/* Overlay for zoomed image */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.overlay img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 10px;
}

.overlay.active {
  display: flex;
}

.phrase-container {
  position: fixed;
  bottom: 10%;
  left: 50%;
  transform: translateX(-50%);
  background-color: #065da6;
  color: #ffffff;
  padding: 10px 20px;
  border-radius: 5px;
  font-size: 1.2rem;
  font-weight: bold;
  text-align: center;
  opacity: 0;
  transition: opacity 1s ease-in-out;
  z-index: 2000;
}

.phrase-container.show {
  opacity: 1;
}


@media (max-width: 1200px) {
  .timeline-date-background {
    font-size: 20rem;
  }

  .timeline-content.expanded {
    max-height: 80vh;
  }
}

@media (max-width: 600px) {
  .timeline-event {
    width: 100px;
    height: 40px;
  }

  .image-card {
    width: 100%;
    padding: 5px;
  }

  .image-card img {
    height: auto;
    max-width: 100%;
  }

  .image-description {
    font-size: 0.8rem;
  }

  .timeline-content.expanded {
    max-height: 50vh;
  }
}