/* ── Reviews carousel (What Clients Say) — Oracle of Selene ──────────────
   Figma 1:2 (desk 1440) / 22:6127 (mob 440).
   Карточка 393×238, r15, 1px #B99F70, bg rgba(187,187,187,.2), pad 24.
   Трек: flex + scroll-snap, 3 карточки в ряд (десктоп), 2 (планшет),
   1.2 (мобиле). Стрелки 44×44 в боковых полях трека; на мобиле — под треком.
   Данные: /data/reviews.json — рендер и вся логика в /reviews-block.js
   ---------------------------------------------------------------------- */

.rsv {
  position: relative;
  margin: 0;
  padding: 96px 24px 88px;
  background:
    radial-gradient(1.5px 1.5px at 12% 22%, rgba(255,255,255,.55), transparent 60%),
    radial-gradient(1px 1px at 78% 12%, rgba(255,255,255,.4), transparent 60%),
    radial-gradient(1.5px 1.5px at 88% 64%, rgba(255,255,255,.35), transparent 60%),
    radial-gradient(1px 1px at 34% 82%, rgba(255,255,255,.3), transparent 60%),
    radial-gradient(1px 1px at 62% 46%, rgba(255,255,255,.25), transparent 60%),
    linear-gradient(160deg, #05070d 0%, #0d1225 34%, #120b1a 68%, #0a0e1a 100%);
  color: #e8e6e3;
  isolation: isolate;
  overflow: hidden;            /* никакого горизонтального скролла страницы */
}
.rsv::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(60% 50% at 50% 0%, rgba(201,160,80,.07), transparent 70%);
  pointer-events: none; z-index: -1;
}
.rsv__inner { max-width: 1227px; margin: 0 auto; }

/* Заголовок блока. В новом десктопе (canvas-вёрстка .page) любой .tx —
   position:absolute с координатами макета; внутри секции отзывов это даёт
   мелкий заголовок в левом верхнем углу, поэтому возвращаем его в поток. */
.rsv > h2,
.rsv > h2.tx {
  position: static;
  left: auto;
  top: auto;
  width: auto;
  max-width: 1227px;
  margin: 0 auto 32px;
  text-align: center;
  font-family: 'Cormorant Garamond', 'Playfair Display', Georgia, serif;
  font-weight: 700;
  font-size: 64px;
  line-height: 0.95;
  letter-spacing: -0.5px;
  color: #CC9E2C;
}

.rsv__title {
  margin: 0 0 40px;
  text-align: center;
  font-family: 'Cormorant Garamond', 'Playfair Display', Georgia, serif;
  font-weight: 700;
  font-size: 64px;
  line-height: 0.92;
  letter-spacing: -0.5px;
  color: #CC9E2C;
}

/* ── Каркас карусели ── */
.rsv__carousel {
  position: relative;
  /* 1227 (трек по макету) + 2×60 под стрелки: на 1440 карточки ровно 393px */
  max-width: 1347px;
  margin: 0 auto;
  padding: 0 60px 22px;        /* боковые поля под стрелки, низ — под индикатор */
}

.rsv__viewport { position: relative; min-width: 0; }

/* ── Трек ── */
.rsv__grid {
  display: flex;
  align-items: stretch;
  gap: 24px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 0;
  padding: 6px 0 8px;          /* место под подъём карточки и тень при hover */
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  outline: none;
}
.rsv__grid::-webkit-scrollbar { display: none; height: 0; }
.rsv__grid:focus-visible {
  outline: 2px solid #CC9E2C;
  outline-offset: 4px;
  border-radius: 20px;
}
.rsv__grid.is-dragging { cursor: grabbing; }
.rsv__grid.is-dragging .rsv-card { pointer-events: none; }

/* ── Карточка ── */
.rsv-card {
  position: relative;
  flex: 0 0 calc((100% - 48px) / 3);
  min-width: 0;
  min-height: 238px;
  padding: 24px;
  border: 1px solid #B99F70;
  border-radius: 15px;
  background: rgba(187, 187, 187, 0.2);
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity .35s ease,
    transform .28s cubic-bezier(.22,.61,.36,1),
    border-color .28s ease,
    box-shadow .28s ease;
}
/* «лента»: карточка, обрезанная краем трека, притушена */
.rsv-card.is-edge { opacity: .55; }
.rsv-card:hover {
  opacity: 1;
  transform: translateY(-2px);
  border-color: rgba(204, 158, 44, 0.85);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.34);
}
.rsv-card:focus-within {
  border-color: rgba(204, 158, 44, 0.85);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.34);
}

.rsv-stars {
  display: flex;
  gap: 4px;
  margin-bottom: 32px;
  line-height: 0;
}
.rsv-stars svg { width: 32px; height: 32px; display: block; }
.rsv-stars path.is-off { fill: rgba(149, 101, 226, 0.28); }

