/* ============================================================
   template-testimonials.grid-css  v1.0
   Finwin Travels — "What Our Guests Are Saying"

   Every value below is one of main.css's own custom properties
   (--color-gold, --font-display, --spacing-6, etc.) — zero :root
   declarations here, per main.css's own rule that no child file may
   hardcode colours, fonts or spacing. main.css already @imports
   Italiana / Cormorant Garamond / Jost / Cinzel, so this file doesn't
   re-import fonts either.

   Layout: a uniform 3x3 grid of 9 equal-height review cards (no hero
   slot) with the same flanking prev/next "stage" arrows as
   template-destinations.css and template-featured-packages.css. A
   tall hero card was tried first and dropped — a single review (name,
   country, star rating, a paragraph of text, no photo) doesn't carry
   enough real content to fill a tall card without visibly padding it
   out, which read as a bug, not a feature.

   Paging swaps the whole visible set of 9 at once (not one card at a
   time): the current 9 slide out, the next 9 "deal" in with a
   column-alternating curtain reveal — column 1 cascades top-to-bottom,
   column 2 bottom-to-top, column 3 top-to-bottom again — each card's
   own drop-in/rise-in motion matching its column's direction. Reviews
   are read off a continuous 9-at-a-time window that wraps around the
   full data set, so this keeps working whether testimonialss.json
   holds 12 entries or 60.
   ============================================================ */

#testimonials {
  position: relative;
  background: var(--bg-primary);
  padding: clamp(3.5rem, 7vw, 6.5rem) clamp(1.25rem, 4vw, 3rem) clamp(4rem, 7vw, 7rem);
  overflow: hidden;
}

/* ambient gold glows, quiet and fixed — not chasing the cursor */
#testimonials::before,
#testimonials::after {
  content: '';
  position: absolute;
  width: 46rem; height: 46rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--color-gold-rgb), 0.10) 0%, rgba(var(--color-gold-rgb), 0) 68%);
  pointer-events: none;
  z-index: 0;
}
#testimonials::before { top: -18rem; left: -14rem; }
#testimonials::after { bottom: -20rem; right: -16rem; }

#testimonials .tst__inner {
  position: relative;
  z-index: 1;
  max-width: var(--container-max);
  margin: 0 auto;
}

/* ---------- header ---------- */
#testimonials .tst__head {
  text-align: center;
  max-width: 44rem;
  margin: 0 auto clamp(1.75rem, 3.5vw, 2.25rem);
}
#testimonials .tst__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  font-family: var(--font-label);
  font-size: .7rem;
  font-weight: var(--font-weight-semibold);
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--text-gold);
}
#testimonials .tst__eyebrow::before,
#testimonials .tst__eyebrow::after {
  content: '';
  width: 1.6rem; height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-gold));
}
#testimonials .tst__eyebrow::after { transform: scaleX(-1); }

#testimonials .tst__title {
  font-family: var(--font-display);
  font-weight: var(--font-weight-normal);
  font-size: clamp(2.3rem, 4.8vw, 3.4rem);
  line-height: 1.15;
  color: var(--text-primary);
  margin: .9rem 0 1.1rem;
  text-wrap: balance;
  letter-spacing: .01em;
}
#testimonials .tst__title em {
  font-style: normal;
  color: var(--color-gold-light);
}
#testimonials .tst__lead {
  font-family: var(--font-elegant);
  font-style: italic;
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  line-height: 1.65;
  color: var(--text-muted);
  margin: 0 0 1.5rem;
}

/* compact trust strip — live-computed stats, no dedicated card needed */
#testimonials .tst__trust {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: .5rem 1.75rem;
  margin: 0 0 1.75rem;
  min-height: 1.6rem;
}
#testimonials .tst__trust-item {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font-family: var(--font-primary);
  font-size: .82rem;
  color: var(--text-muted);
}
#testimonials .tst__trust-item svg { width: 14px; height: 14px; color: var(--color-gold); flex: none; }
#testimonials .tst__trust-item b {
  font-family: var(--font-display);
  font-weight: var(--font-weight-normal);
  font-size: 1.1rem;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
#testimonials .tst__trust-sep { width: 1px; height: 1rem; background: var(--border-primary); }

