/* ==========================================================================
   A2d2 — Client reflections (Experience · Client experiences)
   Every testimonial lives here. An index of names (with what each person came for) sits beside one paper sheet at a time:
   a line lifted from their own words, then their words in full, then a caption beneath the sheet like the photographs'.
   The band's arrows and count step through them. Without JS the sheets stack.
   ========================================================================== */

.reflections {
  max-width: var(--maxw); margin: clamp(3.5rem, 6vw, 5rem) auto 0; padding-inline: var(--gutter);
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: clamp(1rem, 1.8vw, 1.5rem); align-items: start;
}
.reflections__strip { grid-column: 6 / 13; outline: none; }
.reflections__list { display: grid; gap: 2rem; margin: 0; padding: 0; list-style: none; }
.reflection[hidden] { display: none; }
.reflection figure { display: grid; gap: 0.9rem; margin: 0; }

/* The sheet */
.reflection__sheet { display: flex; flex-direction: column; min-height: clamp(26rem, 36vw, 32rem); padding: clamp(2rem, 4vw, 3.5rem); background: var(--paper); color: var(--ink); }
.reflection__pull { max-width: 30ch; font: italic 300 clamp(1.75rem, 1.15rem + 1.6vw, 2.6rem)/1.16 var(--serif); letter-spacing: -0.015em; color: var(--ink); text-wrap: balance; }   /* italic, unquoted: the line lifted from their words */
.reflection__full { max-width: 40rem; margin-top: 2rem; padding-top: 1.6rem; border-top: 1px solid var(--line); font: 400 clamp(1.1875rem, 1.05rem + 0.4vw, 1.375rem)/1.58 var(--serif); color: var(--ink-soft); }   /* at least the site's body size */
.reflection__full p + p { margin-top: 0.7rem; }

/* The attribution stays for screen readers only: the index beside the sheet already names the person and what they came for */
.reflection figcaption { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* The index */
.reflections__index { grid-column: 1 / 5; margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line-dark); }
.reflections__index button {
  display: grid; grid-template-columns: 2.5rem minmax(0, 1fr); column-gap: 0.75rem; row-gap: 0.3rem; align-items: baseline;
  width: 100%; padding: 1.05rem 0; border: 0; border-bottom: 1px solid var(--line-dark); background: none; text-align: left; cursor: pointer; color: var(--on-dark-mute);
}
.reflections__index button::before { content: ""; grid-row: 1; align-self: center; width: 0; height: 1px; background: var(--on-dark); transition: width 0.5s var(--ease-out); }
.reflections__index .n { grid-column: 2; font: 300 1.3rem/1.2 var(--serif); letter-spacing: -0.01em; color: var(--on-dark-soft); transition: color 0.4s var(--ease); }
.reflections__index .c { grid-column: 2; font: 400 0.8125rem/1.3 var(--sans); color: var(--on-dark-mute); }
.reflections__index button[aria-current="true"]::before { width: 2.5rem; }
.reflections__index button[aria-current="true"] .n { color: var(--on-dark); }
@media (hover: hover) { .reflections__index button:hover .n { color: var(--on-dark); } }
.reflections__index button:focus-visible { outline: 1px solid var(--on-dark); outline-offset: 4px; }

.reflections__foot { justify-content: flex-end; }   /* the arrows sit under the sheet */
.reflections__foot .practice__nav { display: none; }   /* the arrows only make sense once the reader is running */
.js .reflections__foot .practice__nav { display: flex; }

/* Reader: the paper belongs to the list and never leaves; only the words change.
   The old quote fades out quickly, the sheet eases to the new quote's height, then the new one fades in. */
.reflections.is-reader .reflections__list { align-content: start; overflow: hidden; background: var(--paper); }
.reflections.is-reader .reflection__sheet { background: none; }
.reflection.is-out { opacity: 0; transform: translateY(0.375rem); }
@media (prefers-reduced-motion: no-preference) {
  .reflections.is-reader .reflections__list { transition: height 0.5s var(--ease); }
  .reflections.is-reader .reflection { transition: opacity 0.55s var(--ease-out) 0.1s, transform 0.7s var(--ease-out) 0.1s; }
  .reflections.is-reader .reflection.is-out { transition: opacity 0.22s var(--ease), transform 0.22s var(--ease); }
}

/* ---------- Small screens: the names become a row above the sheet ---------- */
@media (max-width: 760px) {
  .reflections { grid-template-columns: minmax(0, 1fr); }
  .reflections__strip { grid-column: 1; }
  .reflections__index { grid-column: 1; display: flex; gap: 1.5rem; overflow-x: auto; margin: 0 calc(var(--gutter) * -1) 1.5rem; padding: 0 var(--gutter); border-top: 0; scrollbar-width: none; }
  .reflections__index::-webkit-scrollbar { display: none; }
  .reflections__index li { flex: none; }
  .reflections__index button { grid-template-columns: auto; row-gap: 0.2rem; width: auto; padding: 0.4rem 0 0.6rem; border-bottom: 1px solid transparent; }
  .reflections__index button::before { display: none; }
  .reflections__index .n, .reflections__index .c { grid-column: 1; }
  .reflections__index .c { white-space: nowrap; }
  .reflections__index .n { font-size: 1.125rem; white-space: nowrap; }
  .reflections__index button[aria-current="true"] { border-bottom-color: var(--on-dark); }
  .reflection__sheet { min-height: 0; padding: 1.75rem; }
  .reflection__full { font-size: 1.125rem; }
}
