/* ============================================================
   SINGAPORE MATH ACADEMY — Testimonials Component
   testimonials.css
   
   Self-contained styles for the dynamic reviews section.
   Add new reviews anytime by editing assets/reviews.json only.
   ============================================================ */


/* ─── SECTION WRAPPER ─── */
.testimonials {
  background: var(--blue);
  padding: 6rem 5vw;
  position: relative;
  overflow: hidden;
}
.testimonials::before {
  content: '"';
  position: absolute; top: -2rem; left: 4vw;
  font-family: 'Nunito', sans-serif;
  font-size: 22rem; font-weight: 900;
  color: rgba(255,255,255,.04);
  line-height: 1; pointer-events: none;
}
.testimonials-inner { max-width: 1200px; margin: 0 auto; }
.testimonials .section-title { color: #fff; }
.testimonials .section-label { color: rgba(255,255,255,.65); }
.testimonials .section-label-dot { background: var(--orange); }


/* ─── SUMMARY BAR ─── */
.testi-summary {
  display: flex;
  align-items: center;
  gap: 2rem;
  margin: 1.5rem 0 2.5rem;
  flex-wrap: wrap;
}
.testi-overall-score {
  font-family: 'Nunito', sans-serif;
  font-size: 3.5rem;
  font-weight: 900;
  color: #fff;
  line-height: 1;
}
.testi-overall-right { display: flex; flex-direction: column; gap: .3rem; }
.testi-overall-stars { color: var(--orange); font-size: 1.1rem; letter-spacing: 3px; }
.testi-overall-label {
  font-size: .78rem;
  font-weight: 700;
  color: rgba(255,255,255,.55);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.testi-google-badge {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: rgba(255,255,255,.1);
  border: 1.5px solid rgba(255,255,255,.15);
  border-radius: 50px;
  padding: .4rem 1rem;
  font-size: .78rem;
  font-weight: 700;
  color: rgba(255,255,255,.8);
  text-decoration: none;
  transition: background .2s, border-color .2s;
  margin-left: auto;
}
.testi-google-badge:hover {
  background: rgba(255,255,255,.15);
  border-color: rgba(255,255,255,.3);
}
.testi-google-icon {
  width: 16px; height: 16px;
  background: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 900;
  color: #1B5EA6; flex-shrink: 0;
}


/* ─── FILTER TABS ─── */
.testi-filters {
  display: flex;
  gap: .5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}
.testi-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: rgba(255,255,255,.08);
  border: 1.5px solid rgba(255,255,255,.15);
  border-radius: 50px;
  padding: .38rem .95rem;
  font-size: .78rem;
  font-weight: 700;
  color: rgba(255,255,255,.65);
  cursor: pointer;
  transition: background .2s, border-color .2s, color .2s;
  letter-spacing: .02em;
}
.testi-filter-btn:hover {
  background: rgba(255,255,255,.12);
  color: rgba(255,255,255,.9);
}
.testi-filter-btn.active {
  background: var(--orange);
  border-color: var(--orange);
  color: #fff;
}
.testi-filter-count {
  background: rgba(255,255,255,.2);
  border-radius: 50px;
  padding: .05rem .45rem;
  font-size: .68rem;
}
.testi-filter-btn.active .testi-filter-count {
  background: rgba(255,255,255,.3);
}


/* ─── CARDS GRID ─── */
.testi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.testi-card {
  background: rgba(255,255,255,.07);
  border: 1.5px solid rgba(255,255,255,.12);
  border-radius: 20px;
  padding: 1.8rem;
  transition: background .25s, border-color .25s, transform .25s;
  display: flex;
  flex-direction: column;
}
.testi-card:hover {
  background: rgba(255,255,255,.1);
  border-color: rgba(91,191,191,.45);
  transform: translateY(-3px);
}


/* ─── CARD INTERNALS ─── */
.testi-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: .8rem;
}
.stars { color: var(--orange); font-size: .9rem; letter-spacing: 2px; }
.testi-date {
  font-size: .68rem;
  color: rgba(255,255,255,.35);
  font-weight: 600;
  letter-spacing: .03em;
}
.testi-text {
  font-size: .87rem;
  line-height: 1.8;
  color: rgba(255,255,255,.8);
  font-style: italic;
  flex: 1;
  margin-bottom: 1.5rem;
  /* clamp long reviews to 5 lines, expandable */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;   /* Safari / older Chrome */
  line-clamp: 5;           /* standard property */
  overflow: hidden;
  cursor: pointer;
}
.testi-text.expanded {
  -webkit-line-clamp: unset;
  line-clamp: unset;
  overflow: visible;
}
.testi-read-more {
  display: none;
  font-size: .72rem;
  font-weight: 700;
  color: var(--teal);
  cursor: pointer;
  margin-bottom: 1rem;
  transition: color .2s;
}
.testi-read-more:hover { color: var(--teal-dark); }
.testi-read-more.visible { display: block; }

.testi-author {
  display: flex;
  align-items: center;
  gap: .8rem;
  border-top: 1px solid rgba(255,255,255,.1);
  padding-top: 1.1rem;
  margin-top: auto;
}
.testi-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Nunito', sans-serif;
  font-size: 1rem; font-weight: 900; color: #fff;
  flex-shrink: 0;
}
.testi-name { font-size: .84rem; font-weight: 700; color: #fff; }
.testi-detail { font-size: .72rem; color: rgba(255,255,255,.45); margin-top: .15rem; }
.testi-google-link {
  margin-left: auto;
  font-size: .65rem;
  color: rgba(255,255,255,.3);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  transition: color .2s;
  flex-shrink: 0;
}
.testi-google-link:hover { color: rgba(255,255,255,.6); }


/* ─── PAGINATION ─── */
.testi-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  margin-top: 2.5rem;
  flex-wrap: wrap;
}
.testi-page-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  border: 1.5px solid rgba(255,255,255,.15);
  color: rgba(255,255,255,.65);
  font-size: .82rem;
  font-weight: 700;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s, border-color .2s, color .2s;
}
.testi-page-btn:hover {
  background: rgba(255,255,255,.15);
  color: #fff;
}
.testi-page-btn.active {
  background: var(--orange);
  border-color: var(--orange);
  color: #fff;
}
.testi-page-btn:disabled {
  opacity: .3;
  cursor: default;
  pointer-events: none;
}
.testi-page-info {
  font-size: .75rem;
  color: rgba(255,255,255,.4);
  margin: 0 .5rem;
}


/* ─── EMPTY STATE ─── */
.testi-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem;
  color: rgba(255,255,255,.4);
  font-size: .9rem;
}


/* ─── LOADING STATE ─── */
.testi-loading {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  padding: 3rem;
}
.testi-spinner {
  width: 32px; height: 32px;
  border: 3px solid rgba(255,255,255,.15);
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }


/* ─── RESPONSIVE ─── */
@media (max-width: 1024px) {
  .testi-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .testi-grid { grid-template-columns: 1fr; }
  .testi-summary { gap: 1rem; }
  .testi-google-badge { margin-left: 0; }
  .testi-overall-score { font-size: 2.8rem; }
}
