/* ============================================================
   template-testimonials-grid.css  v2.0
   Almare Lanka Travels — "What Our Guests Are Saying"
   Silver Shore theme. Every value is a main.css custom property; no
   colours, fonts or spacing are declared here. main.css already
   imports Cormorant Garamond, Jost and Cinzel.

   Palette in this section (Silver Shore rules):
     Pearl / Platinum / Moon Silver  surfaces, cards, quote mark
     Satin Silver sheen              card top edge, rules, avatar ring
     Deep / Royal Sapphire           headings, names, arrows, progress
     Ocean Light                     hover accents
     Champagne Gold                  small accents only: eyebrow, stars,
                                     avatar ring and edge glint on hover
     Lagoon / Silver Lagoon          small accent only: country tag

   Layout: one row of cards in a sliding track. 4 cards on desktop,
   2 on tablet (max-width 991px), 1 on mobile (max-width 760px); the JS
   sets --per to the same numbers. A slide glides the whole row
   sideways; the progress line under the row is the autoplay timer.
   ============================================================ */

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

/* quiet ambient light: moon silver top left, silver lagoon bottom right */
#testimonials::before,
#testimonials::after {
  content: '';
  position: absolute;
  width: 46rem; height: 46rem;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}
#testimonials::before {
  top: -20rem; left: -16rem;
  background: radial-gradient(circle, rgba(var(--color-gold-rgb), 0.08) 0%, rgba(var(--color-gold-rgb), 0) 68%);
}
#testimonials::after {
  bottom: -22rem; right: -16rem;
  background: radial-gradient(circle, rgba(var(--color-lagoon-rgb), 0.14) 0%, rgba(var(--color-lagoon-rgb), 0) 66%);
}

#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: 46rem;
  margin: 0 auto clamp(2rem, 4vw, 2.75rem);
}
#testimonials .tst__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .8rem;
  font-family: var(--font-label);
  font-size: .7rem;
  font-weight: var(--font-weight-semibold);
  letter-spacing: .34em;
  text-transform: uppercase;
  color: var(--color-champagne-text);
}
#testimonials .tst__eyebrow::before,
#testimonials .tst__eyebrow::after {
  content: '';
  width: 2rem; height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-champagne));
}
#testimonials .tst__eyebrow::after { transform: scaleX(-1); }

#testimonials .tst__title {
  font-family: var(--font-display);
  font-weight: var(--font-weight-light);
  font-size: clamp(2.3rem, 4.8vw, 3.4rem);
  line-height: 1.12;
  color: var(--color-royal-light);
  margin: .9rem 0 0;
  text-wrap: balance;
  letter-spacing: .01em;
}
#testimonials .tst__title em {
  font-style: italic;
  color: var(--color-gold);
}
#testimonials .tst__rule {
  display: block;
  width: 72px; height: 2px;
  margin: 1.1rem auto 1.2rem;
  background: var(--color-silver-sheen);
  border-radius: var(--radius-full);
}
#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.6rem;
}

/* trust strip: three small platinum chips */
#testimonials .tst__trust {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: .6rem 1rem;
  min-height: 2.2rem;
}
#testimonials .tst__trust-item {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .4rem .95rem;
  border-radius: var(--radius-full);
  background: var(--color-platinum);
  border: 1px solid var(--border-primary);
  box-shadow: var(--shadow-xs);
  font-family: var(--font-primary);
  font-size: .8rem;
  color: var(--text-muted);
}
#testimonials .tst__trust-item svg { width: 13px; height: 13px; flex: none; color: var(--color-gold); }
#testimonials .tst__trust-item:first-child svg { color: var(--color-champagne); }
#testimonials .tst__trust-item b {
  font-family: var(--font-display);
  font-weight: var(--font-weight-medium);
  font-size: 1.1rem;
  line-height: 1;
  color: var(--color-royal-light);
  font-variant-numeric: tabular-nums;
}
#testimonials .tst__trust-sep { display: none; }

/* ---------- arrows ---------- */
#testimonials .tst__arrow {
  position: relative;
  flex: none;
  width: 3rem; height: 3rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-primary);
  background: var(--color-platinum);
  color: var(--color-gold);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform .45s var(--ease-premium), box-shadow .45s var(--ease-premium), border-color .45s ease, color .3s ease;
}
/* sapphire fill rises from below on hover */
#testimonials .tst__arrow::before {
  content: '';
  position: absolute; inset: 0;
  background: var(--gradient-gold);
  transform: translateY(101%);
  transition: transform .45s var(--ease-premium);
}
#testimonials .tst__arrow svg { position: relative; width: 16px; height: 16px; transition: transform .35s var(--ease-premium); }
#testimonials .tst__arrow:hover {
  color: var(--color-white);
  border-color: var(--color-gold);
  box-shadow: var(--shadow-gold);
  transform: translateY(-2px);
}
#testimonials .tst__arrow:hover::before { transform: translateY(0); }
#testimonials #tst-prev:hover svg, #testimonials #tst-prev-m:hover svg { transform: translateX(-2px); }
#testimonials #tst-next-desktop:hover svg, #testimonials #tst-next-m:hover svg { transform: translateX(2px); }
#testimonials .tst__arrow:active { transform: translateY(0) scale(.96); }
#testimonials .tst__arrow:focus-visible { outline: 2px solid var(--color-ocean); outline-offset: 3px; }

