/* =====================================================
   MOVAWAY — PAGE AVIS
   (header/footer/components/base sont chargés en amont)
   ===================================================== */

/* ============ HERO ============ */
.avis-hero {
  padding: 30px 0 0;
}

/* 3 citations courtes au-dessus du H1 (5 étoiles + phrase) */
.avis-hero-quotes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 30px;
  align-items: start;
  text-align: center;
  margin-bottom: 20px;
}
.avis-hero-quote img {
  display: inline-block;
  height: 26px;
  width: auto;
  margin: 0 auto 10px;
}
.avis-hero-quote p {
  margin: 0;
  font-size: 1rem;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.4;
}

/* ============ STAGE HERO (image avec visages flottants + H1 superposé) ============ */
.avis-hero-stage {
  position: relative;
}
.avis-hero-image img {
  width: 100%;
  height: auto;
  display: block;
}
/* Overlay : H1 + flèche centrés par-dessus l'image.
   Padding latéral important pour que le texte wrap entre les visages
   flottants à gauche/droite de l'image décorative. */
.avis-hero-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 36px;
  padding: 0 290px;
  text-align: center;
  pointer-events: none;       /* l'image dessous reste cliquable si besoin */
}
.avis-hero-overlay h1 {
  font-size: clamp(2rem, 1.2rem + 3.2vw, 4.6rem);
  font-weight: 800;
  letter-spacing: -1.5px;
  line-height: 1.05;
  margin: 0;
  color: var(--ink);
}
/* La flèche est cliquable même si l'overlay a pointer-events:none */
.avis-hero-arrow {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform .25s ease;
}
.avis-hero-arrow:hover { transform: translateY(3px); }
.avis-hero-arrow svg {
  width: 32px;
  height: 54px;
  display: block;
}

/* ============ STORIES (widget Join Stories tiers) ============
   Encapsulé dans une carte brandée pour s'intégrer au design global.
   Le widget est chargé en lazy par scripts.js. Le skeleton occupe
   la même zone et est masqué quand le widget a injecté son contenu. */

/* Section : fond gris-bleu identique à .avis-intro pour continuité visuelle */
.avis-stories {
  background: #EFF1F4;
  padding: 70px 0 60px;
}

/* Carte centrale : blanche, arrondie, ombre douce (comme les autres cartes du site) */
.avis-stories-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 48px 36px 40px;
  max-width: 1100px;
  margin: 0 auto;
}

/* En-tête de la carte : badge "Stories" + titre brand + sous-titre */
.avis-stories-head {
  text-align: center;
  margin-bottom: 32px;
}
/* Badge "STORIES" avec point pulsant (signal contenu vivant) */
.avis-stories-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--primary-soft);
  color: var(--primary);
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 18px;
}
.avis-stories-badge-dot {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
}
/* Halo pulsant autour du point — signale "live / nouveau" */
.avis-stories-badge-dot::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  background: var(--primary);
  opacity: 0.6;
  animation: avis-pulse 1.8s ease-out infinite;
}
@keyframes avis-pulse {
  0%   { opacity: 0.55; transform: scale(1); }
  70%  { opacity: 0;    transform: scale(2.6); }
  100% { opacity: 0;    transform: scale(2.6); }
}

.avis-stories-head h2 {
  font-size: clamp(1.5rem, 1.1rem + 1.2vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.8px;
  line-height: 1.15;
  margin: 0 0 12px;
}
.avis-stories-head p {
  margin: 0 auto;
  max-width: 540px;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--ink-soft);
}

/* ---- Zone widget : réservation d'espace + relative pour le skeleton ---- */
.avis-stories-wrap {
  position: relative;
  min-height: 200px;
}
#join-widget-page-avis-slider {
  position: relative;
  z-index: 2;              /* widget par-dessus le skeleton */
  display: block;
  width: 100%;
}

/* ---- Skeleton style "Instagram stories" : anneaux dégradés brand ---- */
.avis-stories-skeleton {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  pointer-events: none;
  z-index: 1;
  transition: opacity .4s ease;
}
.avis-stories-skeleton.is-hidden { opacity: 0; }
.avis-stories-skel-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

/* Anneau externe : gradient bleu brand qui tourne (effet "story live")
   + cœur blanc inset avec shimmer gris pour suggérer le chargement */