/* quiet idle pulse on the nav arrows — invites the click without demanding it */
@keyframes tst-arrow-idle {
  0%, 100% { box-shadow: 0 0 0 0 rgba(var(--color-gold-rgb), 0); }
  50% { box-shadow: 0 0 0 7px rgba(var(--color-gold-rgb), 0.10); }
}
#testimonials .tst__arrow {
  width: 2.9rem; height: 2.9rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-gold);
  background: var(--gradient-card);
  color: var(--color-gold-light);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: var(--transition-elegant);
  animation: tst-arrow-idle 3.4s ease-in-out infinite;
}
#testimonials .tst__arrow svg { width: 16px; height: 16px; }
#testimonials .tst__arrow:hover {
  border-color: var(--color-gold);
  background: var(--color-navy-mid);
  box-shadow: var(--shadow-gold);
  transform: translateY(-2px);
  animation-play-state: paused;
}
#testimonials .tst__arrow:focus-visible { outline: 2px solid var(--color-gold); outline-offset: 2px; }

#testimonials .tst__counter {
  display: block;
  font-family: var(--font-primary);
  font-variant-numeric: tabular-nums;
  font-size: .8rem;
  letter-spacing: .08em;
  color: var(--text-muted);
  text-align: center;
}
#testimonials .tst__counter b { color: var(--color-gold-light); font-weight: var(--font-weight-semibold); }

/* ---------- stage: side arrows flank the 3x3 grid ---------- */
#testimonials .tst__stage {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  margin-top: clamp(2rem, 3.5vw, 2.75rem);
}
#testimonials .tst__stage .tst__arrow { flex: none; }
#testimonials .tst__viewport {
  flex: 1 1 auto;
  min-width: 0;
  padding: 1rem;
  border-radius: var(--radius-3xl);
  border: 1px solid var(--border-gold);
  box-shadow: var(--shadow-luxury);
}

/* each card stands slightly apart — a small gap of breathing room,
   with its own gold hairline border, rather than the flush zero-gap
   mosaic used by Destinations/Featured Packages */
#testimonials .tst__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  min-height: 15.5rem;
}

#testimonials .tst__loading {
  grid-column: 1 / -1;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--spacing-3);
  background: var(--gradient-card); color: var(--text-muted);
  font-family: var(--font-primary); font-size: var(--text-sm); letter-spacing: var(--ls-wide);
  min-height: 15.5rem;
}
#testimonials .tst__spinner {
  width: 22px; height: 22px; border-radius: var(--radius-full);
  border: 2px solid var(--border-primary); border-top-color: var(--color-gold);
  animation: tst-spin .8s linear infinite;
}
@keyframes tst-spin { to { transform: rotate(360deg); } }

#testimonials .tst-card {
  position: relative;
  background: var(--gradient-card);
  padding: clamp(1.4rem, 1.9vw, 1.8rem);
  min-height: 15.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-gold);
  transition: border-color .35s ease;
}

/* thin gold rule that draws itself in across the top of each card,
   in step with the fade — a small "curtain rising" flourish */
#testimonials .tst-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--color-gold), transparent);
  transform: scaleX(0);
  transform-origin: var(--rule-origin, center);
  transition: transform .6s cubic-bezier(.22, .68, .35, 1);
  transition-delay: var(--d, 0ms);
}
#testimonials .tst__grid.is-entering .tst-card::before { transform: scaleX(1); }

#testimonials .tst-card:hover { background: var(--color-navy-mid); border-color: var(--color-gold); }
#testimonials .tst-card:hover::before { transform: scaleX(1); }

/* soft gold spotlight that follows the pointer inside the card,
   echoing the .card-glow concept from the original template */
#testimonials .tst-card__glow {
  position: absolute; inset: 0;
  pointer-events: none;
  background: radial-gradient(220px circle at var(--mx, 50%) var(--my, 50%), rgba(var(--color-gold-rgb), 0.13), transparent 70%);
  opacity: 0;
  transition: opacity .45s ease;
}
#testimonials .tst-card:hover .tst-card__glow { opacity: 1; }
#testimonials .tst-card > *:not(.tst-card__glow) { position: relative; z-index: 1; }

/* ---- exit / deal-in choreography ----
   Column 1 cascades top -> bottom, column 2 bottom -> top,
   column 3 top -> bottom again — a curtain that alternates
   direction across the grid instead of one flat wave. */
