/*
 * Denovers · Testimonial components
 * Three patterns sharing one design language:
 *   .tm-list  · stacked single Eleken cards (case-study & long-form pages)
 *   .tms-     · auto-rotating slider (industry pages)
 *   .tm-wall  · 3-column wall with Clutch badge (homepage & aggregate)
 *
 * Pair with /assets/testimonials.js (data source + slider renderer).
 * Industry-tint avatar fallback classes: pc-{ai|health|prop|fin|saas|climate}
 */

/* ============================================================================
 * Shared · industry avatar tints (when no headshot is available)
 * ========================================================================== */
.tm-avatar.is-initials.pc-ai,
.tms-avatar.is-initials.pc-ai,
.tw-avatar.is-initials.pc-ai     { background: #EEF2F7; }
.tm-avatar.is-initials.pc-health,
.tms-avatar.is-initials.pc-health,
.tw-avatar.is-initials.pc-health { background: #FAEEE7; }
.tm-avatar.is-initials.pc-prop,
.tms-avatar.is-initials.pc-prop,
.tw-avatar.is-initials.pc-prop   { background: #F4EEF6; }
.tm-avatar.is-initials.pc-fin,
.tms-avatar.is-initials.pc-fin,
.tw-avatar.is-initials.pc-fin    { background: #F0F4EE; }
.tm-avatar.is-initials.pc-saas,
.tms-avatar.is-initials.pc-saas,
.tw-avatar.is-initials.pc-saas   { background: #F5F2EA; }
.tm-avatar.is-initials.pc-climate,
.tms-avatar.is-initials.pc-climate,
.tw-avatar.is-initials.pc-climate{ background: #E8F3EE; }

/* ============================================================================
 * .tm-list  ·  Stacked single Eleken card (long-form testimonial moment)
 *
 * Markup pattern:
 *   <section class="tm-list">
 *     <div class="wrap">
 *       <article class="tm-card">
 *         <div class="tm-clutch">...</div>
 *         <blockquote class="tm-quote">...</blockquote>
 *         <div class="tm-author">
 *           <div class="tm-avatar pc-fin" data-initials="AB">
 *             <img src="..." alt="..." onerror="..." />
 *           </div>
 *           <span class="tm-name">...</span>
 *           <span class="tm-role">...</span>
 *         </div>
 *       </article>
 *     </div>
 *   </section>
 * ========================================================================== */
.tm-list { padding: clamp(20px, 3vw, 40px) 0 clamp(80px, 10vw, 128px); background: #F6F9FC; }
.tm-list .wrap { display: flex; flex-direction: column; gap: clamp(24px, 3vw, 40px); max-width: 1180px; }

.tm-card {
  background: var(--paper);
  border: 1px solid var(--line-2);
  border-radius: 4px;
  padding: clamp(68px, 6.5vw, 104px) clamp(32px, 4vw, 64px) clamp(60px, 5.8vw, 88px);
  display: flex; flex-direction: column; gap: clamp(32px, 3.4vw, 44px);
  position: relative;
}
.tm-clutch { display: flex; align-items: center; justify-content: center; gap: 14px; }
.tm-clutch-logo { font-family: var(--sans); font-weight: 700; font-size: 15px; letter-spacing: -0.01em; color: var(--ink); display: inline-flex; align-items: center; }
.tm-clutch-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #E62415; margin-left: 1px; transform: translateY(-1px); }
.tm-clutch-stars { color: #F2B707; font-size: 13px; letter-spacing: 0.06em; }
.tm-quote {
  font-family: var(--sans);
  font-size: clamp(20px, 2.1vw, 28px);
  line-height: 1.45;
  letter-spacing: -0.016em;
  color: var(--ink);
  font-weight: 400;
  text-align: center;
  margin: 0;
  max-width: 60ch;
  align-self: center;
}
.tm-quote::before { content: '\201C'; }
.tm-quote::after  { content: '\201D'; }
.tm-author { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 8px; }
.tm-avatar {
  width: 56px; height: 56px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  overflow: hidden; position: relative;
  background: var(--paper-2);
}
.tm-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tm-avatar.is-initials::before {
  content: attr(data-initials);
  font-family: var(--sans); font-weight: 600; font-size: 17px;
  color: var(--ink);
  letter-spacing: -0.015em;
}
.tm-name { font-family: var(--sans); font-weight: 600; font-size: 15.5px; letter-spacing: -0.015em; color: var(--ink); }
.tm-role { font-family: var(--sans); font-size: 13px; line-height: 1.4; color: var(--muted); text-align: center; max-width: 48ch; }

@media (max-width: 640px) {
  .tm-card { padding: 28px 22px; gap: 18px; }
  .tm-quote { font-size: 16px; line-height: 1.5; }
}

/* ============================================================================
 * .tms-section  ·  Rotating slider (industry pages)
 *
 * Markup pattern (renderer populates .tms-stage):
 *   <section class="tms-section" data-tm-slider data-tm-ids="all">
 *     <div class="wrap">
 *       <div class="tms-head">
 *         <span class="tms-kick">In their words</span>
 *         <h2>From the people we built with.</h2>
 *       </div>
 *       <div class="tms-stage"></div>
 *     </div>
 *   </section>
 *
 * data-tm-ids: "all" (default) | comma-separated list of ids, e.g. "alexander-back,andrew-crebar"
 * ========================================================================== */
.tms-section { background: #F6F9FC; padding: clamp(64px, 8vw, 112px) 0; }
.tms-section .wrap { max-width: 1180px; }
.tms-head { text-align: center; max-width: 50ch; margin: 0 auto clamp(22px, 2.6vw, 32px); display: flex; flex-direction: column; gap: 8px; align-items: center; }
.tms-kick { font-family: var(--mono); font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-2); display: inline-flex; align-items: center; gap: 8px; }
.tms-kick::before { content: ''; display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.tms-head h2 { font-family: var(--sans); font-weight: 500; font-size: clamp(22px, 2.2vw, 28px); line-height: 1.18; letter-spacing: -0.02em; color: var(--ink); margin: 0; }
.tms-stage { position: relative; }

.tms-card {
  background: var(--paper);
  border: 1px solid var(--line-2);
  border-radius: 4px;
  padding: clamp(68px, 6.5vw, 104px) clamp(32px, 4vw, 64px) clamp(60px, 5.8vw, 88px);
  display: flex; flex-direction: column; gap: clamp(32px, 3.4vw, 44px);
  position: relative;
}
.tms-clutch { display: flex; align-items: center; justify-content: center; gap: 14px; }
.tms-clutch-logo { font-family: var(--sans); font-weight: 700; font-size: 15px; letter-spacing: -0.01em; color: var(--ink); display: inline-flex; align-items: center; }
.tms-clutch-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #E62415; margin-left: 1px; transform: translateY(-1px); }
.tms-clutch-stars { color: #F2B707; font-size: 13px; letter-spacing: 0.06em; }
.tms-quote {
  font-family: var(--sans);
  font-size: clamp(20px, 2.1vw, 28px);
  line-height: 1.45;
  letter-spacing: -0.016em;
  color: var(--ink);
  font-weight: 400;
  text-align: center;
  margin: 0;
  max-width: 60ch;
  align-self: center;
}
.tms-quote::before { content: '\201C'; }
.tms-quote::after  { content: '\201D'; }
.tms-author { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 8px; }
.tms-avatar {
  width: 56px; height: 56px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  overflow: hidden; position: relative;
  background: var(--paper-2);
}
.tms-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tms-avatar.is-initials::before { content: attr(data-initials); font-family: var(--sans); font-weight: 600; font-size: 17px; color: var(--ink); letter-spacing: -0.015em; }
.tms-name { font-family: var(--sans); font-weight: 600; font-size: 15.5px; letter-spacing: -0.015em; color: var(--ink); }
.tms-role { font-family: var(--sans); font-size: 13px; line-height: 1.4; color: var(--muted); text-align: center; max-width: 48ch; }

/* Slider-specific · fade swap on content change */
.tms-quote, .tms-author { transition: opacity .28s ease; }
.tms-card.is-changing .tms-quote,
.tms-card.is-changing .tms-author { opacity: 0; }

/* Arrows · bottom-right corner of card */
.tms-nav {
  position: absolute;
  right: clamp(20px, 3vw, 36px);
  bottom: clamp(20px, 3vw, 32px);
  display: inline-flex; align-items: center; gap: 10px;
}
.tms-arr {
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid rgba(12,12,10,0.16);
  background: var(--paper); color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 16px; line-height: 1;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.tms-arr:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }

@media (max-width: 640px) {
  .tms-card { padding: 28px 22px 72px; gap: 18px; }
  .tms-quote { font-size: 16px; line-height: 1.5; }
  .tms-nav { right: 50%; transform: translateX(50%); bottom: 18px; }
  .tms-arr { width: 38px; height: 38px; font-size: 15px; }
}

/* ============================================================================
 * .tm-wall  ·  3-column credibility wall (homepage & aggregate landings)
 *
 * Markup pattern (hand-written per page — see testimonials.html for example):
 *   <section class="tm-wall">
 *     <div class="wrap">
 *       <header class="tw-head">
 *         <div class="tw-head-text">
 *           <h2>From the people <em>we built with.</em></h2>
 *         </div>
 *         <div class="tw-clutch">...Clutch + 5 stars...</div>
 *       </header>
 *       <div class="tw-grid">
 *         <div class="tw-col"> ...cards... </div>
 *         <div class="tw-col"> ...cards + .is-badge tile... </div>
 *         <div class="tw-col"> ...cards... </div>
 *       </div>
 *     </div>
 *   </section>
 *
 * Card variants:
 *   .tw-card             · standard logo + quote card
 *   .tw-card.is-photo    · full-bleed headshot photo overlay
 *   .tw-card.is-badge    · Clutch credential tile (centered image)
 * ========================================================================== */
.tm-wall { background: #F6F9FC; padding: clamp(72px, 9vw, 128px) 0; }
.tm-wall .wrap { max-width: 1240px; }

/* Header · H2 left, Clutch chip right */
.tw-head { display: flex; align-items: baseline; justify-content: space-between; gap: 24px; margin-bottom: clamp(28px, 3.4vw, 44px); }
.tw-head-text { flex: 1; min-width: 0; }
.tw-head h2 { font-family: var(--sans); font-weight: 500; font-size: clamp(28px, 3.4vw, 40px); line-height: 1; letter-spacing: -0.022em; color: var(--ink); margin: 0; max-width: 22ch; }
.tw-head h2 em { font-style: normal; color: var(--ink); font-weight: 500; }
.tw-clutch { display: inline-flex; align-items: baseline; gap: 16px; flex-shrink: 0; line-height: 1; }
.tw-clutch-logo { font-family: var(--sans); font-weight: 700; font-size: clamp(24px, 2.6vw, 32px); letter-spacing: -0.018em; color: var(--ink); display: inline-flex; align-items: baseline; line-height: 1; }
.tw-clutch-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #E62415; margin-left: 3px; align-self: flex-start; transform: translateY(2px); }
.tw-clutch-stars { color: #F2B707; font-size: clamp(16px, 1.5vw, 20px); letter-spacing: 0.08em; line-height: 1; }

/* Grid · 3 explicit columns each with its own flex flow */
.tw-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: start; }
.tw-col { display: flex; flex-direction: column; gap: 16px; }

/* Base card */
.tw-card {
  background: var(--paper);
  border: 1px solid var(--line-2);
  border-radius: 4px;
  padding: clamp(22px, 2.4vw, 32px);
  display: flex; flex-direction: column; gap: clamp(18px, 2vw, 26px);
  position: relative;
  overflow: hidden;
}
.tw-card .tw-logo { font-family: var(--sans); font-weight: 600; font-size: 16px; letter-spacing: -0.014em; color: var(--ink); display: inline-block; }
.tw-quote-mark { font-family: Georgia, serif; font-size: 38px; line-height: 0.6; color: var(--ink); opacity: 0.18; height: 14px; }
.tw-quote { font-family: var(--sans); font-size: 15px; line-height: 1.5; letter-spacing: -0.012em; color: var(--ink); margin: 0; flex: 1; font-weight: 400; }
.tw-author { display: flex; align-items: center; gap: 12px; margin-top: auto; }
.tw-avatar { width: 36px; height: 36px; border-radius: 50%; overflow: hidden; flex-shrink: 0; background: var(--paper-2); display: inline-flex; align-items: center; justify-content: center; position: relative; }
.tw-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tw-avatar.is-initials::before { content: attr(data-initials); font-family: var(--sans); font-weight: 600; font-size: 12px; color: var(--ink); letter-spacing: -0.015em; }
.tw-meta { display: flex; flex-direction: column; gap: 1px; line-height: 1.3; }
.tw-name { font-family: var(--sans); font-weight: 600; font-size: 13.5px; color: var(--ink); letter-spacing: -0.012em; }
.tw-role { font-family: var(--sans); font-size: 12px; color: var(--muted); }

/* Photo-overlay variant · full-bleed headshot, text on bottom */
.tw-card.is-photo { padding: 0; aspect-ratio: 4 / 5; border: 0; display: block; }
.tw-card.is-photo .tw-photo-bg { position: absolute; inset: 0; background-position: center; background-size: cover; background-repeat: no-repeat; }
.tw-card.is-photo .tw-photo-grad { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 30%, rgba(0,0,0,0.55) 70%, rgba(0,0,0,0.85) 100%); }
.tw-card.is-photo .tw-photo-body { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: clamp(22px, 2.4vw, 28px); display: flex; flex-direction: column; gap: 12px; color: var(--paper); }
.tw-card.is-photo .tw-quote-mark { color: var(--paper); opacity: 0.5; }
.tw-card.is-photo .tw-quote { color: var(--paper); font-size: 15px; line-height: 1.45; }
.tw-card.is-photo .tw-meta-photo { display: flex; flex-direction: column; gap: 1px; line-height: 1.3; }
.tw-card.is-photo .tw-name { color: var(--paper); }
.tw-card.is-photo .tw-role { color: rgba(255,255,255,0.7); }

/* Clutch badge tile · slot for the Clutch credential PNG */
.tw-card.is-badge { background: var(--paper); border: 1px solid var(--line-2); align-items: center; justify-content: center; padding: clamp(28px, 3vw, 40px); }
.tw-card.is-badge img { max-width: 78%; max-height: 240px; width: auto; height: auto; object-fit: contain; display: block; }

@media (max-width: 960px) {
  .tw-head { flex-direction: column; align-items: flex-start; gap: 18px; }
  .tw-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
  /* Mobile · each existing .tw-col becomes a swipable slide (Eleken pattern).
     3 columns of cards → 3 horizontal slides. Cards inside a slide stack
     vertically as usual; user swipes between slides to see the next group. */
  .tm-wall .wrap { padding-left: 0; padding-right: 0; }
  .tw-head { padding: 0 20px; }
  .tw-grid {
    display: flex;
    grid-template-columns: none;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 12px;
    padding: 4px 20px 20px;
    scroll-padding-left: 20px;
    scrollbar-width: none;
  }
  .tw-grid::-webkit-scrollbar { display: none; }
  .tw-col {
    flex: 0 0 86vw;
    max-width: 360px;
    scroll-snap-align: start;
    gap: 12px;
  }
  .tw-card.is-photo { aspect-ratio: 4 / 5; }
}