.rsv-text {
  margin: 0 0 10px;
  font-family: "Gill Sans", "Gill Sans MT", Lato, 'Inter', -apple-system, sans-serif;
  font-style: italic;
  font-weight: 400;
  font-size: 18px;
  line-height: 22px;
  color: #BBBBBB;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.rsv-author {
  margin: auto 0 0;
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: "Gill Sans", "Gill Sans MT", Lato, 'Inter', -apple-system, sans-serif;
  font-style: italic;
  font-size: 18px;
  line-height: 22px;
  color: #CC9E2C;
}
.rsv-flag {
  font-size: 18px;
  line-height: 1;
  filter: saturate(1.1);
}

/* ── Стрелки: PREV слева (←), NEXT справа (→) ── */
.rsv__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 44px;
  height: 44px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(185, 159, 112, 0.55);
  border-radius: 50%;
  background: rgba(8, 10, 18, 0.62);
  color: #CC9E2C;
  cursor: pointer;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  transition: opacity .2s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.rsv__arrow svg { width: 22px; height: 22px; display: block; }
.rsv__arrow--prev { left: 6px; }
.rsv__arrow--next { right: 6px; }
.rsv__arrow:hover:not(:disabled) {
  background: rgba(204, 158, 44, 0.18);
  border-color: #CC9E2C;
  box-shadow: 0 0 18px rgba(204, 158, 44, 0.28);
}
.rsv__arrow:active:not(:disabled) { transform: translateY(-50%) scale(.94); }
.rsv__arrow:focus-visible {
  outline: 2px solid #CC9E2C;
  outline-offset: 3px;
}
.rsv__arrow:disabled {
  opacity: .35;
  cursor: not-allowed;
  box-shadow: none;
}

/* ── Индикатор прогресса ── */
.rsv__progress {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 160px;
  height: 3px;
  border-radius: 2px;
  background: rgba(185, 159, 112, 0.22);
  overflow: hidden;
  pointer-events: none;
}
.rsv__progress i {
  display: block;
  height: 100%;
  width: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, #B99F70, #CC9E2C);
  transform-origin: 0 50%;
  transform: scaleX(0);
  transition: transform .18s linear;
}

/* ── Подпись ── */
.rsv__note,
.rsv-note {
  max-width: 760px;
  margin: 28px auto 0;
  text-align: center;
  font-size: 13px;
  line-height: 1.6;
  font-style: italic;
  color: rgba(232, 230, 227, 0.55);
}

/* ── Появление карточек ── */
.rsv:not(.rsv--in) .rsv-card { opacity: 0; }

/* ── Планшет: 2 карточки ── */
@media (min-width: 768px) and (max-width: 1023px) {
  .rsv__carousel { max-width: 1331px; padding: 0 52px 20px; }
  .rsv-card { flex-basis: calc((100% - 24px) / 2); }
  .rsv__arrow--prev { left: 2px; }
  .rsv__arrow--next { right: 2px; }
}

/* ── Мобильный: 1.2 карточки, стрелки под треком ── */
@media (max-width: 767px) {
  .rsv { padding: 56px 0 64px; }
  .rsv > h2,
  .rsv > h2.tx { font-size: 40px; line-height: 1; }

  .rsv__carousel {
    padding: 0;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    grid-template-areas:
      "vp   vp   vp"
      "prev prog next";
    row-gap: 14px;
    align-items: center;
    column-gap: 10px;
    max-width: none;
  }
  .rsv__viewport { grid-area: vp; min-width: 0; }
  .rsv__grid {
    gap: 16px;
    padding: 4px 20px 6px;
    scroll-padding-left: 20px;
    scroll-padding-right: 20px;
  }
  .rsv-card {
    flex: 0 0 calc((100% - 20px) / 1.2);
    min-height: 210px;
    padding: 20px;
  }
  .rsv-stars { margin-bottom: 18px; gap: 3px; }
  .rsv-stars svg { width: 26px; height: 26px; }
  .rsv-text { font-size: 16px; line-height: 21px; -webkit-line-clamp: 7; }
  .rsv-author { font-size: 16px; line-height: 21px; }

  .rsv__arrow {
    position: static;
    transform: none;
    justify-self: center;
    background: rgba(8, 10, 18, 0.5);
  }
  .rsv__arrow:active:not(:disabled) { transform: scale(.94); }
  .rsv__arrow--prev { grid-area: prev; justify-self: start; }
  .rsv__arrow--next { grid-area: next; justify-self: end; }

  .rsv__progress {
    position: static;
    transform: none;
    grid-area: prog;
    justify-self: stretch;
    width: auto;
    height: 3px;
  }

  .rsv__note,
  .rsv-note { padding: 0 20px; margin-top: 20px; text-align: left; font-size: 12px; }
}

/* ── Reduced motion: без анимации, без автопрокрутки ── */
@media (prefers-reduced-motion: reduce) {
  .rsv-card,
  .rsv__arrow,
  .rsv__progress i { transition: none !important; }
  .rsv-card:hover { transform: none; }
  .rsv:not(.rsv--in) .rsv-card { opacity: 1; }
}
.rsv--static .rsv-card { transition: none; }
