/* Each chapter stays in the reading order. The wide-screen stage mirrors its photograph. */
.story {
  background:var(--white);
}

.story-intro {
  display:grid;
  gap:clamp(1rem, 4vw, 3.5rem);
  margin-bottom:clamp(2rem, 5vw, 4.1rem);
}

.story-intro h2 {
  max-width:16ch;
  color:var(--blue);
}

.story-intro p {
  max-width:35ch;
  color:var(--muted);
  font-size:clamp(1.04rem, 1.6vw, 1.21rem);
}

.story-chapters {
  display:grid;
  gap:1.75rem;
  margin:0;
  padding:0;
  list-style:none;
}

.story-chapter {
  display:grid;
  gap:1.15rem;
  min-width:0;
  padding-block:1.65rem 0;
  border-top:1px solid var(--line);
}

.story-number {
  display:inline-grid;
  min-width:2rem;
  min-height:1.65rem;
  margin-bottom:.78rem;
  place-items:center;
  border:1px solid var(--line);
  border-radius:.36rem;
  background:var(--white);
  color:var(--blue);
  font-size:.8rem;
  font-weight:760;
  font-variant-numeric:tabular-nums;
  transition:background-color var(--fast) var(--ease), border-color var(--fast) var(--ease);
}

.story-chapter h3 {
  color:var(--ink);
  font-size:clamp(1.5rem, 2.6vw, 2.35rem);
}

.story-chapter p {
  max-width:38ch;
  margin-top:.65rem;
  color:var(--muted);
  font-size:1.04rem;
}

.story-chapter .text-link {
  margin-top:.4rem;
}

.story-photo {
  overflow:hidden;
  border-radius:.88rem;
  background:var(--deep);
  color:var(--white);
}

.story-photo img {
  width:100%;
  aspect-ratio:4 / 3;
  object-fit:cover;
}

.story-photo figcaption {
  padding:.56rem .85rem;
  font-size:.86rem;
  font-weight:650;
}

@media (min-width:700px) {
  .story-intro {
    grid-template-columns:minmax(0, 1.5fr) minmax(0, .8fr);
    align-items:end;
  }

  .story-intro p {
    margin-bottom:.2rem;
  }

  .story-chapter {
    grid-template-columns:minmax(0, .8fr) minmax(0, 1.2fr);
    align-items:center;
    gap:clamp(1.5rem, 4vw, 3rem);
  }
}

@media (min-width:900px) and (min-height:620px) and (prefers-reduced-motion:no-preference) {
  .story.is-story-enhanced .story-layout {
    display:grid;
    grid-template-columns:minmax(0, 1.62fr) minmax(0, 1fr);
    gap:clamp(2rem, 5vw, 5.25rem);
    align-items:start;
  }

  .story.is-story-enhanced .story-stage {
    position:sticky;
    top:calc(var(--nav-h) + 1.5rem);
    color:var(--ink);
  }

  .story-stage-photos {
    position:relative;
    height:clamp(19rem, 50svh, 34rem);
    overflow:hidden;
    border-radius:1.05rem;
    background:var(--navy);
  }

  .story-stage-photos img {
    position:absolute;
    inset:0;
    width:100%;
    height:100%;
    object-fit:cover;
    opacity:0;
    transform:scale(1.045);
  }

  .story-stage-photos img:first-child {
    opacity:1;
  }

  .story.is-story-enhanced .story-chapters {
    gap:0;
  }

  .story.is-story-enhanced .story-chapter {
    position:relative;
    display:flex;
    min-height:clamp(15rem, 44svh, 27rem);
    align-items:center;
    padding:1.4rem 0;
  }

  .story.is-story-enhanced .story-chapter:last-child {
    min-height:calc(clamp(19rem, 50svh, 34rem) + 4rem);
  }

  .story.is-story-enhanced .story-chapter:first-child {
    border-top:0;
  }

  .story.is-story-enhanced .story-photo {
    position:absolute;
    width:1px;
    height:1px;
    overflow:hidden;
    clip-path:inset(50%);
    white-space:nowrap;
  }

  .story-chapter.is-current .story-number {
    border-color:var(--yellow);
    background:var(--yellow);
  }
}

@supports (animation-timeline:view()) {
  @media (max-width:899px) and (prefers-reduced-motion:no-preference) {
    .story-photo img {
      animation:story-photo-arrival linear both;
      animation-timeline:view();
      animation-range:entry 0% cover 35%;
    }
  }

  @keyframes story-photo-arrival {
    from { transform:scale(1.055); opacity:.82; }
    to { transform:scale(1); opacity:1; }
  }
}

.story-stage-nav {
  position:relative;
  display:flex;
  gap:clamp(1rem, 3.5vw, 2.55rem);
  margin-bottom:.95rem;
  border-bottom:1px solid var(--line);
}

.story-stage-nav a {
  display:inline-flex;
  min-height:49px;
  align-items:center;
  padding:.3rem 0;
  margin-bottom:-1px;
  border-bottom:3px solid transparent;
  color:var(--muted);
  font-size:1rem;
  font-weight:660;
  text-decoration:none;
}

.story-stage-nav a[aria-current] {
  color:var(--blue);
}

.story-stage-marker {
  position:absolute;
  bottom:-1px;
  left:0;
  width:1px;
  height:3px;
  border-radius:2px;
  background:var(--orange);
  transform-origin:left center;
  pointer-events:none;
}

.story-stage-nav a:focus-visible { outline-offset:2px; }

@media (hover:hover) and (pointer:fine) {
  .story-stage-nav a:hover { color:var(--blue); }
}

.story-chapter:focus-visible {
  outline: none;
}

.story-chapter:focus-visible .story-chapter-copy {
  outline: 3px solid var(--blue);
  outline-offset: 7px;
  border-radius: .25rem;
}
