/* ---------------------------------------------------------------------------
   Reviews page — ТЗ §5.

   Everything here is scoped under .rev. The card itself is the site's own
   .review-card and is NOT restyled: this file only lays the cards out and adds
   the page furniture around them. fidelity_check.py fails the build if any
   selector from style.css is redefined.

   Values are the measured design system: panel #2b3141, primary #ed1a20,
   stars #ffc107, card radius 20px, transitions 0.35s ease.
--------------------------------------------------------------------------- */

.rev {
  padding: 2.5rem 0 3.5rem;
}

.rev__intro {
  max-width: 46rem;
  margin-bottom: 2rem;
}

/* The hub H1 scale of the PHP pages (30 / 40 px, as /tashkent/, /tours/, /rent/):
   at 28 / 36 the reviews hub read as a smaller page than its siblings. */
.rev__title {
  margin: 0.75rem 0 0.5rem;
  font-size: 1.875rem;
  font-weight: 600;
  line-height: 1.2;
}

.rev__lead {
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 1.0625rem;
}

/* Aggregate rating. The number, not the stars, carries the meaning — the stars
   are decoration and are hidden from assistive technology in the markup. */
.rev__summary {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.25rem 0 0;
}

.rev__score {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
}

.rev__score-of {
  color: rgba(255, 255, 255, 0.6);
}

.rev__stars {
  color: #ffc107;
  letter-spacing: 0.08em;
}

.rev__count {
  color: rgba(255, 255, 255, 0.6);
}

/* Mobile first (ТЗ §1): одна колонка — это база, а не исключение. Широкий
   экран добавляет колонки, а не отнимает их. */
/* Cards of a row stretch to the tallest, as on the home page: .review-card is a
   column with the Google mark pushed down by margin-top: auto, so the marks
   line up. With align-items: start a shorter review left its card 24 px short
   and its mark out of line at two and three columns. */
.rev__list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.25rem;
}

/* A card appended by reviews.js fades in; one that was already on the page must
   not, or every "show more" would re-animate the whole list. */
.rev__card--new {
  animation: rev-in 0.35s ease both;
}

@keyframes rev-in {
  from {
    opacity: 0;
    transform: translateY(0.75rem);
  }
}

.rev__more {
  margin: 2rem 0 0;
  text-align: center;
}

.rev__more-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 13rem;
}

.rev__more-link[aria-busy="true"] {
  opacity: 0.6;
  pointer-events: none;
}

.rev__empty {
  margin: 2rem 0;
  color: rgba(255, 255, 255, 0.6);
}

/* style.css pins .review-card to 20.625rem below 48rem, because on the home page
   the cards sit in a horizontal scroller where a fixed width is what makes them
   scroll. Here they are a one-column grid, and 330px inside a 300px column
   pushed the whole page 20px sideways at 320. Overridden through our own class
   on the same element, so the site's rule is left as it is. */
.rev__card {
  width: auto;
  max-width: 100%;
}

/* 48.0625rem — точное дополнение к 48rem, которым пользуется style.css: нет
   ширины, где сработали бы оба правила или ни одного. */
@media (min-width: 48.0625rem) {
  .rev__title {
    font-size: 2.5rem;
  }

  /* Two cards to a row, in four tracks, so that an odd last card can stand in the
     middle two: the same row reads 2+1 centred on the home page. */
  .rev__list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .rev__card {
    grid-column: span 2;
  }

  .rev__card:nth-child(odd):last-child {
    grid-column: 2 / span 2;
  }
}

@media (min-width: 63.8125rem) {
  .rev__list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .rev__card,
  .rev__card:nth-child(odd):last-child {
    grid-column: auto;
  }
}

/* Брейкпоинта 1440 здесь намеренно нет, и это стоит объяснить.
   Контейнер сайта — .container из style.css — упирается в 75rem (1200px), так
   что на 1440 шире становятся поля, а не контент. Четвёртая колонка, которую я
   сюда добавил и посмотрел глазами, сделала карточки уже и текст в них — выше,
   при трёх отзывах оставив справа пустоту. Ширина, на которой ничего не должно
   меняться, — это ширина без правила, а не правило ради галочки.
   Раздвинуть контейнер значило бы менять сетку всего сайта, а п. 1.6 договора
   прямо запрещает редизайн. */

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