/* ==========================================================================
   TechAbbot – client testimonials carousel
   Markup: partials/testimonials.html (generated by tools/build-testimonials.js)
   Behaviour: js/testimonials.js

   Light tinted section. Heading on the left, position counter and arrows on
   the right, then one horizontal row of white quote cards.

     below 640px     one card at a time
     640px and up    one full card with the next one peeking in
     1100px and up   two cards at a time

   --per is how many whole cards the script counts as "in view"; --card is
   the card width. The script slides the track with a CSS transform.
   Without JavaScript (<html> has no .js class) the row scrolls sideways
   natively with scroll snapping and the controls are not shown.
   ========================================================================== */

.testimonials {
  --per: 1;
  --gap: 16px;
  --card: 100%;

  position: relative;
  padding-block: clamp(52px, 6.5vw, 96px);
  background:
    radial-gradient(38% 46% at 100% 0%, rgba(8, 113, 167, 0.1), transparent 70%),
    radial-gradient(34% 44% at 0% 100%, rgba(38, 150, 94, 0.1), transparent 70%),
    var(--c-bg-alt);
  border-top: 1px solid var(--c-border);
  overflow: hidden;
}

/* Heading row ------------------------------------------------------------- */

.testimonials__head {
  display: grid;
  gap: 20px;
}

.testimonials__label::after { content: none; }

.testimonials__title {
  margin: 14px 0 0;
  font-size: clamp(1.75rem, 1.25rem + 2.2vw, 2.75rem);
  font-weight: 700;
  line-height: 1.14;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.testimonials__accent { color: var(--c-blue); }

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .testimonials__accent {
    background: var(--gradient-logo);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
    -webkit-text-fill-color: transparent;
  }
}

.testimonials__intro {
  max-width: 44em;
  margin: 16px 0 0;
  color: var(--c-text-muted);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  line-height: 1.6;
}

/* Controls */

html:not(.js) .testimonials__controls,
html:not(.js) .testimonials__dots { display: none; }

.testimonials__controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.testimonials__counter {
  margin: 0;
  color: var(--c-text);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.testimonials__arrows {
  display: flex;
  gap: 10px;
}

.testimonials__arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  margin: 0;
  padding: 0;
  border: 1.5px solid var(--c-blue);
  border-radius: 50%;
  background: var(--c-bg);
  color: var(--c-blue);
  cursor: pointer;
  transition: background-color var(--ease), color var(--ease), border-color var(--ease), box-shadow var(--ease);
}

.testimonials__arrow::before {
  content: "";
  width: 11px;
  height: 11px;
  border: solid currentColor;
  border-width: 0 0 2.5px 2.5px;
  transform: translateX(2px) rotate(45deg);
}

.testimonials__arrow--next::before { transform: translateX(-2px) rotate(225deg); }

