/* ---------------------------------------------------------------------------
   photo-timeline — full-bleed marquee of captioned archive photos.
   Rides the global .marquee-wrapper / .marquee-container animation
   (components/marquee.css); the component's own script clones the track so the
   loop is seamless.

   Loaded by resources/views/components/sections/photo-timeline.blade.php.
   Plain CSS — no Tailwind @apply here.
   Bump the ?v in that component's <link> whenever this file changes.
--------------------------------------------------------------------------- */

/* Title measure matched to story-sections.css, so headings on a page built
   from both families wrap at the same width. */
.section-photo-timeline h2 {
  max-width: 52rem;
}

/* Duration is for one full pass of the track, so it scales with how many
   photos are in the strip — raise it to slow the drift, lower it to speed up.
   This overrides marquee.css's own mobile override, so the pace is the same
   at every width. */
.section-photo-timeline .pt-marquee {
  --gap: 1.25rem;
  --animation-duration: 140s;
}

/* Hovering pauses both halves so a photo can actually be looked at */
.section-photo-timeline .pt-marquee:hover .marquee-container {
  animation-play-state: paused;
}

@media (prefers-reduced-motion: reduce) {
  .section-photo-timeline .pt-marquee .marquee-container {
    animation: none;
  }

  /* No motion means no seamless loop to rely on — let the reader scroll it */
  .section-photo-timeline .pt-marquee {
    overflow-x: auto;
  }
}

.section-photo-timeline .pt-frame {
  position: relative;
  flex: 0 0 auto;
  width: 17rem;
  /* matches the source photos (1920x1574) so nothing important is cropped */
  aspect-ratio: 6 / 5;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

@media screen and (min-width: 768px) {
  .section-photo-timeline .pt-frame {
    width: 22rem;
  }
}

.section-photo-timeline .pt-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Year caption sits on the photo, over a bottom scrim so it stays legible
   whatever the photo behind it is doing. */
.section-photo-timeline .pt-frame::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 45%;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.55), transparent);
  pointer-events: none;
}

.section-photo-timeline .pt-year {
  position: absolute;
  left: 1.25rem;
  bottom: 0.9rem;
  z-index: 1;
  margin: 0;
  color: #fff;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}
