/* ==========================================
   TIMELINE ARCHITECTURE
   ========================================== */
.timeline-section {
  padding: clamp(4rem, 8vw, 6rem) 5vw;
  background-color: var(--color-white, #ffffff);
  overflow-x: hidden;
}

.timeline-container {
  position: relative;
  max-width: 60rem;
  margin: 0 auto;

  /* The central vertical line */
  &::after {
    content: '';
    position: absolute;
    width: 2px;
    background-color: rgba(59, 20, 94, 0.2);
    top: 0;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
  }
}

.timeline-item {
  position: relative;
  width: 50%;
  padding: clamp(1rem, 3vw, 2rem) clamp(2rem, 4vw, 4rem);
  z-index: 2;

  /* Styling the Card */
  .timeline-content {
    background-color: var(--color-bg-alt, #f3f4f6);
    padding: clamp(1.5rem, 3vw, 2.5rem);
    border-radius: var(--border-radius, 0.5rem);
    box-shadow: 0 0.25rem 1rem rgba(0, 0, 0, 0.05);
    
    h2 {
      color: var(--color-text-dark, #333333);
      font-size: clamp(1.3rem, 2.5vw, 1.5rem);
      margin-bottom: 1rem;
    }

    p {
      color: var(--color-text-dark, #444444);
      font-size: clamp(0.95rem, 1.5vw, 1.05rem);
      line-height: 1.6;
      margin-bottom: 1rem;

      &:last-child {
        margin-bottom: 0;
      }
    }
  }

  /* The Date Indicator */
  .timeline-date {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: clamp(0.9rem, 1.5vw, 1rem);
    font-weight: 600;
    color: var(--color-text-dark, #555555);
  }

  /* The Central Node */
  .timeline-dot {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
    background-color: var(--color-primary-dark, #3b145e);
    border: 3px solid var(--color-white, #ffffff);
    box-shadow: 0 0 0 2px rgba(59, 20, 94, 0.2);
    z-index: 3;
  }
}

/* --- Left Side Items --- */
.timeline-item.left {
  left: 0;
  text-align: right;

  .timeline-date {
    right: clamp(-6rem, -10vw, -8rem);
    text-align: left;
  }

  .timeline-dot {
    right: calc(-0.625rem + 1px);
  }
}

/* --- Right Side Items --- */
.timeline-item.right {
  left: 50%;
  text-align: left;

  .timeline-date {
    left: clamp(-6rem, -10vw, -8rem);
    text-align: right;
  }

  .timeline-dot {
    left: calc(-0.625rem + 1px);
  }
}

/* ==========================================
   MOBILE VIEWPORT COMPATIBILITY
   ========================================== */
@media (max-width: 48em) {
  .timeline-container {
    &::after {
      left: 1.5rem;
    }
  }

  .timeline-item {
    width: 100%;
    left: 0 !important;
    padding: 1.5rem 0 1.5rem 3.5rem;
    text-align: left !important;

    .timeline-date {
      position: relative;
      top: auto;
      transform: none;
      left: 0 !important;
      right: 0 !important;
      text-align: left !important;
      display: block;
      margin-bottom: 0.5rem;
      color: var(--color-primary, #35295c);
    }

    .timeline-dot {
      left: calc(1.5rem - 0.625rem + 1px) !important;
      right: auto !important;
    }
  }
}
