/* Reviews above the footer on every page (partials/reviews.njk).
   Loaded on every page by layouts/base.njk, after style.css.
   Phones: one card at a time in a row that swipes sideways, the next card peeking in.
   Tablets: two by two. Desktop: one row of four. */

.reviews__list {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 85%;
  gap: 15px;
  margin: 30px calc(var(--gutter) * -1) 0;
  /* The row runs to the screen edges, but cards stop in line with the page text. */
  padding: 0 var(--gutter) 10px; /* bottom: room for the scroll bar where one shows */
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--gutter);
  list-style: none;
  text-align: left;
  /* Keeps the screen-reader-only text inside off-screen cards from widening the page. */
  position: relative;
}

/* The row takes keyboard focus so it can be scrolled without a mouse. */
.reviews__list:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 2px;
}

.reviews__list > li {
  display: flex;
  scroll-snap-align: start;
}

.review {
  display: flex;
  flex-direction: column;
  width: 100%;
  margin: 0;
}

/* Gray speech bubble with the stars and the review text. */
.review__bubble {
  flex: 1;
  padding: 20px 25px;
  border-radius: 20px;
  background: var(--gray-bg);
}

.review__stars {
  margin: 0 0 10px;
  color: rgb(251 188 4); /* Google's review-star yellow */
  font-size: 20px;
  letter-spacing: 2px;
  line-height: 1;
}

.review__text {
  margin: 0;
}

.review__text p {
  margin: 0;
}

.review__author {
  margin-top: 15px;
  padding-inline: 5px;
  font-weight: 700;
}

.review__source {
  display: block;
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
}

.reviews__more {
  margin: 25px 0 0;
}

@media (min-width: 768px) {
  .reviews__list {
    margin-inline: 0;
    padding: 0;
    overflow-x: visible;
    grid-auto-flow: row;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
  }
}

@media (min-width: 1025px) {
  .reviews__list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
