/* testimonial block (Phase 3 Stage 4).
   CSS ported from design-export/base.css; no literal colour, every value a token.
   figure testimonial on dark quote */

.testimonial { margin: 0; }
.testimonial .quote { background: var(--surface-dark); color: var(--white); border-radius: var(--radius-md); padding: 1.6rem 1.7rem; }
/* typography.css sets `blockquote { color: var(--text-heading) }`, and a direct
   rule beats the white inherited from .quote. On nlc --text-heading resolves to
   the same navy as --surface-dark, so the quote rendered navy-on-navy at 1.00:1,
   i.e. invisible. The quote panel owns its own foreground. */
.testimonial .quote blockquote { color: inherit; }
/* Drop typography.css's WYSIWYG blockquote treatment (4px accent rule + inset) —
   the testimonial quote is its own component and reads flush. */
.testimonial .quote blockquote { border-left: 0; padding-left: 0; margin: 0; max-width: none; }
.testimonial blockquote p { font-family: var(--font-display); font-weight: 400; font-size: 1.5625rem; line-height: 1.4; margin-bottom: 1.1rem; }
.testimonial blockquote em { font-style: italic; color: var(--accent-on-dark); }
.testimonial figcaption { display: flex; align-items: center; gap: .75rem; font-family: var(--font-display); font-weight: 800; font-size: 1.3125rem; }
.testimonial figcaption cite { display: block; font-family: var(--font-body); font-weight: 400; font-size: var(--fs-min); color: rgba(var(--on-dark-rgb), .75); }
.testimonial-image { border-radius: var(--radius-md); overflow: hidden; }
.testimonial__avatar { flex: 0 0 auto; width: 48px; height: 48px; border-radius: 50%; background: repeating-linear-gradient(135deg, rgba(var(--on-dark-rgb), .18) 0 6px, rgba(var(--on-dark-rgb), .08) 6px 12px); }

/* --- bg-inherit display style: a full-bleed portrait sits behind the quote
   panel. This layout was DROPPED in the Stage 4 CSS port, so the carousel slides
   had no internal structure and rendered as an unconstrained quote stacked on a
   full-size image, which then stretched every slide (the "broken carousel").
   Re-ported from the source theme and adapted for the carousel: the figure is
   the positioning context (isolate) so the absolute image stays behind its own
   quote, not the whole track. Layout only; colours live on .quote above. */
.testimonial-bg-inherit {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-rows: auto auto;
  grid-template-areas: "image" "quote";
  gap: 0;
  width: 100%;
}
.testimonial-bg-inherit .testimonial-image { grid-area: image; margin: 0; }
.testimonial-bg-inherit .quote {
  grid-area: quote;
  position: relative;
  z-index: 1;
  margin: -4rem 1.5rem 0;
  align-self: center;
}
@media (min-width: 64em) {
  .testimonial-bg-inherit-left,
  .testimonial-bg-inherit-right,
  .testimonial-bg-inherit-center {
    grid-template-columns: 1fr 40%;
    grid-template-rows: auto;
    grid-template-areas: "quote image";
    align-items: center;
    min-height: 56vh;
    padding: 4rem 5rem;
  }
  .testimonial-bg-inherit-right {
    grid-template-columns: 40% 1fr;
    grid-template-areas: "image quote";
  }
  .testimonial-bg-inherit-left > .testimonial-image,
  .testimonial-bg-inherit-right > .testimonial-image,
  .testimonial-bg-inherit-center > .testimonial-image {
    position: absolute;
    inset: 0;
    z-index: 0;
    height: 100%;
    width: 100%;
    border-radius: 0;
  }
  .testimonial-bg-inherit-left > .testimonial-image img,
  .testimonial-bg-inherit-right > .testimonial-image img,
  .testimonial-bg-inherit-center > .testimonial-image img {
    height: 100%;
    width: 100%;
    object-fit: cover;
    object-position: right center;
  }
  .testimonial-bg-inherit-right > .testimonial-image img { object-position: left center; }
  .testimonial-bg-inherit-left > .quote,
  .testimonial-bg-inherit-right > .quote,
  .testimonial-bg-inherit-center > .quote { margin: 0; }
}

/* --- img-left / img-right display styles: a SPLIT PANEL per slide, profile
   image one side, quote the other, with the name + course sitting UNDER the
   image (moved there in testimonial.php). Two-column grid; mobile stacks with a
   round avatar above the quote. Matches the Claude Design refinement: no boxed
   quote card (the dark section is the ground), a lead paragraph that leads, and
   a teal accent rule under the portrait. */
.testimonial-img-left,
.testimonial-img-right {
  display: grid;
  grid-template-columns: auto;
  grid-template-rows: auto auto;
  grid-template-areas: "image" "quote";
  gap: 1.4rem;
  width: 100%;
}
/* No card on the split layouts — the quote reads straight on the dark section. */
.testimonial-img-left > .quote,
.testimonial-img-right > .quote {
  grid-area: quote;
  align-self: center;
  background: transparent;
  padding: 0;
  border-radius: 0;
}
/* Lead paragraph leads; the rest steps down and mutes. */
.testimonial-img-left .quote blockquote p:first-child,
.testimonial-img-right .quote blockquote p:first-child { font-size: 1.75rem; line-height: 1.32; color: var(--white); }
.testimonial-img-left .quote blockquote p:not(:first-child),
.testimonial-img-right .quote blockquote p:not(:first-child) { font-size: 1.2rem; line-height: 1.6; color: rgba(var(--on-dark-rgb), .72); }

.testimonial-img-left > .testimonial-image,
.testimonial-img-right > .testimonial-image {
  grid-area: image;
  max-width: 200px;
  margin: 1.5rem auto 0;
  overflow: visible;       /* the caption sits below the framed image */
  border-radius: 0;
}
.testimonial-img-left > .testimonial-image img,
.testimonial-img-right > .testimonial-image img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 9999px;   /* round avatar on mobile */
}
/* Name + course under the image. */
.testimonial-img-left > .testimonial-image figcaption,
.testimonial-img-right > .testimonial-image figcaption {
  display: block;
  margin-top: 1rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--white);
}
.testimonial-img-left > .testimonial-image figcaption cite,
.testimonial-img-right > .testimonial-image figcaption cite {
  display: block;
  margin-top: .2rem;
  font-weight: 400;
  color: rgba(var(--on-dark-rgb), .72);
}
@media (min-width: 64em) {
  .testimonial-img-left,
  .testimonial-img-right {
    grid-template-columns: minmax(260px, 34%) 1fr;
    grid-template-rows: auto;
    grid-template-areas: "image quote";
    align-items: center;
    gap: 3rem;
    padding: 3rem 5rem;
  }
  .testimonial-img-right {
    grid-template-columns: 1fr minmax(260px, 34%);
    grid-template-areas: "quote image";
  }
  .testimonial-img-left > .testimonial-image,
  .testimonial-img-right > .testimonial-image {
    max-width: 100%;
    margin: 0;
    align-self: center;
    text-align: left;
  }
  .testimonial-img-left > .testimonial-image img,
  .testimonial-img-right > .testimonial-image img {
    aspect-ratio: 3 / 4;
    max-height: 420px;
    width: 100%;
    border-radius: var(--radius-sm);
    /* the teal accent rule directly under the portrait */
    border-bottom: 3px solid var(--accent-on-dark);
  }
}

/* Control bar aligns with the slide content inset (matches the 5rem slide pad). */
.testimonials-slider .dncg-carousel__bar { padding-inline: 1.5rem; }
@media (min-width: 64em) { .testimonials-slider .dncg-carousel__bar { padding-inline: 5rem; } }
