/* =========================================================
   FaceUpper — testimonials carousel + quote cards (shared)
   Chrome is built by js/testimonials.js inside an empty
   <div class="tcar"></div>; cards come from testimonials-data.js.
   Token-only colors: each page's CSS remaps --fu-bloom-* etc.
   to the Aga Nowak kit, so no raw hex belongs in this file.
   ========================================================= */

.tcar { max-width: 1180px; margin: clamp(30px, 3.8vw, 56px) auto 0; }
.tcar__track {
  list-style: none; margin: 0; padding: 4px;
  display: flex; align-items: stretch; gap: clamp(14px, 1.8vw, 24px);
  overflow-x: auto; scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.tcar__track::-webkit-scrollbar { display: none; }
.tcar__card {
  flex: 0 0 calc((100% - 2 * clamp(14px, 1.8vw, 24px)) / 3);
  scroll-snap-align: start;
  display: flex;
}
.tcar__card .quote { flex: 1 1 auto; min-height: clamp(380px, 38vw, 500px); }
.tcar__nav {
  margin-top: clamp(18px, 2.4vw, 28px);
  display: flex; align-items: center; justify-content: center;
  gap: clamp(14px, 2vw, 22px);
}
.tcar__btn {
  width: 44px; height: 44px; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--fu-bloom-500); border-radius: 50%;
  background: transparent; color: var(--fu-bloom-500);
  font-size: 20px; line-height: 1; cursor: pointer;
  transition: background var(--fu-dur-base) var(--fu-ease-out),
              color var(--fu-dur-base) var(--fu-ease-out),
              border-color var(--fu-dur-base) var(--fu-ease-out),
              opacity var(--fu-dur-base) var(--fu-ease-out);
}
.tcar__btn span { transform: translateY(-1px); }
.tcar__btn:hover:not(:disabled) { background: var(--fu-bloom-500); color: var(--fu-bone-50); }
.tcar__btn:disabled { opacity: .35; cursor: default; border-color: var(--fu-mist-300); color: var(--fu-ink-700); }
.tcar__dots { display: flex; align-items: center; gap: 8px; }
.tcar__dot {
  width: 8px; height: 8px; padding: 0; border: 0; cursor: pointer;
  border-radius: var(--fu-radius-pill);
  background: var(--fu-mist-300);
  transition: width var(--fu-dur-base) var(--fu-ease-out),
              background var(--fu-dur-base) var(--fu-ease-out);
}
.tcar__dot:hover { background: var(--fu-bloom-300); }
.tcar__dot[aria-current="true"] { width: 26px; background: var(--fu-bloom-500); }
.exp-more {
  margin: clamp(16px, 2vw, 24px) auto 0;
  text-align: center; font-size: 15px; letter-spacing: .01em;
}
.exp-more a {
  color: var(--fu-ink-900);
  border-bottom: 1px solid currentColor; padding-bottom: 2px;
}
.exp-more a:hover { color: var(--fu-bloom-600); }

#exp-video {
  max-width: 760px;
  margin: clamp(26px, 3vw, 40px) auto 0;
}

/* ---------- Video tile (homepage mount + testimonianze mosaic) ---------- */
.mvideo {
  margin: 0;
  display: flex; flex-direction: column;
  background: var(--fu-bone-50);
  border: 1px solid var(--fu-border);
  border-radius: clamp(20px, 2.2vw, 32px);
  overflow: hidden;
}
.mvideo__media {
  aspect-ratio: 16 / 9; /* V01 is 1280×720 */
  min-height: 0;
  display: flex;
  background: var(--fu-ink-900);
}
.mvideo video {
  width: 100%; height: 100%;
  object-fit: contain;
}
.mvideo figcaption {
  padding: 16px 22px;
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  border-top: 1px solid var(--fu-border);
  font-size: 14px; color: var(--fu-text);
}
.mvideo figcaption em { font-family: var(--fu-font-display); }
.mvideo figcaption .mvideo__tag {
  font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--fu-text-muted);
}

