/* =============================================================================
   REVIEWS PAGE (/reviews)
   Mixed multi-row carousel + per-platform sections + leave-a-review CTAs.
   Uses the shared tokens, .btn, .page-hero, .cta-strip and .testimonial-card
   from core.css. reviews.js drives the carousel motion and the "show all"
   toggles; the CSS marquee keyframes are the no-JS fallback.
   ========================================================================== */

:root {
  /* Brand accents — used for pill text/logos on the dark surface and the
     hover ring on the white platform buttons. The pill colours clear WCAG AA
     4.5:1 against #141d2b (Google 4.75, Trustpilot 6.43, TrustATrader 5.91). */
  --clr-google:       #4285f4;
  --clr-trustpilot:   #00b67a;
  --clr-trustatrader: #4a9fe0;
}

/* ---- Platform pill -------------------------------------------------------- */
.review-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1;
  border: 1px solid currentColor;
  background: var(--clr-bg-dark);
}

/* The platform's real logo, drawn from a data URI so no extra DOM node or
   request is needed. Replaces the old plain colour dot. */
.review-pill::before {
  content: "";
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

.review-pill--google       { color: var(--clr-google); }
.review-pill--trustpilot   { color: var(--clr-trustpilot); }
.review-pill--trustatrader { color: var(--clr-trustatrader); }

.review-pill--google::before {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='%234285f4' d='M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z'/><path fill='%2334a853' d='M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z'/><path fill='%23fbbc05' d='M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z'/><path fill='%23ea4335' d='M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z'/></svg>");
}

.review-pill--trustpilot::before {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='%2300b67a' d='M12 2l2.95 5.97 6.59.96-4.77 4.65 1.13 6.56L12 17.01l-5.9 3.13 1.13-6.56L2.46 8.93l6.59-.96z'/></svg>");
}

.review-pill--trustatrader::before {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='%231c75bc' d='M12 2l8 3v6c0 5-3.4 8.4-8 10-4.6-1.6-8-5-8-10V5z'/><path fill='%23ffffff' d='M10.6 14.3l-2.3-2.3-1.2 1.2 3.5 3.5 6-6-1.2-1.2z'/></svg>");
}

.review-pill--lg {
  font-size: 0.8rem;
  padding: 0.4rem 0.9rem;
}

.review-pill--lg::before {
  width: 16px;
  height: 16px;
}

/* ---- Hero: content + a review summary card ------------------------------- */
.reviews-hero__inner {
  display: grid;
  gap: var(--sp-10);
  align-items: center;
}

@media (min-width: 920px) {
  .reviews-hero__inner {
    grid-template-columns: 1fr minmax(320px, 380px);
    gap: var(--sp-16);
  }
}

.reviews-hero__main {
  min-width: 0;
}

/* The summary card gives the rating a fixed home (no more "floating" badge)
   and pairs it with the leave-a-review platform buttons. */
.reviews-hero__summary {
  background: var(--clr-bg-surface-solid);
  border: 1px solid var(--clr-border-bright);
  border-radius: var(--radius-lg);
  padding: var(--sp-6);
  box-shadow: var(--shadow-md);
}

.reviews-hero__rating {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding-bottom: var(--sp-5);
  margin-bottom: var(--sp-5);
  border-bottom: 1px solid var(--clr-border);
}

.reviews-hero__score {
  font-family: var(--font-display);
  font-size: 3rem;
  line-height: 1;
  color: var(--clr-accent);
}

.reviews-hero__rating-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.reviews-hero__stars {
  color: #f59e0b;
  font-size: 1.15rem;
  letter-spacing: 2px;
}

.reviews-hero__count {
  font-size: 0.85rem;
  color: var(--clr-text-muted);
}

.reviews-hero__leave-title {
  margin: 0 0 var(--sp-3);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--clr-text-muted);
}

.reviews-hero__platforms {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.reviews-hero__platforms .platform-cta {
  width: 100%;
}

/* ---- Platform "leave a review" button (logo + brand accent) -------------- */
.platform-cta {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-3);
  min-height: 48px;
  padding: 0.6rem 0.9rem;
  background: #ffffff;
  color: #1a2433;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.9rem;
  text-align: left;
  transition: transform var(--ease-fast), box-shadow var(--ease);
}

.platform-cta__text {
  flex: 1 1 auto;
}

.platform-cta__arrow {
  width: 16px;
  height: 16px;
  color: #6b7686;
  flex-shrink: 0;
}

.platform-logo {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  display: block;
}

.platform-cta:hover {
  transform: translateY(-2px);
}

