/* =============================================
   TIMELINE - Vanity Fair Editorial Style
============================================= */
.timeline-section {
  padding: 0 0 clamp(48px, 6vw, 80px);
  background: #F8F9FD;
  overflow: hidden;
}

/* ── Header ── */
.timeline-header {
  padding: 0 var(--section-pad-h);
  margin-bottom: clamp(40px, 5vw, 72px);
  max-width: 1296px;
  margin-left: auto;
  margin-right: auto;
}

.timeline-header h2 {
  font-family: var(--font-display);
  font-size: clamp(36px, 4vw, 58px);
  font-weight: 600;
  color: var(--text-dark);
  line-height: 1.15;
  margin-top: 14px;
}

/* ── Horizontal scroll track ── */
.timeline-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  cursor: grab;
}

.timeline-track::-webkit-scrollbar { display: none; }
.timeline-track.dragging { cursor: grabbing; scroll-behavior: auto; }

/* ── Individual slide ── */
.timeline-slide {
  min-width: 100vw;
  scroll-snap-align: start;
  padding: 0 var(--section-pad-h);
  position: relative;
  flex-shrink: 0;
}

/* ── Giant decorative year ── */
.timeline-year-bg {
  font-family: var(--font-display);
  font-size: clamp(120px, 18vw, 240px);
  font-weight: 700;
  color: var(--blue-mid);
  opacity: 0.18;
  position: absolute;
  top: -30px;
  right: 40px;
  line-height: 1;
  pointer-events: none;
  user-select: none;
  letter-spacing: -0.04em;
}

/* ── Content row ── */
.timeline-content {
  display: flex;
  align-items: center;
  gap: clamp(32px, 5vw, 80px);
  min-height: clamp(340px, 40vw, 500px);
  position: relative;
  z-index: 2;
  max-width: 1200px;
  margin: 0 auto;
}

/* ── Text block ── */
.timeline-text {
  flex: 0 0 clamp(240px, 30vw, 380px);
  max-width: clamp(240px, 30vw, 380px);
}

.t-year {
  display: block;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--blue-accent);
  margin-bottom: 18px;
}

.timeline-text h3 {
  font-family: var(--font-display);
  font-size: clamp(28px, 3.2vw, 48px);
  font-weight: 600;
  color: var(--text-dark);
  line-height: 1.18;
  margin-bottom: 24px;
}

/* Subtle ruled line under heading */
.timeline-text h3::after {
  content: '';
  display: block;
  width: 48px;
  height: 2px;
  background: var(--blue-accent);
  margin-top: 18px;
  border-radius: 2px;
}

.timeline-text p {
  font-size: clamp(15px, 1.4vw, 17px);
  color: var(--text-mid);
  line-height: 1.85;
}

/* ── Photo grid ── */
.timeline-photos {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-auto-rows: clamp(130px, 13vw, 200px);
  gap: clamp(8px, 1vw, 14px);
  max-height: clamp(280px, 38vw, 440px);
}

/* Single photo: full width */
.timeline-photos:has(.t-photo:only-child) {
  grid-template-columns: 1fr;
  max-height: 440px;
}

/* Two photos: side by side, full natural height, no cropping */
.timeline-photos:has(.t-photo:first-child:nth-last-child(2)) {
  grid-auto-rows: auto;
  max-height: none;
  align-items: start;
}

.timeline-photos:has(.t-photo:first-child:nth-last-child(2)) .t-photo--large {
  grid-row: span 1;
}

.timeline-photos:has(.t-photo:first-child:nth-last-child(2)) .t-photo img {
  width: 100%;
  height: auto;
  display: block;
}

.t-photo {
  border-radius: var(--radius);
  overflow: hidden;
  background: linear-gradient(135deg, var(--blue-pale) 0%, var(--blue-mid) 100%);
  position: relative;
  transition: transform 0.1s linear;
  will-change: transform;
}

.t-photo img {
  transition: transform 0.65s var(--ease);
}

.t-photo:hover img {
  transform: scale(1.05);
}

.t-photo--large {
  grid-row: span 2;
}


/* ── Responsive ── */
@media (max-width: 768px) {
  .timeline-year-bg {
    font-size: clamp(72px, 20vw, 110px);
    right: 12px;
    top: -10px;
    opacity: 0.12;
  }

  /* Slide: exactly viewport-wide, clips overflow, natural height */
  .timeline-slide {
    min-width: 100vw;
    max-width: 100vw;
    padding-top: clamp(20px, 4vw, 32px);
    padding-bottom: clamp(28px, 5vw, 44px);
    padding-left: clamp(20px, 5vw, 32px);
    padding-right: clamp(20px, 5vw, 32px);
    display: flex;
    flex-direction: column;
    min-height: unset;
    overflow: hidden;
  }

  /* Content: column stack, constrained to slide width */
  .timeline-content {
    flex: 0 0 auto;
    flex-direction: column;
    align-items: stretch;
    gap: clamp(16px, 4vw, 24px);
    min-height: unset;
    padding-bottom: 0;
    width: 100%;
    max-width: 100%;
  }

  /* Text: full width, no overflow from long words */
  .timeline-text {
    flex: 0 0 auto;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  /* Photos: fill width, 2-col grid with proportional row heights */
  .timeline-photos {
    flex: 0 0 auto;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    max-height: none;
    grid-template-columns: 1fr 1fr;
    grid-auto-rows: clamp(100px, 28vw, 170px);
  }

}

/* ── Scrollytelling - all screen sizes ── */

/* Section must not clip the sticky child */
.timeline-section {
  overflow: visible;
  padding-bottom: 0;
}

/* Tall scroll spacer - 1 viewport of scroll per slide */
.timeline-scroll-container {
  height: calc(6 * 100svh);
  position: relative;
}

/* Sticky panel: fills viewport, centers track vertically */
.timeline-sticky {
  position: sticky;
  top: 0;
  height: 100svh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  background: #F8F9FD;
}

/* Track: transform-driven, clips via sticky overflow: hidden */
.timeline-track {
  flex: 0 0 auto;
  overflow: visible;
  cursor: default;
  pointer-events: none;
  width: 100%;
  transition: transform 0.7s var(--ease);
  will-change: transform;
}