.avis-stories-skel-circle {
  position: relative;
  width: 86px;
  height: 86px;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    var(--primary) 0deg,
    #6ba7ff 90deg,
    var(--primary-soft) 180deg,
    #6ba7ff 270deg,
    var(--primary) 360deg
  );
  animation: avis-skel-rotate 3s linear infinite;
}
.avis-stories-skel-circle::after {
  content: '';
  position: absolute;
  inset: 3px;              /* épaisseur de l'anneau = 3px */
  border-radius: 50%;
  background:
    linear-gradient(110deg, #f3f5f9 30%, #fafbfd 50%, #f3f5f9 70%);
  background-size: 200% 100%;
  animation: avis-skel-shimmer 1.6s linear infinite;
}
.avis-stories-skel-label {
  width: 54px;
  height: 9px;
  border-radius: 5px;
  background: linear-gradient(110deg, #eef2f7 30%, #f7f9fc 50%, #eef2f7 70%);
  background-size: 200% 100%;
  animation: avis-skel-shimmer 1.6s linear infinite;
}
@keyframes avis-skel-rotate {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
@keyframes avis-skel-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Accessibilité : pas d'animation si reduce-motion */
@media (prefers-reduced-motion: reduce) {
  .avis-stories-badge-dot::after,
  .avis-stories-skel-circle,
  .avis-stories-skel-circle::after,
  .avis-stories-skel-label { animation: none; }
  .avis-stories-skel-circle { background: var(--primary-soft); }
  .avis-stories-skel-circle::after { background: #f3f5f9; }
}

/* Responsive */
@media (max-width: 900px) {
  .avis-stories { padding: 50px 0 40px; }
  .avis-stories-card { padding: 36px 24px 32px; border-radius: var(--border-radius); }
  .avis-stories-skeleton { gap: 18px; }
  .avis-stories-skel-circle { width: 72px; height: 72px; }
}
@media (max-width: 600px) {
  .avis-stories-card { padding: 28px 18px 24px; }
  .avis-stories-head h2 br { display: none; } /* titre sur une seule ligne mobile */
  .avis-stories-skeleton { gap: 12px; }
  .avis-stories-skel-circle { width: 60px; height: 60px; }
  .avis-stories-skel-label { width: 40px; height: 8px; }
}

/* ============ INTRO (fond gris-bleu, H2 + paragraphe) ============ */
.avis-intro {
  background: #EFF1F4;
  padding: 100px 0 60px;
  text-align: center;
}
.avis-intro h2 {
  font-size: clamp(2rem, 1.4rem + 2vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1.15;
  margin: 0 auto 24px;
  max-width: 1100px;
}
.avis-intro p {
  max-width: 720px;
  margin: 0 auto;
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--ink);
}
.avis-intro p u {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

/* ============ WRAPPER AVIS (fond gris continu) ============ */
.avis-wrapper {
  background: #EFF1F4;
  padding: 0 0 100px;
}

/* ============ GRILLE EN COLONNES MAÇONNERIE (3 col desktop) ============ */
.avis-container {
  column-count: 3;
  column-gap: 20px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 28px;
}

/* ============ CARTE AVIS INDIVIDUELLE ============ */
.avis-item {
  background: #fff;
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 25px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: box-shadow .3s ease, transform .3s ease;
  display: flex;
  flex-direction: column;
  break-inside: avoid;           /* clé : empêche la carte d'être coupée entre deux colonnes */
  margin-bottom: 20px;
}
.avis-item:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

/* Header de carte : photo + nom (+ badge "Vérifié") */
.avis-item-header {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 15px;
}
.avis-photo {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  /* Fallback dégradé si l'image ne charge pas */
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}
.avis-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.avis-nom-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}
.avis-nom {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-txt);
}
.avis-badge {
  width: 20px !important;
  height: 20px !important;
  flex-shrink: 0;
  display: inline-block;
  /* SVG noir → bleu Movaway via filter */
  filter: var(--filter-blue);
}

/* Étoiles 5/5 */
.avis-etoiles {
  display: flex;
  gap: 4px;
  margin-bottom: 15px;
}
.avis-etoiles img {
  width: 18px;
  height: 18px;
  display: block;
}

/* Texte du témoignage — clamp à 4 lignes par défaut, expansion via JS */
.avis-texte {
  color: var(--color-txt);
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 10px;
  flex-grow: 1;
  white-space: pre-line; /* respecte les retours simples */
}
.avis-texte.collapsed {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Bouton "Lire la suite" / "Réduire" */
.avis-lire-suite {
  color: var(--color-txt);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  border: 0;
  background: transparent;
  padding: 0;
  text-decoration: underline;
  text-align: left;
  align-self: flex-start;
  margin-top: -4px;
}
.avis-lire-suite:hover { color: var(--primary); }

/* Date du témoignage (bleu Movaway) */
.avis-date {
  font-size: 14px;
  color: var(--color-1);
  font-weight: 600;
  margin-top: 14px;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 1100px) {
  .avis-container { column-count: 2; }
}

@media (max-width: 1400px) {
  /* Réduit le padding latéral de l'overlay : les visages restent
     proportionnels à l'image qui scale en largeur. */
  .avis-hero-overlay { padding: 0 15%; gap: 28px; }
}

@media (max-width: 900px) {
  .avis-hero { padding: 20px 0 0; }
  .avis-hero-quotes {
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 16px;
  }
  /* Afficher seulement la 1ère citation sur mobile (comme le source) */
  .avis-hero-quotes .avis-hero-quote:nth-child(n+2) {
    display: none;
  }
  .avis-hero-overlay {
    padding: 0 18%;
    gap: 18px;
  }
  .avis-hero-arrow svg { width: 24px; height: 40px; }
  .avis-intro { padding: 60px 0 40px; }
}

@media (max-width: 540px) {
  .avis-hero-overlay { padding: 0 16%; gap: 12px; }
  .avis-hero-arrow svg { width: 20px; height: 32px; }
}

@media (max-width: 700px) {
  .avis-container {
    column-count: 1;
    column-gap: 0;
    padding: 0 20px;
  }
  .avis-item {
    padding: 20px;
    margin-bottom: 15px;
  }
  .avis-photo {
    width: 50px;
    height: 50px;
  }
  .avis-nom { font-size: 15px; }
  .avis-wrapper { padding: 0 0 60px; }
}