/* ---------- stage / sliding track ---------- */
#testimonials .tst__stage {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}
#testimonials .tst__viewport {
  flex: 1 1 auto;
  min-width: 0;
  /* clip sideways only, so hover lift and shadows can breathe */
  clip-path: inset(-2.5rem 0 -3.5rem 0);
}
#testimonials .tst__grid {
  display: flex;
  gap: var(--tst-gap);
  will-change: transform;
  transition: transform 1.15s var(--ease-glide);
}
#testimonials .tst__grid.is-instant { transition: none; }

#testimonials .tst__loading {
  flex: 1 0 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--spacing-3);
  border-radius: var(--radius-xl);
  background: var(--color-platinum);
  border: 1px solid var(--border-primary);
  color: var(--text-muted);
  font-family: var(--font-primary); font-size: var(--text-sm); letter-spacing: var(--ls-wide);
  min-height: 16rem;
}
#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); } }

/* ---------- card ---------- */
#testimonials .tst-card {
  position: relative;
  flex: 0 0 calc((100% - (var(--per, 4) - 1) * var(--tst-gap)) / var(--per, 4));
  min-width: 0;
  min-height: 17rem;
  display: flex;
  flex-direction: column;
  padding: clamp(1.5rem, 2vw, 1.9rem) clamp(1.35rem, 1.8vw, 1.7rem) clamp(1.3rem, 1.7vw, 1.6rem);
  border-radius: var(--radius-xl);
  background: var(--gradient-card);
  border: 1px solid var(--border-primary);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  isolation: isolate;
  transition:
    transform .6s var(--ease-premium),
    box-shadow .6s var(--ease-premium),
    border-color .45s ease,
    background-color .45s ease;
}

/* satin silver top edge; on hover a sapphire line with a champagne
   glint sweeps across it */
#testimonials .tst-card__edge {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--color-silver-sheen);
  z-index: 2;
}
#testimonials .tst-card__edge::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg, var(--color-gold-dark) 0%, var(--color-ocean) 45%, var(--color-champagne) 60%, var(--color-ocean) 75%, var(--color-gold-dark) 100%);
  background-size: 220% 100%;
  background-position: 100% 0;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .7s var(--ease-premium);
}

/* pointer-following sapphire spotlight */
#testimonials .tst-card__glow {
  position: absolute; inset: 0;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 30%), rgba(var(--color-ocean-rgb), 0.10), transparent 70%);
  opacity: 0;
  transition: opacity .5s ease;
}

/* one diagonal pearl sheen that passes over the card on hover */
#testimonials .tst-card__sheen {
  position: absolute;
  top: 0; bottom: 0; left: -60%;
  width: 45%;
  pointer-events: none;
  z-index: 1;
  background: linear-gradient(105deg, transparent 0%, var(--color-white-70) 50%, transparent 100%);
  transform: skewX(-18deg) translateX(0);
  opacity: 0;
}

/* large serif quote mark, moon silver at rest */
#testimonials .tst-card__quote {
  position: absolute;
  top: .2rem; right: 1.1rem;
  font-family: var(--font-display);
  font-size: 6.5rem;
  line-height: 1;
  color: var(--color-moon);
  z-index: 0;
  pointer-events: none;
  user-select: none;
  transition: color .6s ease, transform .7s var(--ease-premium);
}

#testimonials .tst-card__body,
#testimonials .tst-card__author { position: relative; z-index: 1; }
#testimonials .tst-card__body { flex: 1 1 auto; display: flex; flex-direction: column; }

#testimonials .tst-card__stars { display: flex; gap: .22rem; margin-bottom: 1rem; }
#testimonials .tst-card__stars span { display: inline-flex; }
#testimonials .tst-card__stars svg { width: 14px; height: 14px; }
#testimonials .tst-star--full { color: var(--color-champagne); }
#testimonials .tst-star--empty { color: var(--color-moon); }

#testimonials .tst-card__text {
  font-family: var(--font-elegant);
  font-style: italic;
  font-size: 1.22rem;
  line-height: 1.5;
  color: var(--color-royal);
  margin: 0 0 1.25rem;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color .45s ease;
}

