/* TESTIMONIALS ON TCC BLUE (component 2). One review at a time, in a slider; no quotation marks on the quote text.
   The quote is component 1's blue version (../scroll-write/write.css + write.js), so link those first.

   Markup: see index.html. Root: <section class="tcc-quotes" data-tcc-quotes>. Each review is a
   <figure class="tcc-quotes__slide"> holding the quote (<p class="tcc-write tcc-write--blue" data-write="manual">) and a
   <figcaption> with the reviewer's name, the source and the coach the review is about.
   Script: quotes.js (defer, after write.js). Prev / next buttons, a dot per review, swipe on touch, left / right / Home / End
   keys while focus is inside. No autoplay. Without JS the first review shows and the controls are hidden.

   Colour: quote settles on --tcc-ground (7.41:1 on cyan); reviewer name ink; source line ink at .78 (6.0:1, the live band's figure). */

.tcc-quotes {
  --q-ink: var(--tcc-ground);
  --q-muted: rgba(11, 13, 14, .78);
  --q-faint: rgba(11, 13, 14, .22);
  position: relative; isolation: isolate;
  background: var(--tcc-brand);
  color: var(--q-ink);
  padding: clamp(96px, 11vw, calc(168px + var(--tcc-up) * .1)) 0 clamp(64px, 7vw, calc(112px + var(--tcc-up) * .06));
}
.tcc-quotes__in {
  --tcc-write-size: clamp(28px, 3.05vw, calc(48px + var(--tcc-up) * .04));
  width: min(100% - 2 * max(var(--tcc-edge), 24px), calc(940px + var(--tcc-up) * .4));
  margin-inline: auto;
}
.tcc-quotes .tcc-quotes__h {
  font-family: var(--tcc-font-body); font-weight: 600; font-size: 15px; line-height: 1.3; letter-spacing: .01em; color: var(--q-ink);
  margin-bottom: clamp(22px, 2.6vw, 38px);
}

/* the slides share one grid cell, so the band is as tall as its longest review and never jumps */
.tcc-quotes__track { display: grid; touch-action: pan-y; }
.tcc-quotes__slide { grid-area: 1 / 1; display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
.tcc-quotes__q p { max-width: 21em; }
.tcc-quotes.is-live .tcc-quotes__slide { transition: opacity .22s var(--tcc-easing-soft), transform .3s var(--tcc-easing-soft), visibility 0s linear .3s; }
.tcc-quotes.is-live .tcc-quotes__slide:not(.is-current) { opacity: 0; visibility: hidden; transform: translateY(-10px); }
/* the outgoing review clears before the incoming one appears, so the two never overlap */
.tcc-quotes.is-live .tcc-quotes__slide.is-current { transition: opacity .2s linear .22s, transform 0s, visibility 0s; }
.tcc-quotes:not(.is-live) .tcc-quotes__slide:not(:first-child) { display: none; }

/* who said it */
.tcc-quotes__by { margin-top: clamp(26px, 2.8vw, 40px); display: flex; align-items: center; gap: 14px 18px; flex-wrap: wrap; }
.tcc-quotes__name { font-family: var(--tcc-font-heading); font-weight: 600; font-size: clamp(18px, 1.35vw, calc(21px + var(--tcc-up) * .01)); letter-spacing: -.01em; }
.tcc-quotes__meta { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; color: var(--q-muted); }
.tcc-quotes__about { display: inline-flex; align-items: center; gap: 8px; color: var(--q-ink); font-weight: 500; }
.tcc-quotes__about img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px var(--tcc-brand), 0 0 0 3px var(--q-ink); }
.tcc-quotes__dotsep { width: 4px; height: 4px; border-radius: 50%; background: currentColor; opacity: .7; }
.tcc-quotes.is-live .tcc-quotes__by { transition: opacity .5s var(--tcc-easing-soft), transform .6s var(--tcc-easing-arrive); }
.tcc-quotes.is-live .tcc-quotes__slide:not(.is-said) .tcc-quotes__by { opacity: 0; transform: translateY(10px); transition: none; }

/* controls: a dot per review and two round buttons */
.tcc-quotes__nav { margin-top: clamp(40px, 4.6vw, 68px); display: none; align-items: center; justify-content: space-between; gap: 16px; }
.tcc-quotes.is-live .tcc-quotes__nav { display: flex; }
.tcc-quotes__dots { display: flex; align-items: center; margin-right: -8px; }
.tcc-quotes__dot { appearance: none; border: 0; background: none; padding: 0; margin: 0; cursor: pointer;
  width: 40px; height: 44px; display: grid; place-items: center; border-radius: 8px; }
