/* ============================================================
   TEMOIGNAGES.CSS — Athenia Academy
   Section témoignages étudiants : mur d'avatars + citations
   Inspire du ContributorsWall pattern (framer-motion → CSS/JS vanille)
   ============================================================ */

/* ── Section ────────────────────────────────────────────── */
#home-temoignages {
  --tmg-bg: #F5F5F7;
  background: var(--tmg-bg);
  overflow: visible;
}

/* ── Stats bar ──────────────────────────────────────────── */
.tmg-stats-wrap {
  margin-bottom: 56px;
}

.tmg-stats {
  display: flex;
  justify-content: center;
  gap: clamp(2rem, 6vw, 5rem);
  padding: 1.6rem 2rem;
  border: 1px solid rgba(29, 29, 31, 0.08);
  border-radius: 24px;
  background: #FFFFFF;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.04);
}

.tmg-stats-note {
  margin: 0.6rem auto 0;
  max-width: 44rem;
  color: #86868B;
  font-size: 0.72rem;
  line-height: 1.5;
  text-align: center;
}

.tmg-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  text-align: center;
}

.tmg-stat-num {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: clamp(2rem, 3.5vw, 3rem);
  font-weight: 800;
  color: #1D1D1F;
  letter-spacing: -0.045em;
  line-height: 1;
}

.tmg-stat-den {
  font-size: 0.48em;
  color: #6E6E73;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.tmg-stat-label {
  font-size: 0.75rem;
  color: #86868B;
  font-weight: 500;
  letter-spacing: 0.01em;
}

/* ── Bandeau de preuve condensé (sous le hero) ─────────────── */
.home-hero-proof-strip {
  padding: 28px 0 8px;
}

.tmg-stats--compact {
  gap: clamp(1.5rem, 5vw, 3rem);
  padding: 1.1rem 1.5rem;
}

.tmg-stats--compact .tmg-stat-num {
  font-size: clamp(1.3rem, 2vw, 1.7rem);
}

/* ── Mur d'avatars ──────────────────────────────────────── */
.tmg-wall-outer {
  position: relative;
  height: 280px;
  overflow: hidden;
  margin: 0;
}

.tmg-wall-perspective {
  width: 100%;
  height: 100%;
  perspective: 1100px;
  perspective-origin: 50% 50%;
}

.tmg-wall-plane {
  width: 100%;
  height: 100%;
  transform: rotateX(18deg);
  transform-style: preserve-3d;
}

.tmg-wall-track {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 24px;
  will-change: transform;
}

.tmg-wall-grid {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 10px;
}

/* ── Tuile avatar ───────────────────────────────────────── */
.tmg-avatar {
  position: relative;
  aspect-ratio: 1;
  display: block;
  outline: none;
  cursor: pointer;
}

.tmg-avatar-inner {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 4px;
  box-shadow: 0 0 0 1px rgba(29, 29, 31, 0.08) inset;
  transition: transform 0.3s cubic-bezier(.2,.8,.2,1), box-shadow 0.3s ease;
}

.tmg-avatar:hover .tmg-avatar-inner,
.tmg-avatar:focus-visible .tmg-avatar-inner {
  transform: scale(1.26);
  z-index: 10;
  box-shadow: 0 0 0 1.5px rgba(0, 168, 107, 0.4) inset,
              0 8px 20px rgba(0, 0, 0, 0.14);
}

.tmg-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
  filter: grayscale(1) brightness(0.88);
  transition: filter 0.3s ease;
  -webkit-user-drag: none;
  user-select: none;
  pointer-events: none;
}

.tmg-avatar:hover img,
.tmg-avatar:focus-visible img {
  filter: grayscale(0) brightness(1.02);
}

/* ── Gradient de fondu (overlay) ────────────────────────── */
.tmg-wall-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(130% 95% at 50% 50%, transparent 28%, var(--tmg-bg) 80%),
    linear-gradient(to bottom, var(--tmg-bg) 0%, transparent 18%, transparent 82%, var(--tmg-bg) 100%),
    linear-gradient(to right,  var(--tmg-bg) 0%, transparent 8%,  transparent 92%, var(--tmg-bg) 100%);
}

/* ── Tooltip flottant ───────────────────────────────────── */
.tmg-tooltip {
  position: fixed;
  z-index: 9999;
  background: #FFFFFF;
  border: 1px solid rgba(29, 29, 31, 0.10);
  border-radius: 8px;
  padding: 0.26rem 0.58rem;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  color: #1D1D1F;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.10);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  transform: translate(-50%, calc(-100% - 10px));
  white-space: nowrap;
  line-height: 1.4;
}

.tmg-tooltip.is-visible {
  opacity: 1;
}

.tmg-tooltip::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 100%;
  width: 8px;
  height: 8px;
  background: #FFFFFF;
  border-right: 1px solid rgba(29, 29, 31, 0.10);
  border-bottom: 1px solid rgba(29, 29, 31, 0.10);
  transform: translateX(-50%) translateY(-50%) rotate(45deg);
}

/* ── Cartes de citations ────────────────────────────────── */
.tmg-quotes-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-top: 56px;
}

