/* =============================================================================
 * Testimonial card component — Trade Journal AI
 * =============================================================================
 * Added 2026-05-23 as part of audit fix #01 (social-proof scaffold).
 *
 * Three variants — same data, different visual treatment per surface:
 *   .testimonial-hero    — large single-quote card for above-the-fold hero use
 *   .testimonial-trust   — medium card for trust-band placements (price page,
 *                          stacks 2-3 horizontally on desktop, 1-up on mobile)
 *   .testimonial-compact — small card for in-article / verdict-zone placements
 *                          (compare pages, learn pillars, side rails)
 *
 * Empty-state behavior — handled by JS via display:none on the slot itself
 * when no eligible testimonials exist for that surface. CSS doesn't need to
 * style empty slots; they're removed from the flow entirely.
 *
 * Brand-aligned via existing CSS variables (--color-primary, --color-ink, etc.)
 * with hardcoded fallbacks so it works on pages that don't define them.
 * ========================================================================== */

.testimonial-slot {
  /* Slots are styled minimally so they don't add chrome when empty.
     The card itself carries the visible weight. */
  display: block;
}

.testimonial-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin: 0;
  padding: 26px 28px;
  background: var(--color-card, #ffffff);
  border: 1px solid var(--color-line, #e6e4dc);
  border-radius: 14px;
  box-shadow: 0 4px 24px -8px rgba(15,20,17,0.10);
  position: relative;
  overflow: hidden;
  font-family: 'Poppins', system-ui, -apple-system, sans-serif;
}

/* Subtle blue accent line on the left edge — echoes the brand primary
   without dominating. Falls back gracefully if the variable is missing. */
.testimonial-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--color-primary, #0081E8);
  opacity: 0.85;
}

.testimonial-card .ts-quote {
  font-family: 'Poppins', system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--color-ink, #0f1411);
  margin: 0;
  font-style: normal;
  font-weight: 500;
  /* Subtle hanging quote mark via ::before on the blockquote */
  position: relative;
}
.testimonial-card .ts-quote::before {
  content: '\201C'; /* curly opening quote U+201C */
  position: absolute;
  left: -8px; top: -10px;
  font-family: 'Montserrat', serif;
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--color-primary, #0081E8);
  opacity: 0.30;
  line-height: 1;
  pointer-events: none;
}

.testimonial-card .ts-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
}

.testimonial-card .ts-avatar {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--color-paper-2, #ede8d6);
}

.testimonial-card .ts-avatar-letter {
  /* Initial-letter fallback when no photo is supplied */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary, #0081E8);
  color: #ffffff;
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: 1.15rem;
  text-transform: uppercase;
}

.testimonial-card .ts-attribution {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.testimonial-card .ts-name {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--color-ink, #0f1411);
  line-height: 1.2;
}

.testimonial-card .ts-role {
  font-size: 0.78rem;
  color: var(--color-muted, #5a5e59);
  line-height: 1.35;
}

.testimonial-card .ts-source {
  margin-left: auto;
  font-size: 0.74rem;
  color: var(--color-muted, #5a5e59);
  text-decoration: none;
  white-space: nowrap;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--color-line, #e6e4dc);
  transition: border-color 0.15s, color 0.15s;
}
.testimonial-card .ts-source:hover {
  color: var(--color-primary, #0081E8);
  border-color: rgba(0,129,232,0.35);
}

/* ============================================================
 * HERO variant — large, above-the-fold single quote
 * ============================================================ */
.testimonial-hero {
  padding: 36px 38px;
  max-width: 720px;
}
.testimonial-hero .ts-quote {
  font-size: 1.25rem;
  line-height: 1.5;
  font-weight: 500;
}
.testimonial-hero .ts-quote::before {
  font-size: 3rem;
  left: -12px;
  top: -16px;
}
.testimonial-hero .ts-avatar {
  width: 56px;
  height: 56px;
}
.testimonial-hero .ts-avatar-letter {
  font-size: 1.4rem;
}
.testimonial-hero .ts-name { font-size: 1rem; }
.testimonial-hero .ts-role { font-size: 0.86rem; }

/* ============================================================
 * TRUST variant — medium card, used in stacks on the trust band
 * ============================================================ */
.testimonial-trust {
  padding: 22px 24px;
}
.testimonial-trust .ts-quote {
  font-size: 0.95rem;
  line-height: 1.5;
}

/* When multiple trust cards render in the same slot, lay them out
   side-by-side on desktop, stacked on mobile. The slot becomes a
   flex container; cards become flex children. */
.testimonial-slot[data-variant="trust"].is-populated {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}

/* ============================================================
 * COMPACT variant — small in-article/verdict-zone card
 * ============================================================ */
.testimonial-compact {
  padding: 18px 22px;
  gap: 14px;
}
.testimonial-compact .ts-quote {
  font-size: 0.92rem;
  line-height: 1.5;
}
.testimonial-compact .ts-quote::before {
  font-size: 1.8rem;
  left: -6px;
  top: -8px;
}
.testimonial-compact .ts-avatar {
  width: 38px;
  height: 38px;
}
.testimonial-compact .ts-avatar-letter {
  font-size: 1rem;
}
.testimonial-compact .ts-name { font-size: 0.88rem; }
.testimonial-compact .ts-role { font-size: 0.74rem; }

/* ============================================================
 * Mobile breakpoints — single-column, tighter padding
 * ============================================================ */
@media (max-width: 600px) {
  .testimonial-card { padding: 22px 22px; }
  .testimonial-hero { padding: 28px 26px; }
  .testimonial-hero .ts-quote { font-size: 1.08rem; }
  .testimonial-slot[data-variant="trust"].is-populated {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
 * Reduced motion — no transitions on the source-link hover
 * ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .testimonial-card .ts-source { transition: none; }
}
