/* "What our clients say" (tools/lib/site.mjs reviewsSection): homepage and /about/.
   Phones (under 640px): cards swipe sideways. 640-999px: two columns. 1000px and up: three columns.
   The grid uses half-card tracks (4 or 6) so a last row with fewer cards is centered, never left-aligned.
   Long reviews are clamped to 6 lines by /assets/reviews.js (full text without JavaScript). */
.reviews{
  --rv-ink:var(--navy); --rv-muted:var(--charcoal); --rv-line:var(--border);
  --rv-shadow:0 1px 2px rgba(11,31,58,.05), 0 8px 24px -16px rgba(11,31,58,.22);
  --rv-shadow-hover:0 1px 2px rgba(11,31,58,.06), 0 14px 32px -16px rgba(11,31,58,.3);
}
.reviews-head{ max-width:720px; margin:0 auto clamp(32px,4vw,48px); text-align:center; }
.reviews-head .eyebrow{ justify-content:center; }
.reviews-head h2{ font-size:clamp(1.9rem,3.4vw,2.6rem); margin-bottom:12px; }
.reviews-intro{ margin:0 auto; color:var(--charcoal-dark); }

/* Phones: swipe sideways */
.reviews-grid{
  display:grid; grid-auto-flow:column; grid-auto-columns:min(86%, 360px); gap:16px;
  overflow-x:auto; scroll-snap-type:x mandatory; scroll-padding-inline:4px; padding:4px 4px 16px; margin:0 -4px;
  list-style:none; overscroll-behavior-x:contain;
}
.reviews-grid:focus-visible{ outline:3px solid var(--focus); outline-offset:4px; border-radius:14px; }
/* 640-999px: two columns of up to 360px, centered; an odd last card sits in the middle */
@media (min-width:640px){
  .reviews-grid{
    grid-auto-flow:row; grid-auto-columns:auto; overflow:visible; scroll-snap-type:none; padding:0; margin:0;
    grid-template-columns:repeat(4, minmax(0, 168px)); justify-content:center; gap:24px;
  }
  .review-card{ grid-column:span 2; }
  .review-card:last-child:nth-child(odd){ grid-column:2 / span 2; }
}
/* 1000px and up: three columns; a last row of one or two cards is centered */
@media (min-width:1000px){
  .reviews-grid{ grid-template-columns:repeat(6, minmax(0, 168px)); }
  .review-card:last-child:nth-child(odd){ grid-column:span 2; }
  .review-card:last-child:nth-child(3n+1){ grid-column:3 / span 2; }
  .review-card:nth-last-child(2):nth-child(3n+1){ grid-column:2 / span 2; }
}

/* Card */
.review-card{ scroll-snap-align:start; display:flex; min-width:0; }
.review-card figure{
  display:flex; flex-direction:column; width:100%; margin:0; padding:28px;
  background:var(--surface, #fff); border:1px solid var(--rv-line); border-radius:14px; box-shadow:var(--rv-shadow);
}
@media (max-width:399px){ .review-card figure{ padding:22px; } }
.review-top{ display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:16px; }
.review-stars{ display:flex; gap:3px; color:var(--gold); }
.review-star{ width:18px; height:18px; fill:currentColor; stroke:none; }
.review-quote{ font:500 2.75rem/1 var(--font-serif); color:var(--gold); height:.55em; overflow:visible; }
.review-text{ margin:0 0 20px; }
.review-text:has(+ .review-more:not([hidden])){ margin-bottom:0; }
.review-text p{ margin:0; max-width:none; font-size:1.03125rem; line-height:1.65; color:var(--rv-ink); }
.reviews.js-clamp .review-card:not(.is-open) .review-text p{
  display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:6; line-clamp:6; overflow:hidden;
}
.review-more{
  align-self:flex-start; min-height:32px; margin:6px 0 20px; padding:4px 0; border:0; background:none; cursor:pointer;
  font:600 .9375rem/1.3 var(--font-sans); color:var(--navy); text-decoration:underline; text-underline-offset:3px;
}
.review-more:hover{ color:var(--navy-700); }
.review-more:focus-visible{ outline:3px solid var(--focus); outline-offset:2px; border-radius:4px; }

/* Author, pinned to the bottom of the card */
.review-card figcaption{ display:flex; align-items:center; gap:14px; margin-top:auto; padding-top:20px; border-top:1px solid var(--rv-line);
  min-height:96px; /* room for a wrapped tag, so the divider lines up across a row */ }
.review-avatar{
  flex:none; display:grid; place-items:center; width:44px; height:44px; margin:3px; border-radius:50%;
  background:var(--navy); color:#fff; font:500 1rem/1 var(--font-serif); letter-spacing:.02em;
  box-shadow:0 0 0 2px var(--surface, #fff), 0 0 0 4px var(--gold);
}
.review-who{ display:flex; flex-direction:column; gap:4px; min-width:0; }
.review-name{ font-weight:600; font-size:1rem; line-height:1.3; color:var(--navy); }
.review-meta{ display:flex; flex-wrap:wrap; align-items:center; gap:6px 10px; }
.review-source{ font-size:.875rem; line-height:1.3; color:var(--rv-muted); }
.review-tag{
  font-size:.8125rem; font-weight:600; line-height:1.3; color:var(--navy);
  padding:3px 10px; border-radius:999px; background:var(--navy-tint, #EEF1F5); border:1px solid #D9DFE8;
}

/* Below the grid */
.reviews-note{ margin:24px auto 0; font-size:.9rem; color:var(--rv-muted); text-align:center; }
.reviews-more{ margin:16px auto 0; text-align:center; max-width:none; }
.about-reviews{ padding-block:8px 48px; }

/* Hover lift only when motion is allowed */
@media (hover:hover) and (prefers-reduced-motion:no-preference){
  .review-card figure{ transition:transform .2s var(--ease), box-shadow .2s var(--ease); }
  .review-card figure:hover{ transform:translateY(-2px); box-shadow:var(--rv-shadow-hover); }
}