/* ---------- Quote cards ---------- */
.quote {
  margin: 0; padding: clamp(22px, 2.4vw, 34px);
  background: var(--fu-bone-50);
  border: 1px solid var(--fu-border);
  border-radius: clamp(24px, 2.6vw, 38px);
  display: flex; flex-direction: column;
}
.quote blockquote {
  /* Auto vertical margins center short quotes in equal-height cards
     while keeping the figcaption pinned to the bottom edge. In
     block-display contexts (e.g. the testimonianze wall) they collapse. */
  margin: auto 0;
  font-family: var(--fu-font-display); font-size: clamp(17px, 1.35vw, 20px);
  line-height: 1.48; letter-spacing: -.01em; color: var(--fu-ink-900);
}
.quote blockquote::before {
  /* Large decorative opening mark so short quotes read as composed. */
  content: "“";
  display: block; height: .58em;
  font-size: 48px; line-height: 1;
  color: var(--fu-bloom-500); opacity: .3;
}
.quote figcaption {
  margin-top: 18px; padding-top: 14px;
  border-top: 1px solid var(--fu-border);
  font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--fu-text-muted);
}
.quote--img { padding: clamp(10px, 1vw, 14px); }
.quote--img img {
  width: 100%; height: 100%; flex: 1 1 auto; min-height: 0;
  object-fit: contain; /* story graphics are shown whole, never cropped */
}
/* ---------- Before/after slider card ----------
   Photo pair (two matching crops of one story graphic) with an
   interactive Prima/Dopo divider, then the age line and the student's
   message as text. --pos (0–100%) is set by js/testimonials.js from
   the invisible full-area range input; the "ba-cmp" prefix is unique
   so it cannot collide with .ba on testimonianze.html. */
.quote--ba {
  padding: clamp(10px, 1vw, 14px);
}
.ba-cmp {
  --pos: 100%;
  position: relative;
  border-radius: clamp(16px, 1.8vw, 24px);
  overflow: hidden;
  background: var(--fu-cream-100);
}
.ba-cmp img {
  /* All crop pairs in media/testimonials/ are produced at 3:5, so the
     display ratio matches the files and nothing is cover-cropped. */
  display: block; width: 100%; height: auto;
  aspect-ratio: 3 / 5; object-fit: cover;
}
.ba-cmp__clip {
  position: absolute; inset: 0;
  clip-path: inset(0 calc(100% - var(--pos)) 0 0);
}
.ba-cmp__clip img { height: 100%; }
.ba-cmp__range {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  margin: 0; padding: 0;
  opacity: 0;
  cursor: ew-resize;
  -webkit-appearance: none;
  appearance: none;
}
.ba-cmp__line {
  position: absolute; top: 0; bottom: 0;
  left: var(--pos); transform: translateX(-50%);
  width: 1px;
  background: var(--fu-gold-500);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--fu-dur-base) var(--fu-ease-out);
}
.ba-cmp__handle {
  position: absolute; top: 50%; left: var(--pos);
  transform: translate(-50%, -50%);
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--fu-bone-50); color: var(--fu-gold-500);
  border: 1px solid var(--fu-gold-500);
  font-size: 13px; line-height: 1;
  letter-spacing: 2px; text-indent: 2px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--fu-dur-base) var(--fu-ease-out),
              box-shadow var(--fu-dur-base) var(--fu-ease-out);
}
.ba-cmp:hover .ba-cmp__line,
.ba-cmp:hover .ba-cmp__handle,
.ba-cmp:focus-within .ba-cmp__line,
.ba-cmp:focus-within .ba-cmp__handle,
.ba-cmp--reveal .ba-cmp__line,
.ba-cmp--reveal .ba-cmp__handle,
.ba-cmp--drag .ba-cmp__line,
.ba-cmp--drag .ba-cmp__handle {
  opacity: 1;
}
.ba-cmp__range:focus-visible ~ .ba-cmp__handle {
  box-shadow: 0 0 0 3px var(--fu-bloom-300);
  opacity: 1;
}
.ba-cmp__lab {
  /* Real buttons: clicking a chip slides the divider to that extreme
     (handled by the delegated click listener in js/testimonials.js). */
  position: absolute; bottom: 10px;
  padding: 5px 11px;
  border: 0;
  border-radius: var(--fu-radius-pill);
  background: var(--fu-bone-50); color: var(--fu-bloom-500);
  font: inherit;
  font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
  cursor: pointer;
  transition: opacity var(--fu-dur-base) var(--fu-ease-out);
}
.ba-cmp__lab:focus-visible {
  outline: 2px solid var(--fu-bloom-500); outline-offset: 2px;
}
/* The chip of the side that has slid (mostly) out of view fades:
   at --posn 0 only the after photo shows, so "Prima" dims — and vice
   versa. clamp() gives a continuous fade over the last 20% of travel
   down to a floor of .35 (still readable, still clickable). */