.testimonials__arrow:hover:not(:disabled) {
  border-color: transparent;
  background: linear-gradient(135deg, var(--c-green-strong), #0871A7);
  color: #fff;
  box-shadow: 0 12px 20px -12px rgba(8, 113, 167, 0.8);
}

.testimonials__arrow:disabled {
  border-color: #C9D6DE;
  color: #A9B7C2;
  cursor: default;
}

/* Carousel ------------------------------------------------------------------ */

.testimonials__viewport {
  margin-top: clamp(24px, 3vw, 40px);
  /* Room for the card shadows, which the viewport would otherwise clip. */
  margin-inline: -12px;
  padding: 6px 12px 34px;
  overflow: hidden;
  touch-action: pan-y;
}

.testimonials__viewport:focus-visible { outline-offset: -2px; }

/* No script: native sideways scrolling. */
html:not(.js) .testimonials__viewport {
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 12px;
  touch-action: auto;
}

.testimonials__track {
  display: flex;
  gap: var(--gap);
  margin: 0;
  padding: 0;
  list-style: none;
  transition: transform 520ms cubic-bezier(0.22, 0.61, 0.36, 1);
  will-change: transform;
}

/* The slide plays under reduced-motion settings too, at the site owner's
   request; base.css would otherwise cut every transition short. */
.js .testimonials__track { transition-duration: 520ms !important; }

.js .testimonial__card { transition-duration: 260ms !important; }

.js .testimonials__track.is-dragging,
.js .testimonials__track.is-instant { transition-duration: 0s !important; }

.testimonial {
  display: flex;
  flex: 0 0 var(--card);
  min-width: 0;
  scroll-snap-align: start;
  transition: opacity 320ms ease;
}

/* Cards outside the current view are dimmed (the peeking one on tablets). */
.js .testimonial:not(.is-visible) { opacity: 0.45; }

.testimonial__card {
  --pad: clamp(22px, 2.8vw, 36px);

  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  margin: 0;
  padding: var(--pad) var(--pad) 0;
  /* Gradient outline: green at the top-left corner, blue at the bottom-right. */
  border: 1.500px solid transparent;
  border-radius: 22px;
  background:
    linear-gradient(var(--c-bg), var(--c-bg)) padding-box,
    linear-gradient(135deg, rgba(38, 150, 94, 0.75), rgba(8, 113, 167, 0.16) 42%, rgba(8, 113, 167, 0.16) 58%, rgba(8, 113, 167, 0.75)) border-box;
  box-shadow: 0 26px 44px -30px rgba(8, 113, 167, 0.55), 0 8px 18px -14px rgba(37, 55, 70, 0.35);
  overflow: hidden;
  isolation: isolate;
  transition: transform 260ms ease, box-shadow 260ms ease;
}

.testimonial.is-visible .testimonial__card:hover {
  box-shadow: 0 32px 50px -28px rgba(8, 113, 167, 0.7), 0 10px 20px -14px rgba(37, 55, 70, 0.4);
  transform: translateY(-4px);
}

/* Background decoration 1: a dot grid fading in from the top-right corner. */
.testimonial__card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  z-index: -1;
  width: min(60%, 300px);
  height: 190px;
  background-image: radial-gradient(circle, rgba(8, 113, 167, 0.34) 1.300px, transparent 1.800px);
  background-size: 16px 16px;
  -webkit-mask-image: radial-gradient(120% 120% at 100% 0%, #000, transparent 68%);
  mask-image: radial-gradient(120% 120% at 100% 0%, #000, transparent 68%);
  pointer-events: none;
}

/* Background decoration 2: rings rising from the bottom-left, behind the text. */
.testimonial__card::after {
  content: "";
  position: absolute;
  bottom: 10px;
  left: -90px;
  z-index: -1;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: repeating-radial-gradient(circle, transparent 0 27px, rgba(38, 150, 94, 0.2) 27px 28.500px);
  -webkit-mask-image: radial-gradient(circle, #000 20%, transparent 70%);
  mask-image: radial-gradient(circle, #000 20%, transparent 70%);
  pointer-events: none;
}

.testimonial__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Quotation mark in a gradient badge. */
.testimonial__mark {
  display: inline-flex;
  align-items: flex-start;
  justify-content: center;
  width: 58px;
  height: 58px;
  padding-top: 9px;
  border-radius: 16px 16px 16px 4px;
  background: linear-gradient(135deg, var(--c-green), #0871A7);
  box-shadow: 0 14px 22px -12px rgba(8, 113, 167, 0.85);
  color: #fff;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 4.25rem;
  font-weight: 700;
  line-height: 1;
  overflow: hidden;
  user-select: none;
}

.testimonial__index {
  padding: 5px 12px;
  border: 1px solid var(--c-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  color: #5E6F7C;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  font-variant-numeric: tabular-nums;
}

.testimonial__quote {
  margin: 22px 0 0;
  padding: 0 0 26px;
}

.testimonial__quote p {
  margin: 0;
  color: var(--c-text);
  font-size: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  line-height: 1.7;
}

/* Client: a tinted band across the foot of the card, ruled off from the quote. */
.testimonial__client {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  margin: auto calc(var(--pad) * -1) 0;
  padding: 18px var(--pad) 20px;
  border-top: 1px solid var(--c-border);
  background: linear-gradient(90deg, rgba(38, 150, 94, 0.09), rgba(8, 113, 167, 0.09)), var(--c-bg-alt);
}

/* Short gradient rule sitting on the separator. */
.testimonial__client::before {
  content: "";
  position: absolute;
  top: -2px;
  left: var(--pad);
  width: 56px;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--c-green), #0871A7);
}

.testimonial__avatar {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--c-green-strong), #0871A7);
  box-shadow: 0 0 0 3px #fff, 0 0 0 4.500px rgba(8, 113, 167, 0.35);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  object-fit: cover;
}

.testimonial__who {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.testimonial__name {
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.3;
}

.testimonial__role {
  color: var(--c-text-muted);
  font-size: 0.9375rem;
  line-height: 1.4;
}

.testimonial__country {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  color: var(--c-blue);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.4;
  text-transform: uppercase;
}

.testimonial__country::before {
  content: "";
  flex: none;
  width: 12px;
  height: 12px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 22s7-6.200 7-12a7 7 0 1 0-14 0c0 5.800 7 12 7 12z'/%3E%3Ccircle cx='12' cy='10' r='2.500'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 22s7-6.200 7-12a7 7 0 1 0-14 0c0 5.800 7 12 7 12z'/%3E%3Ccircle cx='12' cy='10' r='2.500'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Pagination ---------------------------------------------------------------- */

.testimonials__dots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px;
  min-height: 44px;
}

.testimonials__dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.testimonials__dot::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #A9B7C2;
  transition: width 260ms ease, background-color 260ms ease;
}

.testimonials__dot:hover::before { background: var(--c-blue); }

.testimonials__dot[aria-current="true"]::before {
  width: 28px;
  background: linear-gradient(90deg, var(--c-green), #0871A7);
}

/* Layout ------------------------------------------------------------------ */

@media (min-width: 640px) {
  .testimonials {
    --gap: 20px;
    --card: 82%;
  }
}

@media (min-width: 900px) {
  .testimonials__head {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 40px;
  }

  .testimonials__controls { gap: 22px; }
}

@media (min-width: 1100px) {
  .testimonials {
    --per: 2;
    --gap: 24px;
    --card: calc((100% - var(--gap)) / 2);
  }
}
