.history-banner {
  width: 100%;
  height: 50vh;
  position: relative;
  z-index: 1;
  overflow: hidden;
}

.history-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--history-banner-url);
  background-size: cover;
  background-position: center;
  z-index: -1;
}

.history-banner-content {
  position: absolute;
  top: 65%;
  left: 50%;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 1rem;
  box-sizing: border-box;
  color: white;
  overflow: hidden;
  transform: translate(-50%, -50%);
}

.history-banner-content h2 {
  font-weight: bold;
  margin: 0 0 0.5rem 0;
  word-wrap: break-word;
  hyphens: auto;
  flex-shrink: 1;
  text-shadow: 2px 2px 5px rgba(0, 0, 0, 1);
  color: var(--white);
}

.history-banner-content h3 {
  margin: 0 0 1rem 0;
  word-wrap: break-word;
  flex-shrink: 1;
  text-shadow: 2px 2px 5px rgba(0, 0, 0, 1);
  color: var(--white);
}

.typing-text::after {
  content: "|";
  animation: blink-caret 0.7s step-end infinite;
}

@keyframes blink-caret {
  from,
  to {
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
}

.typing-text.typing-done::after {
  content: none;
}

/* Timeline Styles */
.timeline {
  position: relative;
  width: 80%;
  margin: 0 auto;
  margin-top: 8vh;
  margin-bottom: 8vh;
  padding: 20px 0;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 4px;
  height: 100%;
  background: var(--grey-light);
  transform: translateX(-50%);
}

.timeline-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 40px 0;
  position: relative;
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s ease-out;
}

.timeline-item.visible {
  opacity: 1;
  transform: translateY(0);
}

.timeline-item::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  background: var(--red);
  border: 3px solid white;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
}

.timeline-item .content,
.timeline-item .image {
  width: 45%;
}

.timeline-item .image {
  width: 45%;
  overflow: hidden;
  border-radius: 10px;
}

.timeline-item .image img {
  width: 100%;
  height: auto;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.timeline-item .image:hover img {
  transform: scale(1.1);
}

.timeline-item .content {
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
}

.timeline-item h3 {
  margin-top: 0;
}

.timeline-item:nth-child(even) {
  flex-direction: row-reverse;
}

/* Mobile Styles */
@media screen and (max-width: 768px) {
  .timeline {
    width: 90%;
    padding-left: 30px;
  }

  .timeline::before {
    left: 15px;
    transform: none;
  }

  .timeline-item {
    flex-direction: column;
    align-items: flex-start;
    margin: 30px 0;
  }

  .timeline-item::before {
    left: -13px;
    top: 0;
    transform: translate(-50%, 0);
  }

  .timeline-item .content,
  .timeline-item .image {
    width: 100%;
    margin-bottom: 20px;
  }

  .timeline-item .content {
    margin-left: 0;
    padding: 20px;
    order: 1;
  }

  .timeline-item .image {
    order: 2;
  }

  .timeline-item:nth-child(even) {
    flex-direction: column;
  }

  .timeline-item .content p {
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
  }
  .history-banner-content {
    padding: 0.5rem;
  }
}

@media (min-width: 1920px) {
  .timeline {
    max-width: 1890px;
  }
}
