/* Home Testimonials — scoped to #sys-testimonials only */

#sys-testimonials {
  --tm-per-view: 1;
  --tm-gap: 2rem;
  --tm-fade: 1rem;
  --tm-green: var(--nature-green, #2e7d32);
  --tm-orange: #e8a04a;
  --tm-ink: #3b3f3c;
  --tm-muted: #8a908b;

  position: relative;
  z-index: 1;
  background: #ffffff;
  padding: 6rem 0 4rem;
  overflow: hidden;
}

#sys-testimonials .sys-tm__inner {
  width: 100%;
  max-width: 84rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ---------- Title: What (script green) our (sans) Guests Say (script orange) ---------- */

#sys-testimonials .sys-tm__title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 0 0.28em;
  margin: 0 0 2.75rem;
  font-weight: 400;
  line-height: 1;
  text-align: center;
}

#sys-testimonials .sys-tm__what,
#sys-testimonials .sys-tm__guests {
  font-family: var(--font-sirivennela, 'Sirivennela', cursive);
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1.05;
}

#sys-testimonials .sys-tm__what {
  font-size: clamp(3rem, 6vw, 6.6rem);
  color: var(--tm-green);
}

#sys-testimonials .sys-tm__guests {
  font-size: clamp(2.7rem, 5.4vw, 4rem);
  color: var(--tm-orange);
}

#sys-testimonials .sys-tm__our {
  font-family: var(--font-sans, 'Readex Pro', system-ui, sans-serif);
  font-weight: 300;
  font-size: clamp(1.3rem, 1.8vw, 2rem);
  color: #3a3d3b;
  line-height: 1;
  transform: translateY(-0.08em);
}

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

#sys-testimonials .sys-tm__viewport {
  overflow: hidden;
  /* soft edge while a slide is mid-transition; the fade is a fixed length that is always
     narrower than the slide padding, so static text and quote marks sit fully outside it */
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 var(--tm-fade), #000 calc(100% - var(--tm-fade)), transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 var(--tm-fade), #000 calc(100% - var(--tm-fade)), transparent 100%);
}

#sys-testimonials .sys-tm__track {
  display: flex;
  will-change: transform;
  /* no flex gap: sys-testimonials.js steps by one slide width, so the space between
     reviews comes from the slide padding (a gap would push the last visible slide out) */
  gap: 0;
}

#sys-testimonials .sys-tm__slide {
  flex: 0 0 calc(100% / var(--tm-per-view));
  min-width: 0;
  box-sizing: border-box;
  padding: 0 calc(var(--tm-gap) / 2);
  display: flex;
}

/* ---------- Review ---------- */

#sys-testimonials .sys-tm__item {
  position: relative;
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  padding: 0.5rem 0 0;
  display: flex;
  flex-direction: column;
}

#sys-testimonials .sys-tm__quote {
  display: block;
  width: 2.6rem;
  height: 2.6rem;
  object-fit: contain;
  opacity: 0.32;
  filter: saturate(0.75);
  pointer-events: none;
}

#sys-testimonials .sys-tm__quote--close {
  align-self: flex-end;
  transform: rotate(180deg);
}

#sys-testimonials .sys-tm__text {
  flex: 1 1 auto;
  margin: 0.5rem 0;
  padding: 0;
  border: 0;
}

#sys-testimonials .sys-tm__text p {
  margin: 0;
  font-family: var(--font-sans, 'Readex Pro', system-ui, sans-serif);
  font-size: 1rem;
  font-weight: 300;
  line-height: 1.8;
  color: var(--tm-ink);
}

#sys-testimonials .sys-tm__author {
  margin-top: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

#sys-testimonials .sys-tm__name {
  font-family: var(--font-sans, 'Readex Pro', system-ui, sans-serif);
  font-size: 1rem;
  font-weight: 500;
  color: #262a27;
}

#sys-testimonials .sys-tm__role {
  font-family: var(--font-sans, 'Readex Pro', system-ui, sans-serif);
  font-size: 0.85rem;
  font-weight: 300;
  color: var(--tm-muted);
}

/* ---------- Arrows ---------- */

#sys-testimonials .sys-tm__controls {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 2.5rem;
}

#sys-testimonials .sys-tm__controls[hidden] {
  display: none;
}

#sys-testimonials .sys-tm__arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid rgba(46, 125, 50, 0.35);
  border-radius: 999px;
  background: transparent;
  color: var(--tm-green);
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

#sys-testimonials .sys-tm__arrow:hover {
  background: var(--tm-green);
  border-color: var(--tm-green);
  color: #fff;
}

#sys-testimonials .sys-tm__arrow:focus-visible {
  outline: 2px solid var(--tm-orange);
  outline-offset: 3px;
}

#sys-testimonials .sys-tm__arrow svg {
  width: 1.15rem;
  height: 1.15rem;
}

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

/* Tablet: one review per view (two would be too narrow beside the foliage) */
@media (min-width: 768px) {
  #sys-testimonials {
    --tm-gap: 3rem;
    padding: 8rem 0 5rem;
  }

  #sys-testimonials .sys-tm__carousel {
    padding: 0 clamp(0rem, 15vw, 14rem);
  }

  #sys-testimonials .sys-tm__inner {
    padding: 0 2rem;
  }

  #sys-testimonials .sys-tm__title {
    margin-bottom: 3.5rem;
  }
}

@media (min-width: 1024px) {
  /* shared Home content wrapper: 1440px max, centred, gutter clamp(1rem, 4.5vw, 4rem) */
  #sys-testimonials .sys-tm__inner {
    max-width: 1440px;
    padding: 0 clamp(1rem, 4.5vw, 4rem);
  }

  #sys-testimonials {
    --tm-per-view: 2;
    --tm-gap: 3rem;
    /* the decorative tree image above scales with viewport width; clear it */
    padding: max(11rem, 16vw) 0 5rem;
  }

  /* keep reviews clear of the decorative foliage (welcome.blade tree image) on the left */
  /* same carousel/viewport width as before the wrapper change (it used to sit in an
     84rem box with 2rem gutters): add half of the difference between the wider wrapper
     content box (100%) and the old one to the foliage clearance */
  #sys-testimonials .sys-tm__carousel {
    padding: 0 calc(clamp(0rem, 12vw, 12rem) + (100% - (min(84rem, 100vw) - 4rem)) / 2);
  }

  #sys-testimonials .sys-tm__text p {
    font-size: 1.0625rem;
  }

  #sys-testimonials .sys-tm__quote {
    width: 3.25rem;
    height: 3.25rem;
  }
}

@media (min-width: 1280px) {
  #sys-testimonials {
    --tm-gap: 6rem;
  }
}

@media (max-width: 767px) {
  #sys-testimonials .sys-tm__title {
    margin-bottom: 2rem;
  }

  /* widen the clip box 1rem each side and give the slide the same 1rem inset, so the text
     keeps the page gutter but sits clear of the edge fade */
  #sys-testimonials .sys-tm__viewport {
    margin: 0 -1rem;
  }

  #sys-testimonials .sys-tm__slide {
    padding: 0 1rem;
  }
}