.platform-cta--google:hover       { box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35), 0 0 0 2px var(--clr-google); }
.platform-cta--trustpilot:hover   { box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35), 0 0 0 2px var(--clr-trustpilot); }
.platform-cta--trustatrader:hover { box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35), 0 0 0 2px var(--clr-trustatrader); }

.platform-cta:focus-visible {
  outline: 3px solid var(--clr-accent);
  outline-offset: 2px;
}

/* ---- Mixed carousel ------------------------------------------------------- */
.reviews-marquee {
  padding: var(--sp-12) 0 var(--sp-16);
  background: var(--clr-bg-dark);
  overflow: hidden;
}

.reviews-marquee__rows {
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
  margin-top: var(--sp-10);
}

.reviews-marquee__row {
  overflow: hidden;
  /* JS owns horizontal motion; let the browser keep vertical page scroll. */
  touch-action: pan-y;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 5%, #000 95%, transparent);
          mask-image: linear-gradient(to right, transparent, #000 5%, #000 95%, transparent);
}

.reviews-marquee__track {
  display: flex;
  align-items: stretch;
  gap: var(--sp-5);
  width: max-content;
  margin: 0;
  padding: var(--sp-2) 0;
  list-style: none;
  will-change: transform;
  animation: reviews-marquee-ltr 60s linear infinite;
}

.reviews-marquee__row[data-direction="rtl"] .reviews-marquee__track {
  animation-name: reviews-marquee-rtl;
}

.reviews-marquee__row:hover .reviews-marquee__track {
  animation-play-state: paused;
}

.reviews-marquee__card {
  flex: 0 0 auto;
  /* Single width rule across all viewports: ~one card with the next peeking on
     phones, a fixed 360px on wider screens. No breakpoint jump. */
  width: min(85vw, 360px);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding: var(--sp-5);
  background: var(--clr-bg-surface-solid);
  border: 1px solid var(--clr-border-bright);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.28);
}

.reviews-marquee__card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
}

.reviews-marquee__stars {
  color: #f59e0b;
  font-size: 0.85rem;
  letter-spacing: 1px;
  white-space: nowrap;
}

.reviews-marquee__text {
  margin: 0;
  color: var(--clr-text);
  font-size: 0.92rem;
  line-height: 1.6;
  /* Uniform card height: clamp the quote to four lines. */
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.reviews-marquee__author {
  margin: 0;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--clr-text-bright);
}

.reviews-marquee__loc {
  font-weight: 400;
  color: var(--clr-text-muted);
}

/* Pause / play control (revealed by reviews.js; hidden without JS and under
   reduced-motion where there is no motion to pause). Satisfies WCAG 2.2.2. */
.reviews-marquee__controls {
  margin-top: var(--sp-5);
}

.reviews-marquee__toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  min-height: 40px;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--clr-text-bright);
  background: var(--clr-bg-surface-solid);
  border: 1px solid var(--clr-border-bright);
  cursor: pointer;
  transition: border-color var(--ease), background-color var(--ease);
}

.reviews-marquee__toggle:hover {
  border-color: var(--clr-accent);
}

.reviews-marquee__toggle:focus-visible {
  outline: 3px solid var(--clr-accent);
  outline-offset: 2px;
}

.reviews-marquee__toggle svg {
  width: 16px;
  height: 16px;
}

.reviews-marquee__toggle .icon-play { display: none; }
.reviews-marquee__toggle[aria-pressed="true"] .icon-pause { display: none; }
.reviews-marquee__toggle[aria-pressed="true"] .icon-play { display: inline; }

@keyframes reviews-marquee-ltr {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-50%, 0, 0); }
}

@keyframes reviews-marquee-rtl {
  from { transform: translate3d(-50%, 0, 0); }
  to   { transform: translate3d(0, 0, 0); }
}

/* ---- Per-platform sections ------------------------------------------------ */
.reviews-platform {
  padding: var(--sp-16) 0;
}

.reviews-platform--google      { background: var(--clr-bg); }
.reviews-platform--trustpilot  { background: var(--clr-bg-dark); }
.reviews-platform--trustatrader { background: var(--clr-bg); }

.reviews-platform__head {
  max-width: 760px;
}

.reviews-platform__tagline {
  margin: var(--sp-3) 0 var(--sp-2);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--clr-text-muted);
}

.reviews-platform__head .section-heading {
  margin-bottom: var(--sp-3);
}

.reviews-platform__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  margin-top: var(--sp-6);
}

.reviews-platform__grid {
  margin-top: var(--sp-10);
}

