.sm-testimonials {
  --sm-body: var(--e-global-color-uicore_body);
  --sm-dark: var(--e-global-color-uicore_dark);
  --sm-white: var(--e-global-color-uicore_white);
  --sm-accent: var(--e-global-color-uicore_primary);

  color: var(--sm-body);
}

.sm-testimonials-viewport {
  position: relative;
}

.sm-testimonials-fade {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 140px;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    color-mix(in srgb, var(--sm-white) 0%, transparent),
    var(--sm-white)
  );
}

@supports not (background: color-mix(in srgb, #000 10%, transparent)) {
  .sm-testimonials-fade {
    background: linear-gradient(to bottom, transparent, var(--sm-white));
  }
}

.sm-testimonials-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  align-items: start;
}

@media (min-width: 768px) {
  /* True masonry (gapless) is handled by a tiny JS distributor into columns */
  .sm-testimonials-grid {
    display: flex;
    gap: 24px;
    align-items: flex-start;
  }

  .sm-testimonials-col {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 24px;
  }

  .sm-testimonial-card {
    margin: 0;
  }
}

.sm-testimonial-card {
  background: var(--sm-white);
  border-radius: 24px;
  overflow: hidden;
  display: flex;
  flex-direction: column;

  border: 1px solid color-mix(in srgb, var(--sm-body) 10%, transparent);
}

@supports not (color: color-mix(in srgb, #000 10%, transparent)) {
  .sm-testimonial-card {
    border: 1px solid transparent;
  }
}

.sm-testimonial-card-top {
  padding: 22px;
}

.sm-testimonial-person {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sm-testimonial-avatar {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  overflow: hidden;
  background: color-mix(in srgb, var(--sm-body) 8%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

@supports not (background: color-mix(in srgb, #000 10%, transparent)) {
  .sm-testimonial-avatar { background: transparent; }
}

.sm-testimonial-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.sm-testimonial-avatar span {
  font-weight: 700;
  color: var(--sm-dark);
}

.sm-testimonial-person-meta {
  min-width: 0;
}

.sm-testimonial-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sm-testimonial-name {
  font-weight: 700;
  color: var(--sm-dark);
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.sm-testimonial-verified {
  /* Facebook-style verified badge: solid circle + white check */
  --sm-verified-badge: var(--e-global-color-uicore_primary);

  width: 18px;
  height: 18px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--sm-verified-badge);
  color: var(--sm-white);
  border: 0;
  flex: 0 0 auto;
}

.sm-testimonial-verified svg {
  width: 12px;
  height: 12px;
  color: var(--sm-white);
}

.sm-testimonial-meta {
  margin-top: 4px;
  font-size: 12px;
  opacity: 0.7;
}

.sm-testimonial-text {
  margin-top: 14px;
  line-height: 1.5;
}

.sm-testimonial-text p {
  margin: 0;
}

.sm-testimonial-text p + p {
  margin-top: 10px;
}

.sm-testimonial-card-media {
  padding: 0 22px 22px;
}

.sm-testimonial-media {
  border-radius: 18px;
  overflow: hidden;
}

.sm-testimonial-media--image .sm-testimonial-media-img {
  width: 100%;
  height: auto;
  display: block;
}

.sm-testimonial-media--video {
  aspect-ratio: 16 / 9;
}

.sm-testimonial-media--video iframe,
.sm-testimonial-media--video video {
  width: 100%;
  height: 100%;
  display: block;
}

.sm-testimonials-cta-wrap {
  margin-top: 18px;
  display: flex;
  justify-content: center;
}

.sm-testimonials-cta {
  appearance: none;
  border: 1px solid color-mix(in srgb, var(--sm-body) 10%, transparent);
  background: var(--sm-white);
  color: var(--sm-dark);
  border-radius: 999px;
  padding: 10px 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  line-height: 1;
}

@supports not (color: color-mix(in srgb, #000 10%, transparent)) {
  .sm-testimonials-cta { border-color: transparent; }
}

.sm-testimonials-cta[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

.sm-testimonials-avatars {
  display: inline-flex;
  align-items: center;
  padding-left: 2px;
}

.sm-testimonials-avatar {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  overflow: hidden;
  border: 2px solid var(--sm-white);
  background: color-mix(in srgb, var(--sm-body) 8%, transparent);
  margin-left: -10px;
}

.sm-testimonials-avatar:first-child {
  margin-left: 0;
}

.sm-testimonials-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.sm-testimonials-cta-text {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  white-space: nowrap;
}

.sm-testimonials-divider {
  opacity: 0.5;
}

.sm-testimonials-plus {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--sm-dark);
  color: var(--sm-white);
  flex: 0 0 auto;
}

.sm-testimonials-plus svg {
  width: 16px;
  height: 16px;
}

.sm-no-testimonials {
  opacity: 0.8;
}
