/*
 * Благодарственные письма.
 * Desktop: сетка карточек. Mobile: горизонтальная свайп-листалка через scroll-snap.
 */
.ehs-thank-you-letters {
  padding: 0 0 100px;
  background: #f5f6f7;
}

.ehs-thank-you-letters__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 30px;
}

.ehs-thank-you-letter {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 8px 28px rgba(31, 53, 95, 0.1);
}

.ehs-thank-you-letter__link {
  position: relative;
  display: flex;
  aspect-ratio: 0.707 / 1;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 14px;
  background: #eef0f3;
}

.ehs-thank-you-letter__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  background: #fff;
  transition: transform 220ms ease;
}

.ehs-thank-you-letter__link:hover .ehs-thank-you-letter__image,
.ehs-thank-you-letter__link:focus-visible .ehs-thank-you-letter__image {
  transform: scale(1.015);
}

.ehs-thank-you-letter__link:focus-visible {
  outline: 3px solid #1f355f;
  outline-offset: -3px;
}

.ehs-thank-you-letter__zoom {
  position: absolute;
  right: 16px;
  bottom: 16px;
  display: flex;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(31, 53, 95, 0.92);
  color: #fff;
  font-size: 27px;
  font-weight: 300;
  line-height: 1;
  box-shadow: 0 5px 16px rgba(0, 0, 0, 0.2);
  transition: transform 180ms ease, background-color 180ms ease;
}

.ehs-thank-you-letter__link:hover .ehs-thank-you-letter__zoom,
.ehs-thank-you-letter__link:focus-visible .ehs-thank-you-letter__zoom {
  transform: scale(1.08);
}

.ehs-thank-you-letter__caption {
  padding: 18px 20px 20px;
  color: #313b4c;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.45;
  text-align: center;
}

/* Чуть больше воздуха между текстовым блоком и галереей. */
.ehs-static-hero-page__content-section + .ehs-thank-you-letters {
  margin-top: -50px;
}

@media (max-width: 1199px) {
  .ehs-thank-you-letters__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 991px) {
  .ehs-thank-you-letters__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .ehs-thank-you-letters {
    padding-bottom: 60px;
  }

  .ehs-static-hero-page__content-section + .ehs-thank-you-letters {
    margin-top: -20px;
  }

  .ehs-thank-you-letters__viewport {
    overflow-x: auto;
    overflow-y: hidden;
    margin-right: -15px;
    padding: 0 15px 12px 0;
    scroll-snap-type: x mandatory;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .ehs-thank-you-letters__viewport::-webkit-scrollbar {
    display: none;
  }

  .ehs-thank-you-letters__grid {
    display: flex;
    gap: 16px;
  }

  .ehs-thank-you-letter {
    flex: 0 0 min(82vw, 340px);
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }

  .ehs-thank-you-letter__caption {
    padding: 15px 16px 17px;
    font-size: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ehs-thank-you-letter__image,
  .ehs-thank-you-letter__zoom {
    transition: none;
  }
}
