/* Testimonials — "Starting your engineering career is a big step".
   Two-column layout on the 12-col grid: left = display heading + intro + dot indicators;
   right = single-card testimonial carousel (quote + author/role + photo) with prev/next arrows.
   Carousel chrome inherits from sections/_shared.css; home.js drives snap/dots/arrows.
   Refined to Figma (file kfVB4NiP7xQX1fsjsHD9E2): heading 3060:19466, intro 3060:19467,
   card 3060:19473, dots 3060:19468. Sharp corners; tokens from _tokens.css. */

.testimonials {
  padding-block: var(--sp-4xl);
  color: var(--color-steel);
  overflow: clip; /* contain the oversized quote-mark glyph */
}

/* Grid: left text column + right carousel column, bottom-aligned.
   position:relative anchors the decorative motif band to the container edge. */
.testimonials__inner {
  position: relative;
  align-items: end;
  row-gap: clamp(2rem, 5vw, 4rem);
}

/* Decorative dot-motif band, top-right (opt-in via ACF "Show dot motif"). Faint warm
   grey by default; an ACF colour turns it into a solid accent. right:0 aligns it to the
   inner's right edge (= carousel right); the negative top (cancelling the section's
   top padding) sits it flush with the section's top edge. */
.testimonials__motif {
  position: absolute;
  top: calc(var(--sp-4xl) * -1);
  right: var(--gutter);
  color: color-mix(in srgb, var(--color-steel) 10%, transparent);
  z-index: 0;
}
.testimonials__motif .dot-motif {
  --motif-size: clamp(4.6875rem, 3.929rem + 3.2363vw, 7.8125rem);
}
@media (max-width: 768px) {
  .testimonials__motif {
    display: none;
  }
}

/* ---- Left: heading + intro ------------------------------------------- */
.testimonials__head {
  grid-column: 1 / span 5;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3xl);
}
.testimonials__heading {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--text-h2);
  line-height: var(--lh-tight);
  color: var(--color-steel);
  max-width: 12ch;
}
.testimonials__body {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 300;
  font-size: var(--text-body-main);
  line-height: var(--lh-body);
  max-width: 46ch;
}
/* Dot indicators (built by home.js as .carousel__dot). Figma: 7px dots, ~24px centres,
   inactive light steel, active clay. */
.testimonials__dots {
  gap: 17px;
}
.testimonials__dots .carousel__dot {
  width: 7px;
  height: 7px;
  background: var(--color-steel);
  opacity: 0.25;
  transition:
    opacity 0.2s ease,
    background-color 0.2s ease;
}
.testimonials__dots .carousel__dot[aria-current="true"] {
  background: var(--color-clay);
  opacity: 1;
}

/* ---- Right: single-card carousel -------------------------------------- */
.testimonials__carousel {
  grid-column: 7 / -1;
  min-width: 0; /* let the track shrink inside the grid track */
}
/* One card visible at a time → 100% width snaps one-at-a-time (carousel contract). */
.testimonials__track {
  gap: var(--grid-gap);
}
.testimonials__track > .testimonial {
  flex: 0 0 100%;
  max-width: 100%;
}

.testimonial {
  margin: 0;
  display: flex;
  align-items: flex-end; /* photo bottom-aligns with the author caption, per the design */
  gap: var(--sp-md);
}
/* Right column: quote (top) + author caption (bottom). */
.testimonial__text {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: clamp(1.75rem, 4vw, 3rem);
}
/* Oversized clay opening quote-mark above the quote (Figma “ glyph). */
.testimonial__quote {
  position: relative;
  margin: 0;
  padding-top: clamp(2.5rem, 4vw, 3.75rem);
  font-family: var(--font-body);
  font-size: var(--text-h6); /* → 26px */
  line-height: var(--lh-snug);
  color: var(--color-steel);
}
.testimonial__quote::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: clamp(1.85rem, 3vw, 2.6rem);
  aspect-ratio: 41 / 33;
  background-color: var(--color-clay);
  -webkit-mask: url(../../icons/quote.svg) no-repeat center / contain;
  mask: url(../../icons/quote.svg) no-repeat center / contain;
  pointer-events: none;
}
.testimonial__by {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-family: var(--font-body);
  font-size: var(--text-body-sm); /* → 16px */
  line-height: var(--lh-body);
}
.testimonial__author {
  font-weight: 400;
  color: var(--color-steel);
}
.testimonial__role {
  font-weight: 300;
  color: var(--color-steel);
  opacity: 0.7;
}
/* Author photo — sits to the left of the quote, bottom-aligned with the caption (design). */
.testimonial__media {
  flex: 0 0 auto;
  width: clamp(11.25rem, 10.4005rem + 3.6246vw, 14.75rem);
  aspect-ratio: 1;
  overflow: clip;
}
.testimonial__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Bottom controls row under the carousel column: dots left, arrows right, one row. */
.testimonials__controls {
  grid-column: 7 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--grid-gap);
  margin-top: clamp(1.5rem, 4vw, 3rem);
}

.testimonials__arrow {
  width: 2.25rem;
  height: 2.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: var(--sp-20);
  color: var(--color-steel);
  transition:
    color 0.2s ease,
    transform 0.2s ease;
}
.testimonials__arrow:hover,
.testimonials__arrow:focus-visible {
  color: var(--color-clay);
}
.testimonials__arrow:active {
  transform: translateY(1px);
}

/* ---- Responsive -------------------------------------------------------- */
@media (max-width: 1024px) {
  .testimonials__head {
    grid-column: 1 / span 5;
  }
  .testimonials__carousel {
    grid-column: 6 / -1;
  }
}
@media (max-width: 900px) {
  .testimonials__inner {
    align-items: start;
  }
  .testimonials__head,
  .testimonials__carousel {
    grid-column: 1 / -1;
  }
}
@media (max-width: 600px) {
  .testimonials__heading {
    max-width: none;
  }
  /* Stack the card: photo above the quote. */
  .testimonial {
    flex-direction: column;
    align-items: flex-start;
    gap: clamp(1.25rem, 4vw, 1.75rem);
  }
}