#testimonials .tst-card__author {
  display: flex; align-items: center; gap: .8rem;
  margin-top: auto;
  padding-top: 1.05rem;
}
/* satin silver hairline above the author */
#testimonials .tst-card__author::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: var(--color-silver-sheen);
  opacity: .8;
}

/* avatar: platinum disc inside a satin silver ring; ring turns
   champagne on hover */
#testimonials .tst-avatar {
  position: relative;
  flex: none;
  width: 2.75rem; height: 2.75rem;
  border-radius: var(--radius-full);
  padding: 1.5px;
  background: var(--color-silver-sheen);
  transition: box-shadow .5s ease;
}
#testimonials .tst-avatar::before {
  content: '';
  position: absolute; inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--color-champagne-light), var(--color-champagne), var(--color-champagne-light));
  opacity: 0;
  transition: opacity .5s ease;
}
#testimonials .tst-avatar span {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%;
  border-radius: inherit;
  background: linear-gradient(160deg, var(--color-platinum), var(--color-moon));
  font-family: var(--font-display);
  font-weight: var(--font-weight-medium);
  font-size: 1.02rem;
  letter-spacing: .04em;
  color: var(--color-gold);
}

#testimonials .tst-card__who { min-width: 0; }
#testimonials .tst-card__name {
  font-family: var(--font-primary);
  font-weight: var(--font-weight-medium);
  font-size: .9rem;
  letter-spacing: .02em;
  color: var(--color-royal-light);
  margin: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: color .4s ease;
}
/* country as a small Silver Lagoon tag */
#testimonials .tst-card__loc {
  display: inline-flex; align-items: center; gap: .3rem;
  margin: .3rem 0 0;
  padding: .12rem .55rem .14rem .45rem;
  border-radius: var(--radius-full);
  background: var(--color-lagoon-mist);
  font-family: var(--font-primary);
  font-size: .7rem;
  letter-spacing: .04em;
  color: var(--color-lagoon);
}
#testimonials .tst-card__loc svg { width: 10px; height: 10px; flex: none; }

/* ---------- card hover ---------- */
@keyframes tst-sheen { from { transform: skewX(-18deg) translateX(0); opacity: 1; } to { transform: skewX(-18deg) translateX(420%); opacity: 1; } }
@keyframes tst-edge-glint { from { background-position: 100% 0; } to { background-position: 0 0; } }
@keyframes tst-star-pop { 0% { transform: scale(1); } 45% { transform: scale(1.35); } 100% { transform: scale(1); } }

@media (hover: hover) {
  #testimonials .tst-card:hover {
    transform: translateY(-8px);
    background-color: var(--color-platinum);
    border-color: rgba(var(--color-ocean-rgb), 0.45);
    box-shadow: var(--shadow-premium), 0 0 0 1px rgba(var(--color-ocean-rgb), 0.10);
  }
  #testimonials .tst-card:hover .tst-card__edge::after {
    transform: scaleX(1);
    animation: tst-edge-glint 1.6s var(--ease-premium) .2s both;
  }
  #testimonials .tst-card:hover .tst-card__glow { opacity: 1; }
  #testimonials .tst-card:hover .tst-card__sheen { animation: tst-sheen 1.1s var(--ease-premium) both; }
  #testimonials .tst-card:hover .tst-card__quote {
    color: rgba(var(--color-gold-rgb), 0.12);
    transform: translateY(-4px) rotate(-6deg);
  }
  #testimonials .tst-card:hover .tst-card__text { color: var(--color-royal-light); }
  #testimonials .tst-card:hover .tst-star--full svg { animation: tst-star-pop .45s var(--ease-premium) calc(var(--s) * 60ms) both; }
  #testimonials .tst-card:hover .tst-avatar::before { opacity: 1; }
  #testimonials .tst-card:hover .tst-avatar { box-shadow: 0 0 0 4px rgba(var(--color-champagne-rgb), 0.16); }
  #testimonials .tst-card:hover .tst-card__name { color: var(--color-gold); }
}

/* ---------- entrance (first time in view) and arriving row ----------
   Cards rise in one after another when the section first appears.
   On each slide, the arriving cards' content settles in with a short
   left-to-right stagger while the track glides. */
@keyframes tst-rise {
  from { opacity: 0; transform: translateY(26px) scale(.985); filter: blur(4px); }
  to   { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}
#testimonials:not(.is-inview) .tst-card { opacity: 0; }
#testimonials.is-entering .tst-card.is-current {
  animation: tst-rise .9s var(--ease-premium) calc(var(--i, 0) * 120ms) backwards;
}
#testimonials .tst-card .tst-card__body,
#testimonials .tst-card .tst-card__author {
  opacity: .35;
  transform: translateX(14px);
  transition: opacity .7s ease, transform .9s var(--ease-premium);
}
#testimonials .tst-card.is-current .tst-card__body,
#testimonials .tst-card.is-current .tst-card__author {
  opacity: 1;
  transform: none;
  transition-delay: calc(.25s + var(--i, 0) * .09s);
}
#testimonials .tst-card.is-current .tst-card__author { transition-delay: calc(.35s + var(--i, 0) * .09s); }

