/* ==========================================================================
   Testimonials page
   ========================================================================== */

/* Hero rating row (stars + meta under the lead paragraph) */
.page-hero__rating {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-16);
  margin-top: var(--spacing-24);
  padding: var(--spacing-8) var(--spacing-16);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
}

.page-hero__rating-stars {
  display: inline-flex;
  gap: 2px;
  color: #F5F5F5;
}

.page-hero__rating-stars svg { width: 16px; height: 16px; }

.page-hero__rating-meta {
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-light-grey);
}

/* Overall rating summary */
.rating-summary {
  display: flex;
  align-items: center;
  gap: var(--spacing-32);
  flex-wrap: wrap;
  padding: var(--spacing-32);
  background: var(--bg-surface);
  border: var(--border-hairline);
  margin-bottom: var(--spacing-48);
}

.rating-summary__score {
  display: flex;
  align-items: baseline;
  gap: var(--spacing-16);
}

.rating-summary__value {
  font-family: var(--font-heading);
  font-size: 4rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 0.9;
}

.rating-summary__out-of {
  font-size: 1rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.rating-summary__stars {
  display: inline-flex;
  gap: 4px;
}

.rating-summary__stars svg { width: 22px; height: 22px; }

.rating-summary__meta {
  font-size: 0.9375rem;
  color: var(--text-muted);
  margin-left: auto;
  max-width: 32ch;
}

@media (max-width: 640px) {
  .rating-summary__meta { margin-left: 0; }
  .rating-summary__value { font-size: 3rem; }
}

/* ==========================================================================
   Video testimonial carousel (stories)
   ========================================================================== */
.stories {
  position: relative;
  margin-block: var(--spacing-48);
}

.stories__track {
  display: flex;
  gap: var(--spacing-8);
  overflow-x: auto;
  overflow-y: hidden;
  /* scroll-behavior is left at the default (auto) because the auto-scroll
     tick in stories.js drives `scrollLeft += px` via requestAnimationFrame.
     With `smooth`, Safari treats each tiny assignment as a new smooth-scroll
     target and drops the increments — the carousel sits still. Prev/next
     buttons opt back into smooth explicitly via scrollBy({ behavior: 'smooth' }). */
  -webkit-overflow-scrolling: touch;
  /* Tell iOS this region pans horizontally — without it, the page's vertical
     scroll captures the gesture and the track refuses to swipe. */
  touch-action: pan-x;
  cursor: grab;
  padding-block: var(--spacing-8);
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.stories__track::-webkit-scrollbar { display: none; }

.stories__track.is-dragging {
  cursor: grabbing;
  user-select: none;
}

.stories__track.is-dragging .story,
.stories__track.is-dragging .story * { pointer-events: none; }

.story {
  position: relative;
  flex: 0 0 200px;
  aspect-ratio: 3 / 4;
  border-radius: 12px;
  overflow: hidden;
  background: var(--color-light-grey);
  cursor: pointer;
  transition: transform 250ms var(--ease-standard),
              box-shadow 250ms var(--ease-standard);
  outline-offset: 3px;
}

.story:hover,
.story:focus-visible {
  transform: scale(1.02);
  box-shadow: 0 12px 24px -8px rgba(0, 0, 0, 0.3);
}

.story__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 200ms var(--ease-standard);
  background: #1a1a1a;
  /* iOS Safari: the native video element captures touch and blocks parent
     scroll. Pass-through to .story so the track can be swiped, while the
     modal click handler (bound to .story) still fires on tap. */
  pointer-events: none;
}

.story:hover .story__video,
.story:focus-visible .story__video { opacity: 0.92; }

.story__overlay {
  position: absolute;
  left: 0;
  right: 0;
  pointer-events: none;
  z-index: 1;
}

.story__overlay--top {
  top: 0;
  height: 40px;
  background: linear-gradient(180deg, rgba(0,0,0,0.25), transparent);
}

.story__overlay--bottom {
  bottom: 0;
  height: 80px;
  background: linear-gradient(0deg, rgba(0,0,0,0.7), transparent);
}

.story__name {
  position: absolute;
  right: 12px;
  bottom: 12px;
  color: var(--color-off-white);
  font-family: var(--font-heading);
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  z-index: 2;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.55);
  max-width: calc(100% - 24px);
  text-align: right;
}

/* Prev / next buttons */
.stories__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(14, 14, 14, 0.85);
  color: var(--color-off-white);
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
  transition: background-color var(--transition-fast), opacity var(--transition-fast);
  box-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.3);
}

.stories__nav:hover { background: var(--color-black); }

.stories__nav--prev { left: -8px; }
.stories__nav--next { right: -8px; }

.stories__nav[disabled] {
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 900px) {
  .stories__nav { display: none; }
}

/* --------------------------------------------------------------------------
   Video modal — opened on story click
   -------------------------------------------------------------------------- */
.story-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-24);
}

.story-modal[hidden] { display: none; }

.story-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 10, 0.92);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fadeIn 200ms var(--ease-out);
}

.story-modal__dialog {
  position: relative;
  max-width: min(520px, calc(100vw - 48px));
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-16);
  animation: modalRise 300ms var(--ease-out);
}

@keyframes modalRise {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}

.story-modal__video {
  width: 100%;
  max-height: 80vh;
  display: block;
  background: #000;
  border-radius: 12px;
  box-shadow: 0 24px 60px -12px rgba(0, 0, 0, 0.6);
}

.story-modal__close {
  position: absolute;
  top: -48px;
  right: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: var(--color-off-white);
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color var(--transition-fast);
  z-index: 2;
}

.story-modal__close:hover {
  background: rgba(255, 255, 255, 0.22);
}

@media (max-width: 640px) {
  .story-modal__close { top: -44px; right: 0; }
}

.story-modal__name {
  color: var(--color-off-white);
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Testimonials grid — masonry-ish via CSS columns */
.testimonials-grid {
  columns: 3;
  column-gap: var(--spacing-24);
}

@media (max-width: 900px) { .testimonials-grid { columns: 2; } }
@media (max-width: 600px) { .testimonials-grid { columns: 1; } }

.testimonials-grid .testimonial {
  display: inline-flex;
  width: 100%;
  margin-bottom: var(--spacing-24);
  break-inside: avoid;
  max-width: none;
}

/* Google badge / source */
.review-source {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-top: var(--spacing-8);
  padding-top: var(--spacing-16);
  border-top: 1px dashed var(--border-subtle);
}

.review-source__stars {
  display: inline-flex;
  gap: 2px;
  color: var(--color-black);
}

.review-source__stars svg { width: 12px; height: 12px; }

/* Filter chips */
.testimonial-filters {
  display: flex;
  gap: var(--spacing-8);
  flex-wrap: wrap;
  margin-bottom: var(--spacing-32);
}

