.timeline-wrapper {
  position: relative;
  padding: 40px 0;
  max-width: 900px;
  margin: 0 auto;
}

.timeline-s-path {
  display: flex;
  flex-direction: column;
  position: relative;
  align-items: center;
  gap: 0;
}

.timeline-row {
  display: flex;
  justify-content: space-between;
  width: 100%;
  position: relative;
  padding: 40px 0;
}

/* Alternate row directions */
.timeline-row:nth-child(even) {
  flex-direction: row-reverse;
}

/* Horizontal connecting lines within the row */
.timeline-row::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 5%;
  right: 5%;
  height: 2px;
  background: #c9a227;
  z-index: 0;
  transform: translateY(-50%);
}

/* S-bend curves connecting rows */
.timeline-row:not(:last-child)::after {
  content: '';
  position: absolute;
  bottom: -40px; /* half of row padding */
  width: 10%;
  height: 80px;
  border: 2px solid #c9a227;
  border-top: none;
  border-bottom: none;
  z-index: 0;
}

/* Even rows connect to next row on the left */
.timeline-row:nth-child(even):not(:last-child)::after {
  left: 5%;
  border-right: none;
  border-left-width: 2px;
  border-radius: 40px 0 0 40px;
  border-bottom: 2px solid #c9a227;
}

/* Odd rows connect to next row on the right */
.timeline-row:nth-child(odd):not(:last-child)::after {
  right: 5%;
  border-left: none;
  border-right-width: 2px;
  border-radius: 0 40px 40px 0;
  border-bottom: 2px solid #c9a227;
}

.timeline-node {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 20%;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.node-marker {
  width: 24px;
  height: 24px;
  background: #7a0019;
  border: 4px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 2px #c9a227;
  transition: all 0.3s ease;
  margin-bottom: 10px;
}

.timeline-node:hover {
  transform: translateY(-5px);
}

.timeline-node:hover .node-marker {
  transform: scale(1.3);
  background: #c9a227;
}

.node-label {
  text-align: center;
  background: #fff;
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  font-size: 0.8rem;
  max-width: 120px;
  min-height: 60px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.node-label strong {
  color: #7a0019;
  font-family: 'DM Serif Display', serif;
  font-size: 0.95rem;
  display: block;
  margin-bottom: 4px;
}

.node-label span {
  color: #666;
  display: block;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .timeline-row {
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    padding: 20px 0;
  }
  .timeline-row::before, .timeline-row::after {
    display: none; /* Hide S-bends on mobile for simplicity */
  }
  .timeline-s-path::before {
    content: '';
    position: absolute;
    top: 0; bottom: 0;
    left: 20px;
    width: 2px;
    background: #c9a227;
  }
  .timeline-node {
    width: 100%;
    flex-direction: row;
    align-items: center;
    padding-left: 10px;
  }
  .node-marker {
    margin-bottom: 0;
    margin-right: 20px;
  }
  .node-label {
    max-width: none;
    flex: 1;
    text-align: left;
    align-items: flex-start;
  }
}
