/* ==========================================================================
   Testimonials section
   ========================================================================== */

.testi {
  --testi-blue: #1c45c2;
  --testi-h: 1202px;
  --testi-canvas: 1920px;
  --testi-wrap-w: 1440px;
  --testi-aside-w: 240px;
  --testi-card-w: 338px;
  --testi-card-h: 265px;
  --testi-cards-gap: 20px;
  --testi-cards-w: calc(var(--testi-card-w) * 3 + var(--testi-cards-gap) * 2);
  --testi-cards-h: calc(var(--testi-card-h) * 3 + var(--testi-cards-gap) * 2);
  --testi-stage-gap: 32px;
  --testi-pad-top: 84px;
  --testi-page-top: 3072px; /* gbadge page top 4202 − in-section top 1130 */
  --testi-gbadge-w: 318px;
  --testi-gbadge-h: 72px;
  --testi-gbadge-page-top: 4060px;
  --testi-gbadge-page-left: 240px;
  --testi-gbadge-top: calc(var(--testi-gbadge-page-top) - var(--testi-page-top));
  --testi-gbadge-gap: 20px;
  --testi-gbadge-pad-y: 20px;
  --testi-gbadge-pad-x: 30px;
  --testi-person-w: 370px;
  --testi-person-h: 533px;
  --testi-person-page-top: 3498px; /* nudged 40px above Figma 3638 */
  --testi-person-page-left: 230px;
  --testi-person-top: calc(var(--testi-person-page-top) - var(--testi-page-top));
  background: #1c45c2;
  color: #fff;
  width: 100%;
  box-sizing: border-box;
  height: var(--testi-h);
  min-height: var(--testi-h);
  max-height: var(--testi-h);
  padding: var(--testi-pad-top) 0 72px;
  opacity: 1;
  position: relative;
  overflow: hidden;
}

.testi .container {
  width: 100%;
  max-width: var(--testi-wrap-w);
  margin: 0 auto;
  padding: 0 16px;
}

.testi-stage {
  display: grid;
  grid-template-columns: var(--testi-cards-w);
  gap: var(--testi-stage-gap);
  align-items: end;
  justify-content: end;
  width: 100%;
  max-width: var(--testi-wrap-w);
  margin: 0 auto;
}

/* Figma: 370×533 at page top 3638 / left 240, opacity 1 */
.testi-person {
  position: absolute;
  top: var(--testi-person-top);
  left: max(16px, calc((min(100vw, var(--testi-canvas)) - var(--testi-canvas)) / 2 + var(--testi-person-page-left)));
  z-index: 2;
  box-sizing: border-box;
  margin: 0;
  width: var(--testi-person-w);
  min-width: var(--testi-person-w);
  max-width: var(--testi-person-w);
  height: var(--testi-person-h);
  min-height: var(--testi-person-h);
  max-height: var(--testi-person-h);
  opacity: 1;
  transform: rotate(0deg);
  line-height: 0;
}

.testi-person img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  object-position: bottom center;
}

/* Figma: 318×72 at page top 4202 / left 240, gap 20, radius 10, opacity 1 */
.testi-gbadge {
  position: absolute;
  top: var(--testi-gbadge-top);
  left: max(16px, calc((min(100vw, var(--testi-canvas)) - var(--testi-canvas)) / 2 + var(--testi-gbadge-page-left)));
  z-index: 3;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: var(--testi-gbadge-gap);
  width: var(--testi-gbadge-w);
  min-width: var(--testi-gbadge-w);
  max-width: var(--testi-gbadge-w);
  height: var(--testi-gbadge-h);
  min-height: var(--testi-gbadge-h);
  max-height: var(--testi-gbadge-h);
  padding: var(--testi-gbadge-pad-y) var(--testi-gbadge-pad-x);
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .12);
  opacity: 1;
  transform: rotate(0deg);
  overflow: hidden;
}

.testi-gbadge > svg,
.testi-gbadge__g {
  width: 88px;
  height: 30px;
  max-height: 32px;
  flex: 0 0 auto;
  object-fit: contain;
}

.testi-gbadge__meta {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  min-width: 0;
}

.testi-gbadge__stars {
  color: #fab72a;
  font-size: .8rem;
  letter-spacing: 1px;
  line-height: 1;
}

.testi-gbadge__text {
  color: #000;
  font-size: .75rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}

.testi-main {
  width: var(--testi-cards-w);
  max-width: 100%;
  min-width: 0;
  justify-self: stretch;
}