@keyframes tst-enter-down {
  0% { opacity: 0; transform: translateY(-18px); }
  100% { opacity: 1; transform: translateY(0); }
}
@keyframes tst-enter-up {
  0% { opacity: 0; transform: translateY(18px); }
  100% { opacity: 1; transform: translateY(0); }
}
#testimonials .tst__grid.is-entering .tst-card {
  animation-name: var(--enter-anim, tst-enter-down);
  animation-duration: .6s;
  animation-timing-function: cubic-bezier(.22, .68, .35, 1);
  animation-fill-mode: both;
  animation-delay: var(--d, 0ms);
}
#testimonials .tst__grid.is-leaving .tst-card {
  transition: opacity .28s ease, transform .28s ease;
  opacity: 0;
  transform: translateX(var(--exit-x, -24px));
}

#testimonials .tst-card__stars { display: flex; gap: .2rem; margin-bottom: .85rem; }
#testimonials .tst-card__stars svg { width: 13px; height: 13px; }
#testimonials .tst-star--full { color: var(--color-gold); }
#testimonials .tst-star--empty { color: rgba(var(--color-gold-rgb), 0.22); }

#testimonials .tst-card__text {
  font-family: var(--font-elegant);
  font-style: italic;
  font-size: 1.2rem;
  line-height: 1.5;
  color: var(--text-primary);
  margin: 0 0 1.1rem;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1 1 auto;
}
#testimonials .tst-card__text::before { content: '\201C'; color: var(--color-gold); font-size: 1.15em; font-style: normal; }
#testimonials .tst-card__text::after { content: '\201D'; color: var(--color-gold); font-size: 1.15em; font-style: normal; }

#testimonials .tst-card__author {
  display: flex; align-items: center; gap: .75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-primary);
}
#testimonials .tst-avatar {
  flex: none;
  width: 2.5rem; height: 2.5rem;
  border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-weight: var(--font-weight-normal);
  font-size: 1rem;
  color: var(--color-gold-light);
  background: linear-gradient(155deg, rgba(var(--color-gold-rgb), 0.18), rgba(var(--color-gold-rgb), 0.04));
  border: 1px solid var(--border-gold);
}
#testimonials .tst-card__name {
  font-family: var(--font-primary);
  font-weight: var(--font-weight-semibold);
  font-size: .88rem;
  color: var(--text-primary);
  margin: 0;
}
#testimonials .tst-card__loc {
  display: flex; align-items: center; gap: .35rem;
  font-family: var(--font-primary);
  font-size: .74rem;
  color: var(--text-muted);
  margin: .1rem 0 0;
}
#testimonials .tst-card__loc svg { width: 10px; height: 10px; color: var(--color-gold); flex: none; }

/* ---------- mobile nav / foot ---------- */
#testimonials .tst__mobile-nav { display: none; justify-content: center; gap: 1rem; margin-top: 1.3rem; }
#testimonials .tst__foot { display: flex; justify-content: center; margin-top: clamp(2rem, 4vw, 2.75rem); }
#testimonials .tst__cta {
  display: inline-flex; align-items: center; gap: .6rem;
  font-family: var(--font-label);
  font-weight: var(--font-weight-semibold);
  font-size: .78rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--bg-primary);
  background: var(--color-gold);
  border: 1px solid var(--color-gold);
  border-radius: var(--radius-full);
  padding: .85rem 1.8rem;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition-elegant);
}
#testimonials .tst__cta:hover {
  background: var(--color-gold-light);
  transform: translateY(-2px);
  box-shadow: var(--glow-gold);
}
#testimonials .tst__cta svg { width: 14px; height: 14px; }

/* ---------- responsive ---------- */
@media (max-width: 991px) {
  #testimonials .tst__grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  #testimonials .tst__grid { grid-template-columns: 1fr; }
  #testimonials .tst__stage > .tst__arrow { display: none; }
  #testimonials .tst__mobile-nav { display: flex; }
  #testimonials .tst-card { min-height: 0; }
}

@media (prefers-reduced-motion: reduce) {
  #testimonials .tst__grid.is-entering .tst-card { animation: none !important; opacity: 1; transform: none; }
  #testimonials .tst__grid.is-leaving .tst-card { transition: none !important; opacity: 1; transform: none; }
  #testimonials .tst-card::before { transition: none !important; transform: scaleX(1); }
  #testimonials .tst__arrow { animation: none !important; }
  #testimonials .tst__arrow, #testimonials .tst__cta { transition: none !important; }
  #testimonials .tst__spinner { animation: none; }
}