.tcc-quotes__dot::before { content: ''; width: 24px; height: 3px; border-radius: 3px; background: var(--q-faint);
  transition: background-color .3s, width .45s var(--tcc-easing-arrive); }
.tcc-quotes__dot:hover::before { background: var(--q-muted); }
.tcc-quotes__dot[aria-current='true']::before { background: var(--q-ink); width: 34px; }
.tcc-quotes__arrows { display: flex; gap: 10px; }
.tcc-quotes__btn { appearance: none; margin: 0; padding: 0; cursor: pointer; width: 52px; height: 52px; border-radius: 50%;
  border: 0; background: transparent; color: var(--q-ink); box-shadow: inset 0 0 0 1.5px var(--q-ink);
  display: grid; place-items: center; transition: background-color .3s var(--tcc-easing-arrive), color .3s var(--tcc-easing-arrive), transform .2s; }
.tcc-quotes__btn::before { content: ''; width: 18px; height: 18px; background: currentColor;
  -webkit-mask: url('data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 16 16%22%3E%3Cpath d=%22M2 8h11M9 4l4 4-4 4%22 fill=%22none%22 stroke=%22black%22 stroke-width=%221.6%22/%3E%3C/svg%3E') center / contain no-repeat;
          mask: url('data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 16 16%22%3E%3Cpath d=%22M2 8h11M9 4l4 4-4 4%22 fill=%22none%22 stroke=%22black%22 stroke-width=%221.6%22/%3E%3C/svg%3E') center / contain no-repeat; }
.tcc-quotes__btn--prev::before { transform: scaleX(-1); }
@media (hover: hover) { .tcc-quotes__btn:hover { background: var(--q-ink); color: var(--tcc-brand); } }
.tcc-quotes__btn:active { transform: scale(.94); }
.tcc-quotes__btn:focus-visible, .tcc-quotes__dot:focus-visible { outline: 2px solid var(--q-ink); outline-offset: 3px; }

/* desktop: an editorial pair of columns. Who said it sits left, level with the quote's first line; the quote runs wide on the right */
@media (min-width: 1024px) {
  .tcc-quotes__in {
    --q-meta: clamp(220px, 20vw, calc(300px + var(--tcc-up) * .2));
    --q-gap: clamp(40px, 5vw, calc(96px + var(--tcc-up) * .05));
    --tcc-write-size: clamp(34px, 3.6vw, calc(56px + var(--tcc-up) * .05));
    width: min(100% - 2 * var(--tcc-edge), calc(1440px + var(--tcc-up) * .45));
    display: grid; grid-template-columns: var(--q-meta) minmax(0, 1fr); column-gap: var(--q-gap);
  }
  .tcc-quotes .tcc-quotes__h { grid-column: 2; }
  .tcc-quotes__track, .tcc-quotes__nav { grid-column: 1 / -1; }
  .tcc-quotes__slide { display: grid; grid-template-columns: var(--q-meta) minmax(0, 1fr); column-gap: var(--q-gap); align-items: start; }
  .tcc-quotes__q { grid-column: 2; grid-row: 1; }
  .tcc-quotes__q p { max-width: 19em; }
  .tcc-quotes__by { grid-column: 1; grid-row: 1; margin-top: 0; padding-top: calc(var(--tcc-write-size) * .3);
    flex-direction: column; align-items: flex-start; gap: 10px; }
  .tcc-quotes__meta { flex-direction: column; align-items: flex-start; gap: 14px; }
  .tcc-quotes__dotsep { display: none; }
  .tcc-quotes__about img { width: 40px; height: 40px; }
  .tcc-quotes__nav { display: none; grid-template-columns: var(--q-meta) minmax(0, 1fr); column-gap: var(--q-gap); }
  .tcc-quotes.is-live .tcc-quotes__nav { display: grid; }
  .tcc-quotes__dots { grid-column: 2; margin: 0 0 0 -8px; }
  .tcc-quotes__arrows { grid-column: 1; }
}
@media (max-width: 767px) {
  .tcc-quotes__in { --tcc-write-size: clamp(26px, 7vw, 30px); }
  .tcc-quotes__by { flex-direction: column; align-items: flex-start; gap: 8px; }
  .tcc-quotes__dot { width: 34px; }
  .tcc-quotes__dot::before { width: 20px; }
  .tcc-quotes__btn { width: 48px; height: 48px; }
}
@media (prefers-reduced-motion: reduce) {
  .tcc-quotes.is-live .tcc-quotes__slide, .tcc-quotes.is-live .tcc-quotes__by { transition: none; }
}