.tmg-quote-card {
  background: #FFFFFF;
  border: 1px solid rgba(29, 29, 31, 0.08);
  border-radius: 28px;
  padding: 2rem;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.tmg-quote-card:hover {
  transform: translateY(-3px);
  border-color: rgba(0, 168, 107, 0.20);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.07);
}

/* Badge score */
.tmg-score-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.22rem 0.6rem;
  background: rgba(0, 168, 107, 0.08);
  color: #00A86B;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 1.1rem;
  width: fit-content;
}

.tmg-score-badge::before {
  content: '★';
  font-size: 0.8em;
}

/* Texte de la citation */
.tmg-quote-text {
  flex: 1;
  font-size: 0.97rem;
  line-height: 1.65;
  color: #1D1D1F;
  font-style: italic;
  margin-bottom: 1.5rem;
}

.tmg-quote-text::before {
  content: '\00AB\00A0';
  color: #00A86B;
  font-style: normal;
  font-size: 1.1em;
}

.tmg-quote-text::after {
  content: '\00A0\00BB';
  color: #00A86B;
  font-style: normal;
  font-size: 1.1em;
}

/* Auteur */
.tmg-quote-author {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(29, 29, 31, 0.07);
  margin-top: auto;
}

.tmg-author-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  flex-shrink: 0;
  border: 2px solid rgba(0, 168, 107, 0.18);
}

.tmg-author-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.tmg-author-name {
  font-size: 0.875rem;
  font-weight: 700;
  color: #1D1D1F;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tmg-author-label {
  font-size: 0.72rem;
  color: #86868B;
  font-weight: 500;
}

/* Lien LinkedIn */
.tmg-author-linkedin {
  margin-left: auto;
  color: #0A66C2;
  flex-shrink: 0;
  opacity: 0.65;
  transition: opacity 0.2s ease;
  display: flex;
  align-items: center;
}

.tmg-author-linkedin:hover {
  opacity: 1;
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 1024px) {
  .tmg-quotes-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .tmg-wall-grid {
    grid-template-columns: repeat(8, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .tmg-quotes-grid {
    grid-template-columns: 1fr;
  }
  .tmg-stats {
    gap: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
  }
  .tmg-wall-outer {
    height: 220px;
  }
  .tmg-wall-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
  .tmg-wall-track {
    padding: 0 12px;
  }
}

/* ── Modal témoignage complet ───────────────────────────── */
.tmg-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(10, 10, 20, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.tmg-modal-backdrop.is-open {
  opacity: 1;
  pointer-events: all;
}

.tmg-modal {
  background: #fff;
  border-radius: 28px;
  padding: clamp(1.5rem, 5vw, 2.5rem);
  max-width: min(640px, calc(100vw - 2rem));
  max-height: calc(100svh - 2rem);
  width: 100%;
  overflow-y: auto;
  transform: scale(0.88) translateY(16px);
  transition: transform 0.3s cubic-bezier(.2,.8,.2,1);
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.22);
}

.tmg-modal-backdrop.is-open .tmg-modal {
  transform: scale(1) translateY(0);
}

.tmg-modal-header {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  margin-bottom: 1.25rem;
}

.tmg-modal-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  flex-shrink: 0;
  border: 2px solid rgba(0, 168, 107, 0.18);
}

.tmg-modal-name-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.tmg-modal-name {
  font-size: 1rem;
  font-weight: 700;
  color: #1D1D1F;
  letter-spacing: -0.015em;
}

.tmg-modal-title {
  font-size: 0.72rem;
  color: #6E6E73;
  font-weight: 500;
  line-height: 1.3;
}

.tmg-modal-anon {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #86868B;
  background: rgba(134, 134, 139, 0.08);
  border: 1px solid rgba(134, 134, 139, 0.14);
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  margin-bottom: 0.5rem;
  width: fit-content;
}

.tmg-modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: rgba(29, 29, 31, 0.07);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1D1D1F;
  font-size: 0.8rem;
  flex-shrink: 0;
  transition: background 0.18s ease;
  font-family: inherit;
}

.tmg-modal-close:hover {
  background: rgba(29, 29, 31, 0.14);
}

.tmg-modal-score {
  margin-bottom: 1.25rem;
}

.tmg-modal-fields {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.tmg-modal-field-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #86868B;
  margin-bottom: 0.2rem;
}

.tmg-modal-field-text {
  font-size: 0.915rem;
  line-height: 1.65;
  color: #1D1D1F;
  font-style: italic;
}

.tmg-modal-footer {
  padding-top: 1.25rem;
  margin-top: 1.5rem;
  border-top: 1px solid rgba(29, 29, 31, 0.07);
  display: flex;
  justify-content: flex-end;
}

.tmg-modal-linkedin {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #0A66C2;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.tmg-modal-linkedin:hover {
  opacity: 0.75;
}

/* ── Accessibilité : réduction de mouvement ─────────────── */
@media (prefers-reduced-motion: reduce) {
  .tmg-avatar .tmg-avatar-inner {
    transition: none;
  }
  .tmg-avatar img {
    transition: none;
    filter: none;
  }
  .tmg-quote-card {
    transition: none;
  }
  .tmg-modal,
  .tmg-modal-backdrop {
    transition: none;
  }
}
