/* =========================================
   TESTIMONIALS SCROLLING
   ========================================= */

.tscroll-wrapper {
  position: relative;
}

/* Background image layer — sits behind everything, content stacks above it */
.tscroll-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 0;
}
.tscroll-bg picture {
  display: block;
  width: 100%;
  height: 100%;
}
.tscroll-bg__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--tscroll-bg-position, center center);
}

.tscroll-inner {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

/* Header */
.tscroll-header {
  margin-bottom: 3rem;
}

.tscroll-title {
  margin: 0 0 0.5rem;
}
.tscroll-description {
  margin: 0;
}

/* ---- Track wrapper ---- */
.tscroll-track-wrapper {
  position: relative;
}

/* Fade at bottom of scroll area — mobile only */
.tscroll-cards {
  position: relative;
}

/* ---- Cards row — desktop: horizontal scroll ---- */
.tscroll-cards {
  display: flex;
  flex-direction: row;
  gap: 1.5rem;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  /* hide native scrollbar — we draw our own in scroll mode */
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 1.25rem; /* space for custom scrollbar */
}
.tscroll-cards::-webkit-scrollbar {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .tscroll-cards {
    scroll-behavior: auto;
  }
}

/* ---- Slider mode ---- */
.tscroll-track-wrapper--slider {
  position: relative;
  --slider-width: 680px;
}
.tscroll-cards--slider {
  scroll-snap-type: x mandatory;
  padding-bottom: 0;
  max-width: var(--slider-width);
  margin-left: auto;
  margin-right: auto;
}
.tscroll-cards--slider .tscroll-card {
  scroll-snap-align: start;
  flex: 0 0 100%;
  margin: 0 auto;
}
.tscroll-cards--slider:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}

/* Prev/next sit beside the card, vertically centered, not in a row below it */
.tscroll-slider-nav {
  position: absolute;
  top: 50%;
  left: 50%;
  right: 0;
  width: calc(var(--slider-width) + 8rem);
  transform: translate(-50%, -50%);
  display: flex;
  justify-content: space-between;
  padding: 0 0.5rem;
  pointer-events: none;
  z-index: 3;
}
@media screen and (max-width: 768px) {
  .tscroll-inner {
    padding-left: 2.5rem;
    padding-right: 2.5rem;
  }
  .tscroll-slider-nav {
    width: 100vw;
  }
}
.tscroll-slider-btn {
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: none;
  background: none;
  color: inherit;
  cursor: pointer;
  padding: 0;
}
.tscroll-slider-btn img {
  display: block;
  width: 24px;
  height: 24px;
}
.tscroll-slider-btn:disabled {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}
.tscroll-slider-btn:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
  border-radius: 50%;
}

/* ---- Individual card ---- */
.tscroll-card {
  flex: 0 0 320px;
  background: #ffffff;
  color: #2D2927;
  border-radius: 16px;
  padding: 1.75rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

/* Stars */
.tscroll-stars {
  display: flex;
  gap: 9px;
  margin-bottom: 0.25rem;
  color: var(--color-main-accent);
}
.tscroll-card.is-slider .tscroll-stars {
  justify-content: center;
}
.tscroll-stars .icon-star {
  width: 23px;
  height: 23px;
}
@media screen and (max-width: 767px) {
  .tscroll-stars .icon-star {
    width: 18px;
    height: 18px;
  }
}
.tscroll-stars .icon-star path {
  fill: #93CA15;
}

/* Name */
.tscroll-name {
  font-size: 1.25rem;
  font-weight: 400;
  letter-spacing: normal;
  text-transform: uppercase;
  color: currentColor;
  line-height: 1.65;
}

/* Attribution — slider mode only, shown after the quote instead of before it */
.tscroll-name--attribution {
  text-transform: none;
  font-size: 18px;
  margin-top: 0.5rem;
}

/* Review title */
.tscroll-review-title {
  font-size: 2.5rem;
  font-style: italic;
  font-weight: 600;
  margin: 0;
  line-height: .825;
}
@media screen and (max-width: 767px) {
  .tscroll-review-title {
    font-size: 2.5rem;
    line-height: 1.1;
  }
}

/* Body text */
.tscroll-text {
  font-size: 0.95rem;
  line-height: 1.6;
  margin: 0;
}
.is-slider .tscroll-text {
  font-size: 1.25rem;
}
@media screen and (max-width: 767px) {
  .is-slider .tscroll-text {
    font-size: 14px;
  }
  .tscroll-name--attribution {
    margin-top: 0;
  }
}
.tscroll-text p:last-of-type {
  margin-bottom: 0;
}


/* ---- Custom scrollbar — desktop, scroll mode only ---- */
.tscroll-bar-track {
  position: relative;
  width: 100%;
  height: 4px;
  background: #6D6D6D;
  border-radius: 3px;
  margin-top: 0.5rem;
  cursor: pointer;
}
.tscroll-bar-thumb {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: #cccccc;
  border-radius: 3px;
  cursor: grab;
  transition: opacity 0.2s ease;
  min-width: 40px;
}
.tscroll-bar-thumb:hover,
.tscroll-bar-thumb.is-dragging {
  opacity: 0.85;
}

/* ---- Button ---- */
.tscroll-button-container {
  display: flex;
  margin-top: 2rem;
}
.tscroll-button-container.tscroll-align--left { justify-content: flex-start; }
.tscroll-button-container.tscroll-align--center { justify-content: center; }
.tscroll-button-container.tscroll-align--right { justify-content: flex-end; }

/* =========================================
   MOBILE — vertical scroll in fixed container (scroll mode only)
   ========================================= */
@media (max-width: 768px) {
  
  .tscroll-cards:not(.tscroll-cards--slider)::after {
    content: '';
    display: block;
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 20px;
    margin-top: -20px;
    flex-shrink: 0;
    background: linear-gradient(to bottom, transparent, var(--tscroll-fade-color, transparent));
    pointer-events: none;
    z-index: 2;
  }
  
  .tscroll-cards:not(.tscroll-cards--slider) {
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: auto;
    max-height: 50vh;
    padding-bottom: 0;
    padding-right: 0.75rem; /* space for scrollbar */
    scrollbar-width: thin;
    scrollbar-color: #cccccc #6D6D6D;
  }
  .tscroll-cards:not(.tscroll-cards--slider)::-webkit-scrollbar {
    display: block;
    width: 4px;
  }
  .tscroll-cards:not(.tscroll-cards--slider)::-webkit-scrollbar-track {
    background: #6D6D6D;
    border-radius: 3px;
  }
  .tscroll-cards:not(.tscroll-cards--slider)::-webkit-scrollbar-thumb {
    background: #cccccc;
    border-radius: 3px;
  }

  .tscroll-cards:not(.tscroll-cards--slider) .tscroll-card {
    flex: none;
    width: 100%;
  }

  /* hide custom scrollbar on mobile (scroll mode) */
  .tscroll-track-wrapper:not(.tscroll-track-wrapper--slider) .tscroll-bar-track {
    display: none;
  }
}
