/* Client testimonials — self-contained for the DevLink Shadow DOM.
   Full-bleed (edge-to-edge) scroll rail; neutral palette hardcoded. */

.tm {
  /* Break out of any container to the viewport edges. */
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  font-family: inherit;
  box-sizing: border-box;
}

.tm *,
.tm *::before,
.tm *::after {
  box-sizing: border-box;
}

.tm__title {
  margin: 0 0 1.25rem;
  padding: 0 1.5rem;
  font-size: 1.25rem;
  font-weight: 400;
  text-align: center;
  color: #171717;
}

.tm__track {
  display: flex;
  align-items: stretch;
  gap: 1rem;
  overflow-x: auto;
  /* proximity (not mandatory) so native scroll doesn't snap-fight the drag */
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  padding: 0.25rem 1.5rem 1rem;
  scrollbar-width: none;
  cursor: grab;
  /* Dragging must not select the quote text. */
  user-select: none;
  -webkit-user-select: none;
}

/* While dragging, drop the snap so it tracks the pointer smoothly. */
.tm__track.is-dragging {
  scroll-snap-type: none;
  cursor: grabbing;
}

.tm__track::-webkit-scrollbar {
  display: none;
}

.tm__track:active {
  cursor: grabbing;
}

.tm__card {
  flex: 0 0 300px;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  margin: 0;
  background: #ffffff;
  border: 1px solid #e6e6e6;
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  overflow: hidden;
}

.tm__head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1rem;
  background: #fafafa;
  border-bottom: 1px solid #f0f0f0;
}

.tm__avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 auto;
  background: #ededed;
}

.tm__name {
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.3;
  color: #171717;
}

.tm__body {
  flex: 1;
  margin: 0;
  padding: 0.9rem 1rem 1.05rem;
  font-size: 0.875rem;
  line-height: 1.6;
  color: #3a3a3a;
  /* Uniform four-line block so every card lines up. */
  min-height: calc(4 * 1.6em);
}

/* The clamp lives on an inner element, NOT the flex item. `-webkit-line-clamp`
   needs `display: -webkit-box`, but a flex item's display is blockified — which
   is why the clamp was ignored and a fifth line showed through. */
.tm__clamp {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  -webkit-box-orient: vertical;
  box-orient: vertical;
  overflow: hidden;
}

/* ── Skeleton (loading / Designer) ────────────────────────────────────────── */
.tm__card--skeleton .tm__body {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.tm__sk {
  display: block;
  border-radius: 4px;
  background: linear-gradient(90deg, #eee 25%, #f5f5f5 37%, #eee 63%);
  background-size: 400% 100%;
  animation: tm-shimmer 1.4s ease infinite;
}

.tm__sk--avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.tm__sk--name {
  width: 45%;
  height: 0.7rem;
  border-radius: 4px;
}

.tm__sk--line {
  height: 0.7rem;
  width: 100%;
}

.tm__sk--short {
  width: 62%;
}

@keyframes tm-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: 0 0; }
}

@media (prefers-reduced-motion: reduce) {
  .tm__sk {
    animation: none;
  }
}

/* ── Mobile ───────────────────────────────────────────────────────────────── */
@media (max-width: 767px) {
  .tm__track {
    gap: 0.75rem;
    padding: 0.25rem 1rem 1rem;
  }

  /* ~63vw (about 25% narrower than 84vw) so more of the rail shows at once. */
  .tm__card {
    flex: 0 0 63vw;
  }

  /* Slightly larger quote text on phones for readability. */
  .tm__body {
    font-size: 0.9rem;
  }

  .tm__title {
    padding: 0 1rem;
  }
}