.ba-cmp__lab--prima {
  left: 10px;
  opacity: clamp(.35, calc(var(--posn, 50) / 20), 1);
}
.ba-cmp__lab--dopo {
  right: 10px;
  opacity: clamp(.35, calc((100 - var(--posn, 50)) / 20), 1);
}
/* Chip-click jumps animate; drags stay 1:1 with the pointer because
   .ba-cmp--anim is only set for the duration of the jump. */
.ba-cmp--anim .ba-cmp__clip {
  transition: clip-path .35s var(--fu-ease-out);
}
.ba-cmp--anim .ba-cmp__line {
  transition: left .35s var(--fu-ease-out);
}
.ba-cmp--anim .ba-cmp__handle {
  transition: left .35s var(--fu-ease-out),
              opacity var(--fu-dur-base) var(--fu-ease-out),
              box-shadow var(--fu-dur-base) var(--fu-ease-out);
}
.ba-cmp--reveal.ba-cmp--anim .ba-cmp__clip {
  transition: clip-path 1.15s var(--fu-ease-out);
}
.ba-cmp--reveal.ba-cmp--anim .ba-cmp__line,
.ba-cmp--reveal.ba-cmp--anim .ba-cmp__handle {
  transition: left 1.15s var(--fu-ease-out),
              opacity var(--fu-dur-base) var(--fu-ease-out);
}
.quote--ba figcaption {
  /* Pinned right under the photo so the name line sits at the same
     height on every card (photos are all 3:5, so equally tall); the
     auto bottom margin on the text below absorbs the leftover space. */
  margin-top: 0; padding: 14px clamp(8px, .9vw, 12px) 0;
  border-top: 0;
  text-align: center;
}
.quote--ba blockquote {
  margin: 10px 0 auto;
  padding: 0 clamp(8px, .9vw, 12px);
  font-size: clamp(15.5px, 1.2vw, 18px);
  text-align: center;
}
.quote--ba blockquote::before { display: none; }
/* Brand-caption slider cards (P02/P07): FaceUpper's own observation,
   typeset without quotation marks under a small gold eyebrow so it
   cannot read as a customer quote. */
.quote--ba .quote__obs-label,
.quote .quote__label {
  margin: 12px 0 0;
  text-align: center;
  font-family: var(--fu-font-sans);
  font-size: 10px; font-weight: 400; font-style: normal;
  line-height: 1.5; letter-spacing: .14em; text-transform: uppercase;
  color: var(--fu-gold-500);
}
.quote--ba .quote__obs {
  margin: 8px 0 auto;
  padding: 0 clamp(8px, .9vw, 12px);
  font-family: var(--fu-font-display);
  font-size: clamp(15.5px, 1.2vw, 18px);
  line-height: 1.48; letter-spacing: -.01em; color: var(--fu-ink-900);
  text-align: center;
}

.quote__badge {
  align-self: flex-start;
  display: inline-flex; align-items: center;
  padding: 5px 11px; margin-bottom: 14px;
  border-radius: var(--fu-radius-pill);
  background: var(--fu-bloom-100); color: var(--fu-bloom-600);
  font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
}
.quote__role { display: block; margin-top: 5px; letter-spacing: .08em; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .tcar__card { flex-basis: calc((100% - clamp(14px, 1.8vw, 24px)) / 2); }
}
@media (max-width: 520px) {
  .tcar__card { flex-basis: 86%; }
  .tcar__card .quote { min-height: clamp(340px, 96vw, 440px); }
}
@media (prefers-reduced-motion: reduce) {
  .ba-cmp--anim .ba-cmp__clip,
  .ba-cmp--anim .ba-cmp__line,
  .ba-cmp--anim .ba-cmp__handle,
  .ba-cmp--reveal.ba-cmp--anim .ba-cmp__clip,
  .ba-cmp--reveal.ba-cmp--anim .ba-cmp__line,
  .ba-cmp--reveal.ba-cmp--anim .ba-cmp__handle { transition: none; }
}

/* Local before/after cards on programme pages. */
.testimonial-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(12px, 1.4vw, 18px);
  margin-top: clamp(28px, 3.6vw, 52px);
  align-items: stretch;
  grid-auto-rows: 1fr;
}
.testimonial-grid .ba-cmp { flex-shrink: 0; }
.testimonial-grid .quote__obs { margin-top: 10px; }
@media (max-width: 1080px) {
  .testimonial-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .testimonial-grid { grid-template-columns: minmax(0, 1fr); grid-auto-rows: auto; }
}
