/* The reader moves between complete thoughts in one centred reading column. */
[data-reading-reflection] {
  scroll-margin-top: 5rem;
  background: #f9f8f5;
}

[data-reading-reflection] > .container {
  padding: var(--al-space-section) var(--al-gutter) clamp(2.5rem, 5vw, 5rem);
}

[data-reading-reflection] .grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  row-gap: clamp(2.75rem, 7svh, 5rem);
  max-width: 47rem;
  margin: 0 auto;
  text-align: center;
}

[data-reading-reflection] .h3 {
  max-width: 23ch;
  margin: 0;
  font: 400 var(--al-type-split-title)/1.12 'Value Serif', Georgia, serif;
  letter-spacing: -.018em;
  text-wrap: balance;
}

[data-reading-reflection] .reflection-heading em { display: block; }

[data-reading-reflection] .reflection-body {
  width: min(100%, 39ch);
  color: #262626;
  font: 300 clamp(1.35rem, 2.1vw, 1.9375rem)/1.43 Haffer, Arial, sans-serif;
}

[data-reading-reflection] .reflection-stage {
  display: grid;
  gap: clamp(1.8rem, 4svh, 3rem);
}

[data-reading-reflection] .reflection-stage > p {
  margin: 0;
  font: inherit;
  text-wrap: balance;
}

[data-reading-reflection] .reflection-stage > .reflection-close {
  font: 400 var(--al-type-split-title)/1.15 'Value Serif', Georgia, serif;
  letter-spacing: -.018em;
}

@media screen and (prefers-reduced-motion: no-preference) and (forced-colors: none) and (prefers-contrast: no-preference) {
  /* The short track gives each thought time to be read in the same place.
     The final thought leaves in normal flow as the beige scene enters. */
  [data-reflection-sequence] .reflection-body::after {
    content: "";
    display: block;
    height: var(--reflection-travel);
  }

  [data-reflection-sequence] .reflection-stage {
    position: sticky;
    top: var(--reflection-top);
    align-items: center;
    gap: 0;
  }

  [data-reflection-sequence] .reflection-stage > p {
    grid-area: 1 / 1;
    opacity: 0;
    transform: translateY(-.2em);
    pointer-events: none;
  }

  [data-reflection-sequence] .reflection-stage > p[data-current] {
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }

  [data-reflection-fades] .reflection-stage > p {
    transition: opacity 120ms ease-in, transform 180ms ease-out;
  }

  [data-reflection-fades] .reflection-stage > p[data-current] {
    transition: opacity 350ms ease-out 85ms, transform 370ms ease-out;
  }

  [data-reflection-sequence] p[data-current] ~ p {
    transform: translateY(.4em);
  }
}
