/* Immersive scrollytelling story — modeled on NYT-style pinned-background storytelling */

.story-intro {
  background: var(--color-purple-dark);
  color: #fff;
  padding: 90px 0 70px;
  text-align: center;
}

.story-intro .kicker {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.8rem;
  color: #cdb7e0;
  margin-bottom: 14px;
}

.story-intro h1 {
  font-size: 3.4rem;
  max-width: 820px;
  margin: 0 auto 20px;
  line-height: 1.2;
}

.story-intro p {
  max-width: 640px;
  margin: 0 auto;
  color: #f0e6f7;
  font-size: 1.1rem;
}

.story-progress {
  position: sticky;
  top: 0;
  height: 4px;
  background: rgba(255, 255, 255, 0.15);
  z-index: 50;
}

.story-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--color-green);
  transition: width 0.05s linear;
}

.story {
  position: relative;
  background: #111;
}

.story-media {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  z-index: 1;
}

.story-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.03);
  transition: opacity 0.7s ease, transform 1.4s ease;
}

.story-media img.is-active {
  opacity: 1;
  transform: scale(1);
}

/* Scroll-scrubbed crossfade pair (step 1): opacity is driven every frame by JS
   from scroll position, so no CSS transition delay — the fade tracks the scroll
   1:1 for a true parallax morph rather than an easing lag. */
.story-media img.story-morph-img {
  transition: none;
  transform: scale(1);
}

/* Archipelago sequence (step 2): source photos vary in aspect ratio, so use
   contain (not cover) so the Denver perimeter is never cropped -- keeping
   frames 1 and 4 aligned. The "explode" scale bump is applied via JS. */
.story-media img.story-morph-contain {
  object-fit: contain;
  background: #111;
}

.story-media::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0) 45%);
  z-index: 2;
  pointer-events: none;
}

.story-steps {
  position: relative;
  z-index: 3;
  margin-top: -100vh;
}

.story-step {
  /* Tall enough that each step holds its fully-settled state (card + image
     frozen in place) for a full viewport's worth of scroll before handing off
     to the next -- so you can't accidentally scroll past one without seeing it
     fully. Every step is the same height so the handoff timing (js/story.js)
     is consistent throughout the story. */
  min-height: 200vh;
  display: flex;
  align-items: center;
  padding: 60px 24px;
}

.story-step.align-left {
  justify-content: flex-start;
}

.story-step.align-right {
  justify-content: flex-end;
}

.story-card {
  background: rgba(253, 248, 242, 0.97);
  max-width: 480px;
  width: 100%;
  padding: 30px 32px;
  border-radius: 12px;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.35);
  opacity: 0.35;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.story-step.is-current .story-card {
  opacity: 1;
  transform: translateY(0);
}

.story-card .eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fff;
  background: var(--color-purple);
  padding: 4px 10px;
  border-radius: 4px;
  margin-bottom: 14px;
}

.story-card .eyebrow.tag-solution {
  background: var(--color-green);
}

.story-card .eyebrow.tag-hope {
  background: var(--color-purple-dark);
}

.story-card .eyebrow.tag-cta {
  background: #b8862f;
}

.story-card h2 {
  margin: 0 0 12px;
  font-size: 1.5rem;
  color: var(--color-purple-dark);
}

.story-card p {
  margin: 0 0 10px;
  color: var(--color-text);
}

.story-card p:last-child {
  margin-bottom: 0;
}

.story-card .story-visual-note {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed #d7c6e4;
  font-size: 0.85rem;
  color: var(--color-muted);
  font-style: italic;
}

/* Checkable options step (#8) */
.story-choices {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 16px 0;
}

.story-choices label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
  cursor: pointer;
}

.story-choices input {
  width: 18px;
  height: 18px;
  accent-color: var(--color-purple);
}

/* Donation gauge step (#9) */
.story-gauge-cta {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 16px;
  flex-wrap: wrap;
}

.story-outro {
  background: var(--color-cream);
  padding: 70px 0;
  text-align: center;
}

@media (max-width: 900px) {
  .story-step.align-left,
  .story-step.align-right {
    justify-content: center;
  }
  .story-card {
    max-width: 92%;
  }
  .story-intro h1 {
    font-size: 2rem;
  }
}
