/* Page « Témoignages et avis » : filtres par thématique + cartes.
   Chargé uniquement là où le shortcode [cm_testimonials_page] est utilisé. */

/* Zone de contenu : fond crème très léger pour faire ressortir les cartes
   blanches, espace en haut (sous le bandeau du titre) et en bas de page.
   Pour retirer le fond, supprimer la ligne « background ». */
#temoignages-liste {
  background: #faf7ee;
  padding-top: 4rem;
  padding-bottom: 5rem;
}
.cm-avis {
  margin-top: 2.5rem;
  padding-bottom: 1rem;
}

/* --- Boutons de filtre --- */
.cm-avis-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .6rem;
  margin: 0 0 2.5rem;
}
.cm-avis-filter {
  font-family: 'Jost', sans-serif;
  font-size: .92rem;
  letter-spacing: .03em;
  padding: .55rem 1.25rem;
  border-radius: 999px;
  border: 1px solid #C9A400;
  background: transparent;
  color: #4a4a3d;
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease;
}
.cm-avis-filter:hover {
  background: rgba(228, 195, 74, .2);
}
.cm-avis-filter.is-active {
  background: #C9A400;
  border-color: #C9A400;
  color: #2a2a1f;
  font-weight: 500;
}
.cm-avis-filter:focus-visible,
.cm-avis-more:focus-visible {
  outline: 2px solid #3B4B32;
  outline-offset: 2px;
}
/* --- Sous-rubriques : un titre par thématique --- */
.cm-avis-section {
  margin: 0 0 3.5rem;
}
.cm-avis-section:last-child {
  margin-bottom: 0;
}
.cm-avis-section.is-hidden {
  display: none;
}
.cm-avis-section-title {
  margin: 0 0 1.75rem;
  font-family: 'Cormorant Garamond', serif;
  font-size: 2rem;
  font-weight: 500;
  color: #3B4B32;
}
.cm-avis-section-title::after {
  content: '';
  display: block;
  width: 56px;
  height: 2px;
  margin-top: .6rem;
  background: #C9A400;
}

.cm-avis-count {
  opacity: .7;
  font-size: .85em;
}

/* --- Grille : 3 avis par ligne, chaque ligne a des cartes de même hauteur --- */
.cm-avis-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  align-items: stretch;
}
@media (min-width: 640px) {
  .cm-avis-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 992px) {
  .cm-avis-grid { grid-template-columns: repeat(3, 1fr); }
}

/* --- Carte --- */
.cm-avis-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin: 0;
  padding: 1.75rem 1.6rem 1.5rem;
  box-sizing: border-box;
  background: #fff;
  border: 1px solid rgba(59, 75, 50, .08);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(59, 75, 50, .16), 0 2px 6px rgba(59, 75, 50, .08);
  text-align: left;
}
.cm-avis-card.is-hidden {
  display: none;
}
.cm-avis-rune {
  font-size: 1.8rem;
  line-height: 1;
  color: #C9A400;
  margin-bottom: .75rem;
}
.cm-avis-thematique {
  margin: 0 0 .75rem;
  font-size: .75rem;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #3B4B32;
}
.cm-avis-text {
  font-size: .95rem;
  line-height: 1.65;
  color: #4a4a3d;
}
.cm-avis-text p {
  margin: 0 0 .75rem;
}
.cm-avis-text p:last-child {
  margin-bottom: 0;
}
.cm-avis-name {
  margin: auto 0 0;
  padding-top: 1.1rem;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.15rem;
  color: #4a4a3d;
}
.cm-avis-name strong {
  font-weight: 600;
}

/* --- Témoignages longs : repliés à une hauteur standard (ajouté par le JS),
       bouton « Lire la suite » / « Réduire » pour tout lire --- */
.cm-avis-card.is-clamped .cm-avis-text {
  max-height: 13.2em; /* = 8 lignes de texte (8 x interligne 1,65) */
  overflow: hidden;
  position: relative;
}
.cm-avis-card.is-clamped .cm-avis-text::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2.5rem;
  background: linear-gradient(rgba(255, 255, 255, 0), #fff);
  pointer-events: none;
}
.cm-avis-card.is-clamped.is-open .cm-avis-text {
  max-height: none;
  overflow: visible;
}
.cm-avis-card.is-clamped.is-open .cm-avis-text::after {
  display: none;
}
.cm-avis-more {
  align-self: flex-start;
  margin: .6rem 0 0;
  padding: 0;
  border: 0;
  background: none;
  font-family: 'Jost', sans-serif;
  font-size: .9rem;
  color: #3B4B32;
  text-decoration: underline;
  cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
  .cm-avis-filter { transition: none; }
}