/* ---------- progress / counter ---------- */
#testimonials .tst__progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: clamp(1.75rem, 3vw, 2.25rem);
}
#testimonials .tst__num {
  font-family: var(--font-primary);
  font-variant-numeric: tabular-nums;
  font-size: .8rem;
  letter-spacing: .12em;
  color: var(--text-muted);
  min-width: 1.6rem;
  text-align: center;
}
#testimonials b.tst__num { color: var(--color-gold); font-weight: var(--font-weight-semibold); }
#testimonials .tst__bar {
  position: relative;
  width: clamp(8rem, 18vw, 13rem);
  height: 2px;
  border-radius: var(--radius-full);
  background: var(--color-moon);
  overflow: hidden;
}
#testimonials .tst__bar-fill {
  position: absolute;
  top: 0; bottom: 0; left: 0;
  width: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--color-gold-dark), var(--color-ocean) 85%, var(--color-champagne));
  transform: scaleX(0);
  transform-origin: left;
}
@keyframes tst-progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }
#testimonials .tst__bar-fill.is-running { animation: tst-progress var(--tst-interval, 6500ms) linear both; }
#testimonials.is-paused .tst__bar-fill.is-running { animation-play-state: paused; }
#testimonials .tst__arrow--sm { display: none; width: 2.5rem; height: 2.5rem; }
#testimonials.tst--single .tst__progress,
#testimonials.tst--single .tst__stage > .tst__arrow { visibility: hidden; }

/* ---------- call to action ---------- */
#testimonials .tst__foot { display: flex; justify-content: center; margin-top: clamp(2rem, 4vw, 2.75rem); }
#testimonials .tst__cta {
  position: relative;
  display: inline-flex; align-items: center; gap: .65rem;
  overflow: hidden;
  font-family: var(--font-primary);
  font-weight: var(--font-weight-medium);
  font-size: .78rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--color-white);
  background: var(--gradient-gold);
  border: 1px solid var(--color-gold);
  border-radius: var(--radius-full);
  padding: .95rem 2rem;
  text-decoration: none;
  box-shadow: var(--shadow-gold);
  transition: transform .45s var(--ease-premium), box-shadow .45s var(--ease-premium);
}
#testimonials .tst__cta::before {
  content: '';
  position: absolute; inset: 0;
  background: var(--gradient-gold-hover);
  opacity: 0;
  transition: opacity .45s ease;
}
#testimonials .tst__cta::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0; left: -40%;
  width: 30%;
  background: linear-gradient(105deg, transparent, var(--color-white-35), transparent);
  transform: skewX(-18deg);
}
#testimonials .tst__cta span,
#testimonials .tst__cta svg { position: relative; z-index: 1; }
#testimonials .tst__cta svg { width: 14px; height: 14px; transition: transform .4s var(--ease-premium); }
#testimonials .tst__cta:hover { transform: translateY(-2px); box-shadow: var(--shadow-gold-lg); color: var(--color-white); }
#testimonials .tst__cta:hover::before { opacity: 1; }
#testimonials .tst__cta:hover::after { animation: tst-sheen 1s var(--ease-premium) both; }
#testimonials .tst__cta:hover svg { transform: translateX(4px); }
#testimonials .tst__cta:focus-visible { outline: 2px solid var(--color-ocean); outline-offset: 3px; }

/* ---------- responsive ---------- */
@media (max-width: 991px) {
  #testimonials { --tst-gap: 1rem; }
}

@media (max-width: 760px) {
  #testimonials .tst__stage > .tst__arrow { display: none; }
  #testimonials .tst__arrow--sm { display: flex; }
  #testimonials .tst-card { min-height: 0; }
  #testimonials .tst__trust-item { font-size: .74rem; padding: .35rem .8rem; }
}

@media (prefers-reduced-motion: reduce) {
  #testimonials .tst__grid { transition: none; }
  #testimonials:not(.is-inview) .tst-card { opacity: 1; }
  #testimonials.is-entering .tst-card.is-current { animation: none; }
  #testimonials .tst-card .tst-card__body,
  #testimonials .tst-card .tst-card__author { opacity: 1; transform: none; transition: none; }
  #testimonials .tst-card,
  #testimonials .tst-card *,
  #testimonials .tst-card *::before,
  #testimonials .tst-card *::after { animation: none !important; transition: none !important; }
  #testimonials .tst-card:hover { transform: none; }
  #testimonials .tst__arrow, #testimonials .tst__arrow::before,
  #testimonials .tst__cta, #testimonials .tst__cta::after { transition: none !important; animation: none !important; }
  #testimonials .tst__spinner { animation: none; }
}