.testi-header {
  margin-bottom: 24px;
  text-align: left;
}

.testi-title {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  font-family: 'Gilroy-ExtraBoldItalic', var(--display);
  font-weight: 400;
  font-style: italic; /* italic is in the Gilroy-ExtraBoldItalic face */
  font-size: 54px;
  line-height: 72px;
  letter-spacing: 0;
  text-transform: uppercase;
  color: #f5a623;
  margin: 0 0 14px;
}

.testi-title__line {
  display: block;
  line-height: 72px;
}

.testi-sub {
  color: #fff;
  font-size: clamp(.92rem, 1.05vw, 1.02rem);
  font-weight: 400;
  font-style: normal;
  line-height: 1.45;
  margin: 0;
  max-width: 520px;
}

/* Figma cards grid: 3×338 with 20px gap → 1054×835 */
.testi-cards {
  box-sizing: border-box;
  display: grid;
  grid-template-columns: repeat(3, var(--testi-card-w));
  grid-template-rows: repeat(3, var(--testi-card-h));
  gap: var(--testi-cards-gap);
  width: var(--testi-cards-w);
  max-width: 100%;
  height: var(--testi-cards-h);
  margin-top: 24px;
  opacity: 1;
}

/* Figma card: 338×265, radius 30, opacity 1 */
.tcard {
  position: relative;
  box-sizing: border-box;
  color: var(--ink);
  width: var(--testi-card-w);
  min-width: var(--testi-card-w);
  max-width: var(--testi-card-w);
  height: var(--testi-card-h);
  min-height: var(--testi-card-h);
  max-height: var(--testi-card-h);
  border-radius: 30px;
  padding: 16px 16px 36px;
  opacity: 1;
  transform: rotate(0deg);
  box-shadow: 0 4px 18px rgba(8, 20, 50, .1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.tcard--fade-top {
  background: linear-gradient(180deg, var(--testi-blue) 0%, #fff 62%, #fff 100%);
}

.tcard--solid {
  background: #fff;
}

.tcard--fade-bottom {
  background: linear-gradient(180deg, #fff 0%, #fff 78%, var(--testi-blue) 100%);
}

.tcard__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.tcard__rule {
  display: block;
  width: 100%;
  max-width: 278px;
  height: 1px;
  margin: 0 0 10px;
  flex-shrink: 0;
}

.tcard__name {
  font-size: .95rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.2;
}

.tcard__stars {
  flex-shrink: 0;
  color: #ffb800;
  font-size: .78rem;
  letter-spacing: 1px;
  line-height: 1;
}

.tcard__text {
  font-size: .84rem;
  color: #4a5568;
  line-height: 1.55;
  flex: 1;
}

.tcard__g {
  position: absolute;
  right: 14px;
  bottom: 12px;
  width: 22px;
  height: 22px;
}

/* ------------------------------- Responsive ------------------------------- */

@media (max-width: 1024px) {
  .testi {
    height: auto;
    min-height: 0;
    max-height: none;
    padding: 48px 0 56px;
    overflow: visible;
  }

  .testi-stage {
    grid-template-columns: 1fr;
    justify-content: stretch;
    gap: 24px;
    width: 100%;
  }

  .testi-main {
    width: 100%;
  }

  .testi-cards {
    width: 100%;
    height: auto;
    margin-top: 24px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: none;
    gap: 16px;
  }

  .tcard {
    width: 100%;
    min-width: 0;
    max-width: none;
    height: auto;
    min-height: var(--testi-card-h);
    max-height: none;
  }

  .testi-person {
    position: relative;
    top: auto;
    left: auto;
    width: min(100%, var(--testi-person-w));
    min-width: 0;
    max-width: var(--testi-person-w);
    height: auto;
    min-height: 0;
    max-height: none;
    margin: 0 auto 20px;
    transform: rotate(0deg);
  }

  .testi-person img {
    width: 100%;
    height: auto;
  }

  .testi-gbadge {
    position: relative;
    top: auto;
    left: auto;
    width: min(100%, var(--testi-gbadge-w));
    min-width: 0;
    max-width: var(--testi-gbadge-w);
    margin: 0 auto 24px;
    transform: rotate(0deg);
  }

  .testi-header {
    text-align: center;
  }

  .testi-sub {
    margin: 0 auto;
  }

  .tcard--fade-top,
  .tcard--fade-bottom {
    background: #fff;
  }
}

@media (max-width: 560px) {
  .testi-cards {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .tcard {
    min-height: 0;
    border-radius: 30px;
  }
}
