/* timeline.css (marker separated and locked to center spine) */

.timeline-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4rem 0;
  width: 100%;
}

.timeline-vertical {
  position: relative;
  width: 90%;
  margin: 0 auto;
  padding: 4rem 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4rem;
}

/* Center Line */
.timeline-vertical::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 4px;
  background-color: #34544f;
  transform: translateX(-50%);
}

/* Timeline Event Layout */
.timeline-event {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  position: relative;
}

.timeline-event.left {
  flex-direction: row;
}

.timeline-event.right {
  flex-direction: row-reverse;
}

.timeline-marker {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 16px;
  height: 16px;
  background-color: #dbca9a;
  border-radius: 50%;
  box-shadow: 0 0 0 4px #34544f;
}

.timeline-marker::after {
  content: "";
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  height: 3px;
  background-color: #34544f;
  width: 150px;
  margin-left: 1px;
}

.timeline-event.left .timeline-marker::after {
  right: 100%;
}

.timeline-event.right .timeline-marker::after {
  left: 100%;
}

.timeline-item {
  width: 50%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.timeline-event.right .timeline-item {
  justify-content: flex-end;
}

/* Timeline Card */
.timeline-card {
  background-color: #786f5d;
  padding: 1.5rem;
  margin: 0 2rem;
  border-radius: 8px;
  max-width: 400px;
  width: 100%;
  text-align: center;
  color: #dbca9a;
  box-shadow: 0 8px 16px rgba(0,0,0,0.2);
  z-index: 1;
}

/* Centered Eras */
.timeline-era {
  width: 60%;
  background-color: #c08b51;
  align-self: center;
  padding: 2rem 1.5rem;
  text-align: center;
}

/* Text Styling */
.timeline-content {
  margin-top: 1rem;
}

.timeline-year {
  font-size: 1.5rem;
  font-family: "Cinzel", serif;
  margin-bottom: 0.5rem;
}

.timeline-title {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.timeline-description {
  font-size: 1rem;
  color: #dbca9a;
}

/* Hover Effects */
.timeline-event:hover .timeline-card,
.timeline-era:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .timeline-event, .timeline-era {
    width: 100%;
    margin: 0 auto;
  }

  .timeline-vertical::before {
    left: 20px;
    transform: none;
  }

  .timeline-event {
    flex-direction: column !important;
    align-items: center;
  }

  .timeline-marker {
    display: none;
  }

  .timeline-marker::after {
    display: none;
  }

  .timeline-item {
    width: 100%;
    flex-direction: column;
    align-items: center;
  }

  .timeline-card {
    margin: 0;
    width: 80%;
    max-width: 90%;
  }
}
