/* ========== Timeline Section ========== */
.programs-timeline {
  background: #f9f9f9;
  padding: 60px 0;
  position: relative;
}

.programs-timeline .section-title {
  font-weight: 700;
  color: #333;
}

/* ========== Scrollable Container ========== */
.timeline-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 20px;
}

.timeline-container {
  display: flex;
  flex-direction: row;
  gap: 60px;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  min-height: 340px;
}

/* ========== Month Groups ========== */
.month-group {
  flex: 0 0 auto;
  position: relative;
  min-width: 500px;
  transition: all 0.3s ease;
}

.month-header {
  position: sticky;
  left: 0;
  top: 0;
  background: #005baa;
  color: #fff;
  padding: 10px 20px;
  border-radius: 10px;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 16px;
  letter-spacing: 0.5px;
  z-index: 10;
  margin-bottom: 15px;
  width: fit-content;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}

.month-header:hover {
  background: #004b8c;
}

.toggle-icon {
  font-size: 14px;
  transition: transform 0.3s;
}

.month-group.expanded .toggle-icon {
  transform: rotate(180deg);
}

/* ========== Month Events ========== */
.month-events {
  display: flex;
  gap: 25px;
  transition: max-height 0.4s ease, opacity 0.4s ease;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
}

.month-group.expanded .month-events {
  max-height: 1000px; /* Enough for many events */
  opacity: 1;
}

/* ========== Timeline Items ========== */
.timeline-item {
  background: #fff;
  border-radius: 12px;
  min-width: 280px;
  max-width: 320px;
  flex: 0 0 auto;
  scroll-snap-align: start;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s;
}

.timeline-item:hover {
  transform: translateY(-5px);
}

.timeline-date {
  text-align: center;
  background: #8cc004;
  color: #222;
  border-radius: 12px 12px 0 0;
  padding: 10px 0;
  font-weight: bold;
  font-size: 18px;
}

.timeline-content img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 0;
}

.timeline-text {
  padding: 15px;
}

.timeline-text h4 {
  margin-bottom: 10px;
  font-size: 17px;
  font-weight: 700;
  color: #333;
}

.timeline-text p {
  font-size: 14px;
  color: #131313;
  font-weight: 600;
}

/* ========== Responsive Design ========== */
@media (max-width: 992px) {
  .month-group {
    min-width: 400px;
  }
  .timeline-item {
    min-width: 260px;
  }
}

@media (max-width: 768px) {
  .month-group {
    min-width: 300px;
  }
  .month-header {
    font-size: 14px;
    padding: 8px 15px;
  }
  .timeline-item {
    min-width: 240px;
  }
}