/* Collapsed state: show a first batch, reveal the rest via the toggle. */
.reviews-platform__grid:not(.is-expanded) .testimonial-card:nth-child(n+7) {
  display: none;
}

.reviews-platform__more {
  display: flex;
  justify-content: center;
  margin-top: var(--sp-8);
}

/* ---- Empty / invitation state -------------------------------------------- */
.reviews-empty {
  max-width: 620px;
  margin: var(--sp-10) auto 0;
  padding: var(--sp-8) var(--sp-6);
  text-align: center;
  background: var(--clr-bg-surface);
  border: 1px dashed var(--clr-border-bright);
  border-radius: var(--radius-lg);
}

.reviews-empty__icon {
  width: 40px;
  height: 40px;
  color: var(--clr-accent);
  margin-bottom: var(--sp-3);
}

.reviews-empty__text {
  margin: 0 0 var(--sp-6);
  color: var(--clr-text);
  font-size: 1rem;
  line-height: 1.7;
}

/* ---- Non-Google badge icons on the universal card ------------------------- */
/* core.css gives .testimonial-card__meta::before the Google "G" by default;
   override only for the other platforms so a future tagged review reads right. */
.testimonial-card__meta--trustpilot::before {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='%2300b67a' d='M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01z'/></svg>");
}

.testimonial-card__meta--trustatrader::before {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='%231c75bc' d='M12 2l8 3v6c0 5-3.4 8.4-8 10-4.6-1.6-8-5-8-10V5z'/><path fill='%23ffffff' d='M10.6 14.3l-2.3-2.3-1.2 1.2 3.5 3.5 6-6-1.2-1.2z'/></svg>");
}

/* ---- Leave-a-review CTA band --------------------------------------------- */
/* Reuses the .platform-cta component (logo + brand-accent hover) so the page
   has one consistent "review us" button everywhere. */
.reviews-cta__platforms {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  justify-content: center;
}

/* ---- Trust intro ---------------------------------------------------------- */
.reviews-intro {
  padding: var(--sp-16) 0;
  background: var(--clr-bg);
}

.reviews-intro__body {
  max-width: 760px;
  margin-top: var(--sp-4);
}

.reviews-intro__body p {
  margin: 0 0 var(--sp-4);
  color: var(--clr-text);
  font-size: 1.02rem;
  line-height: 1.75;
}

.reviews-intro__body a {
  color: var(--clr-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.reviews-intro__points {
  list-style: none;
  margin: var(--sp-6) 0 0;
  padding: 0;
  max-width: 760px;
  display: grid;
  gap: var(--sp-3);
}

.reviews-intro__points li {
  position: relative;
  padding-left: var(--sp-6);
  color: var(--clr-text);
  font-size: 0.95rem;
  line-height: 1.5;
}

.reviews-intro__points li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 3px;
  width: 7px;
  height: 12px;
  border-right: 2px solid var(--clr-accent);
  border-bottom: 2px solid var(--clr-accent);
  transform: rotate(45deg);
}

@media (min-width: 640px) {
  .reviews-intro__points {
    grid-template-columns: 1fr 1fr;
  }
}

/* ---- Reputation FAQ ------------------------------------------------------- */
.reviews-faq {
  padding: var(--sp-16) 0;
  background: var(--clr-bg-dark);
}

.reviews-faq__list {
  max-width: 820px;
  margin-top: var(--sp-8);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.reviews-faq .faq-item__body a {
  color: var(--clr-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ---- Review date on the universal card (reviews page only) --------------- */
.testimonial-card__date {
  margin: var(--sp-1) 0 0;
  font-size: 0.72rem;
  color: var(--clr-text-muted);
}

/* ---- Responsive ----------------------------------------------------------- */
@media (max-width: 767px) {
  .reviews-platform__grid:not(.is-expanded) .testimonial-card:nth-child(n+4) {
    display: none;
  }

  .reviews-platform__more .btn,
  .reviews-empty .btn {
    width: 100%;
  }

  .reviews-cta__platforms .platform-cta {
    width: 100%;
  }
}

/* ---- Reduced motion: stop the carousel, lay it out as a static grid ------- */
@media (prefers-reduced-motion: reduce) {
  .reviews-marquee__row {
    -webkit-mask-image: none;
            mask-image: none;
  }

  .reviews-marquee__track {
    animation: none;
    width: 100%;
    flex-wrap: wrap;
    justify-content: center;
  }

  .reviews-marquee__card[aria-hidden="true"] {
    display: none;
  }

  /* No motion to pause, so the control is irrelevant. */
  .reviews-marquee__controls {
    display: none;
  }

  .platform-cta:hover {
    transform: none;
  }
}
