.reviews {
  padding: 12rem 0 18.6rem;
}

.reviews__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2.4rem 4rem;
  padding: 0 15.8rem 0 19.9rem;
}

.reviews__rating {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.reviews__rating-value {
  font-size: 7.2rem;
  font-weight: 500;
  line-height: 1;
}

.reviews__rating-stars {
  display: block;
  font-size: 2.4rem;
  letter-spacing: 0.15em;
  color: #f5b301;
}

.reviews__rating-label {
  display: block;
  margin-top: 0.4rem;
  font-size: max(1.6rem, 13px);
  font-weight: 300;
  line-height: 1.2;
}

.reviews__link {
  margin-left: 1.6rem;
}

.reviews__widget {
  margin: 5.6rem 15.8rem 0 19.9rem;
}

/* With a picture the widget keeps a readable width and the photo fills the rest of the row */
.reviews__widget.has-image {
  display: grid;
  grid-template-columns: minmax(0, 76rem) minmax(0, 1fr);
  gap: 2.6rem;
}

.reviews__photo {
  min-height: 60rem;
  border-radius: 2rem;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

.reviews__frame {
  display: block;
  width: 100%;
  height: 60rem;
  border: 0;
  border-radius: 2rem;
  background-color: var(--color-milk);
}

.reviews__list {
  display: grid;
  grid-template-columns: repeat(3, 36.6rem);
  gap: 6.4rem 14.7rem;
  margin-top: 7.3rem;
  padding-left: 24.65rem;
}

.review {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* Mockup columns are not evenly spaced: the third one is 24px closer */
.review:nth-child(3n) {
  translate: -2.4rem 0;
}

.review__avatar {
  flex-shrink: 0;
  width: 13.1rem;
  height: 13.1rem;
  border-radius: 50%;
  background-position: center;
  background-size: cover;
}

.review__name {
  margin-top: 2.5rem;
  font-size: max(1.8rem, 14px);
  font-weight: 600;
  line-height: 1.2222;
}

/* Figma width + 0.2rem: Chrome measures a line about 2px wider than Figma, with this the lines break as in the design */
.review__text {
  width: 35.8rem;
  margin-top: 0.5rem;
  font-size: max(1.6rem, 13px);
  line-height: 1.25;
}

.review:nth-child(3n + 2) .review__text {
  width: 36.8rem;
}

/* Tablet & mobile
   ========================================================================== */

@media (max-width: 1279.98px) {
  .reviews {
    padding: var(--section-space) 0;
  }

  .reviews__head {
    padding-inline: var(--gutter);
  }

  .reviews__rating-value {
    font-size: 5.6rem;
  }

  .reviews__widget {
    margin: 3.2rem var(--gutter) 0;
  }

  .reviews__widget.has-image {
    grid-template-columns: minmax(0, 1fr);
  }

  .reviews__photo {
    display: none;
  }

  .reviews__rating {
    flex-wrap: wrap;
    gap: 1.2rem 2rem;
  }

  .reviews__link {
    margin-left: 0;
  }

  .reviews__frame {
    height: 52rem;
  }

  .reviews__list {
    grid-template-columns: none;
    grid-auto-columns: minmax(30rem, 1fr);
    grid-auto-flow: column;
    gap: 2.4rem;
    margin-top: 4rem;
    padding: 0 var(--gutter) 1.6rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: var(--gutter);
    scrollbar-width: thin;
  }

  .review {
    padding: 3.2rem 2.4rem;
    background-color: var(--color-milk);
    scroll-snap-align: start;
  }

  .review:nth-child(3n) {
    translate: none;
  }

  .review__avatar {
    width: 9.6rem;
    height: 9.6rem;
  }

  .review__name {
    margin-top: 1.6rem;
    font-size: 1.6rem;
  }

  .review__text,
  .review:nth-child(3n + 2) .review__text {
    width: auto;
    margin-top: 0.8rem;
    font-size: 1.4rem;
  }
}

@media (max-width: 767.98px) {
  .reviews__list {
    grid-auto-columns: 85%;
  }
  .reviews__rating {
    display: none;
  }
}
