/* ==========================================================================
   Testimonial slider - Layout 3
   --------------------------------------------------------------------------
   A featured testimonial on a dark card beside a stacked column of lighter
   cards, three testimonials at a time, cross-fading to the next three.
   Everything is scoped under .ctst3 / .ctst3-track so Layout 1, Layout 2, the
   rest of the plugin and the host theme are untouched.

   Type and padding are fluid (clamp), so desktop, tablet and phone all come off
   one scale instead of being re-stated at each breakpoint.
   ========================================================================== */

/* ---------- the component wrapper, for this layout only ----------
   The shared component view puts a heading above the slider and 100px of side
   padding around it. Layout 3 wants neither, so both are switched off only
   where this layout is the one rendering. */

.testimonial-overview:has(.ctst3-track) .section-head {
  display: none;
}

.section-width:has(.ctst3-track) {
  padding: 0;
}

/* ---------- the rotating groups ----------
   Every group shares one grid cell so they can cross-fade in place. That one
   cell is sized by the tallest group, which is the point: the track keeps the
   same height whichever group is showing, so the FAQ and the footer below it
   never move as the groups swap. */

.ctst3-track {
  display: grid;
  width: 100%;
}

.ctst3 {
  --ctst3-ink: #0f172a;
  --ctst3-dark: #0f1a30;
  --ctst3-amber: #fbbf24;
  --ctst3-muted: #94a3b8;
  --ctst3-body: #3f4e66;
  --ctst3-line: #d9e0ea;
  --ctst3-radius: 16px;

  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: clamp(16px, 1.8vw, 24px);
  align-items: start;
  /* Every group shares one grid cell, so the cell is as tall as the tallest
     group. A shorter group takes that same height rather than leaving a band of
     empty page under it: side by side the surplus goes to the featured card,
     which is sized to the row, while the cards beside it keep their own height
     and stay at the top - the shape the taller groups have anyway. */
  align-self: stretch;
  align-content: stretch;
  text-align: left;
}

/* ---------- group transition ---------- */

.ctst3 {
  grid-area: 1 / 1;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity .55s ease, transform .55s ease, visibility .55s;
}

.ctst3.is-on {
  opacity: 1;
  visibility: visible;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .ctst3 {
    transition: none;
  }

  .ctst3 {
    transform: none;
  }
}

/* ---------- the featured testimonial ---------- */

.ctst3__feature {
  display: flex;
  flex-direction: column;
  min-width: 0;
  /* matches the height of the column beside it. A percentage height would not
     do here: the row is sized by its contents, so the card would measure as
     nothing, the row would be sized by the column alone and the card would
     spill out the bottom of it. */
  align-self: stretch;
  padding: clamp(24px, 2.6vw, 38px);
  border-radius: var(--ctst3-radius);
  background: var(--ctst3-dark);
  color: #fff;
}

.ctst3__mark {
  display: block;
  margin: 0 0 clamp(14px, 1.6vw, 24px);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(32px, 3vw, 42px);
  font-weight: 700;
  line-height: 1;
  color: var(--ctst3-amber);
}

/* real quotes run long, so this sits well below the placeholder-sized 25px and
   carries a looser line height to stay readable at length */
.ctst3__quote {
  margin: 0 0 auto;
  font-size: clamp(16.5px, 1.4vw, 21px);
  font-weight: 700;
  line-height: 1.5;
  color: #fff;
  text-wrap: pretty;
}

.ctst3__quote p {
  margin: 0 0 10px;
  color: inherit;
  font: inherit;
}

.ctst3__quote p:last-child { margin-bottom: 0; }

/* ---------- who said it ---------- */

.ctst3__person {
  display: flex;
  align-items: center;
  gap: clamp(12px, 1.1vw, 16px);
  margin-top: clamp(20px, 2.2vw, 32px);
}

.ctst3__avatar {
  flex-shrink: 0;
  width: clamp(44px, 3.6vw, 52px);
  height: clamp(44px, 3.6vw, 52px);
  border-radius: 50%;
  overflow: hidden;
  /* the dashed ring stands in until a picture is uploaded */
  border: 2px dashed #46566f;
}

.ctst3__avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.ctst3__avatar--filled { border-style: solid; border-color: transparent; }

.ctst3__who {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.ctst3__name {
  font-size: clamp(14px, 1.05vw, 15px);
  font-weight: 800;
  line-height: 1.25;
  color: #fff;
}

.ctst3__role {
  font-size: clamp(12.5px, .95vw, 13.5px);
  font-weight: 600;
  line-height: 1.4;
  color: var(--ctst3-muted);
}

/* ---------- the stacked column ---------- */

.ctst3__rest {
  display: flex;
  flex-direction: column;
  gap: clamp(16px, 1.8vw, 24px);
  min-width: 0;
}

.ctst3__card {
  display: flex;
  flex-direction: column;
  /* sized by its own content: stretching made a lone card leave a tall gap
     between its quote and its name */
  flex: 0 0 auto;
  min-width: 0;
  padding: clamp(18px, 1.9vw, 26px);
  border-radius: var(--ctst3-radius);
  border: 1px dashed var(--ctst3-line);
  background: #fff;
}

.ctst3__cardquote {
  margin: 0 0 clamp(12px, 1.2vw, 16px);
  font-size: clamp(14.5px, 1.05vw, 15.5px);
  font-weight: 700;
  line-height: 1.6;
  color: var(--ctst3-body);
  text-wrap: pretty;
}

.ctst3__cardquote p {
  margin: 0 0 9px;
  color: inherit;
  font: inherit;
}

.ctst3__cardquote p:last-child { margin-bottom: 0; }

/* sits straight under the quote rather than being pushed to the card's foot */
.ctst3__meta {
  margin-top: 0;
  font-size: clamp(12.5px, .95vw, 13.5px);
  font-weight: 600;
  line-height: 1.4;
  color: var(--ctst3-muted);
}

/* ==========================================================================
   Responsive
   --------------------------------------------------------------------------
   The scale above already tracks the viewport, so these only handle the column
   change and the few things clamp cannot express.
   ========================================================================== */

@media all and (max-width: 1000px) {
  .ctst3 {
    grid-template-columns: minmax(0, 1fr);
    /* stacked, the surplus a shorter group is given has to go somewhere: the
       featured card takes it and the cards under it keep their own height, so
       no empty band opens up between the two */
    grid-template-rows: 1fr auto;
  }
}

@media all and (max-width: 575px) {
  .ctst3__feature,
  .ctst3__card { border-radius: 14px; }
}
