/* =========================================================================
   SECTION « AVIS CLIENTS » — accueil uniquement (index.html), refonte 13/10/2026
   -------------------------------------------------------------------------
   Demande Valentin : cartes trop grandes, seulement 3 visibles. Trois styles
   prototypés (Mur, Défilé, À la une) ; retenu le 13/10 : DÉFILÉ.
     - deux rangées de cartes compactes qui défilent en sens inverse, sur
       toute la largeur, pause au survol ;
     - texte coupé à 4 lignes, mention « Lire la suite » quand il l'est
       vraiment ; un clic ouvre l'avis complet dans une fenêtre (<dialog>).
   La liste <ul class="av3__list"> reste lisible aux lecteurs d'écran (masquée
   à l'écran) ; les rangées en sont des copies aria-hidden (avis3.js).
   Accueil seulement : les autres pages gardent l'ancien carrousel (reviews2.js).

   Le fond et les marges de section viennent de hero2.css (.section.tvl-reviews).
   Feuille lisible, non minifiée. Point de rupture du projet : 880 px.
   ========================================================================= */

.av3 {
  --av-ink: #1e2330;
  --av-ink-2: #3c4454;
  --av-muted: #7c8598;
  --av-blue: #274b8f;
  --av-tint: #eef2f9;
  --av-star: #ffb400;
  --av-line: #e4e8f0;
  --av-ease: cubic-bezier(.22, 1, .36, 1);
  --av-font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-family: var(--av-font);
}
.av3 *, .av3 *::before, .av3 *::after { box-sizing: border-box; }
:where(.av3) :where(ul, ol) { list-style: none; margin: 0; padding: 0; }
:where(.av3) :where(p, h2) { margin: 0; }
.av3__inner { width: 1296px; max-width: 100%; margin: 0 auto; }

/* ------------------------------------------------------------ En-tête ---- */
.av3__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.av3__eyebrow { margin-bottom: 8px !important; font-size: 13px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--av-muted); }
.av3__title { font-size: clamp(28px, 2.7vw, 38px); font-weight: 800; letter-spacing: -.6px; line-height: 1.1; color: var(--av-ink); }

/* Note Google : un bloc-lien compact, qui mène à la fiche. */
.av3__score {
  display: inline-flex; align-items: center; gap: 14px; flex: none;
  padding: 10px 18px 10px 16px; border: 1px solid var(--av-line); border-radius: 16px;
  background: #fff; color: var(--av-ink); text-decoration: none;
  box-shadow: 0 1px 2px rgba(18, 35, 63, .04), 0 10px 26px -18px rgba(18, 35, 63, .35);
  transition: border-color .25s, box-shadow .25s, transform .25s var(--av-ease);
}
a.av3__score:hover { /* E08 30/10/2026 : le score n'est plus un lien (div) ; règle gardée pour une éventuelle ancre */ border-color: rgba(39, 75, 143, .35); transform: translateY(-2px); box-shadow: 0 14px 30px -16px rgba(39, 75, 143, .45); }
a.av3__score:focus-visible { outline: 2px solid var(--av-blue); outline-offset: 3px; }
.av3__score-num { font-size: 34px; font-weight: 800; letter-spacing: -1px; line-height: 1; }
.av3__score-col { display: flex; flex-direction: column; gap: 4px; }
.av3__score-stars { color: var(--av-star); font-size: 15px; letter-spacing: 2px; line-height: 1; }
.av3__score-sub { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--av-muted); }
.av3__score-sub .av3-g { width: 14px; height: 14px; }
.av3__score-cta {
  display: inline-flex; align-items: center; gap: 5px; padding-left: 14px; border-left: 1px solid var(--av-line);
  font-size: 13.5px; font-weight: 700; color: var(--av-blue);
}
.av3__score-cta svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* ------------------------------------------------------------- Carte ---- */
.av3-card {
  position: relative; display: flex; flex-direction: column; gap: 10px;
  padding: 18px 18px 16px; border: 1px solid var(--av-line); border-radius: 18px; background: #fff;
  box-shadow: 0 1px 2px rgba(18, 35, 63, .04), 0 10px 26px -20px rgba(18, 35, 63, .3);
  transition: box-shadow .3s var(--av-ease), transform .3s var(--av-ease), border-color .3s;
}
.av3-card__head { display: flex; align-items: center; gap: 11px; }
.av3-ini {
  display: grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 50%;
  background: var(--av-bg, var(--av-blue)); color: var(--av-fg, #fff);
  font-size: 13.5px; font-weight: 800; letter-spacing: .3px;
}
.av3-who { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.av3-name { font-size: 14.5px; font-weight: 700; color: var(--av-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.av3-when { font-size: 12.5px; font-weight: 500; color: var(--av-muted); }
.av3-g { width: 18px; height: 18px; flex: none; }
.av3-stars { color: var(--av-star); font-size: 14px; letter-spacing: 2px; line-height: 1; }
.av3-text {
  font-size: 14.5px; line-height: 1.6; color: var(--av-ink-2);
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; overflow: hidden;
}
/* « Lire la suite » : simple mention (la carte entière ouvre l'avis complet). */
.av3-more { display: inline-flex; align-items: center; gap: 4px; align-self: flex-start; margin-top: -2px; color: var(--av-blue); font-size: 13.5px; font-weight: 700; }
.av3-more[hidden] { display: none; }
.av3-more svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* ------------------------------------------------------------ Défilé ---- */
/* La liste d'origine : lisible aux lecteurs d'écran, hors de l'écran. */
.av3 .av3__list {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.av3__marquee {
  display: flex; flex-direction: column; gap: 16px;
  width: 100vw; margin-left: calc(50% - 50vw);
  /* Les rangées entrent de ±40 px (apparition) : sans ce clip, la rangée de
     droite dépassait de l'écran avant d'arriver (invisible grâce au clip du
     body, mais mesurable). overflow-x: clip ne coupe pas le vertical. */
  overflow-x: clip;
}
.av3__row {
  overflow: hidden; padding: 6px 0 10px;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 8%, #000 92%, transparent 100%);
          mask-image: linear-gradient(90deg, transparent 0, #000 8%, #000 92%, transparent 100%);
}
.av3__track { display: flex; gap: 16px; width: max-content; animation: av3-defile var(--av-d, 60s) linear infinite; }
.av3__row--b .av3__track { animation-direction: reverse; }
.av3__row:hover .av3__track { animation-play-state: paused; }
@keyframes av3-defile { to { transform: translateX(-50%); } }
.av3__track .av3-card { width: 330px; flex: none; cursor: pointer; }
@media (hover: hover) {
  .av3__track .av3-card:hover { transform: translateY(-4px); border-color: rgba(39, 75, 143, .3); box-shadow: 0 20px 38px -22px rgba(18, 35, 63, .5); }
  .av3__track .av3-card:hover .av3-more span { text-decoration: underline; text-underline-offset: 3px; }
}

/* Apparition : les rangées glissent depuis leur côté. */
.av3.is-ready .av3__row { opacity: 0; transform: translateX(40px); }
.av3.is-ready .av3__row--b { transform: translateX(-40px); }
.av3.is-in .av3__row { opacity: 1; transform: none; transition: opacity .7s ease, transform 1s var(--av-ease); }
.av3.is-in .av3__row--b { transition-delay: .12s; }

/* ----------------------------------------------- Fenêtre avis complet ---- */
.av3__dialog {
  width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0;
  border: 0; border-radius: 22px; background: #fff; color: var(--av-ink);
  box-shadow: 0 40px 80px -30px rgba(10, 20, 40, .55);
}
.av3__dialog::backdrop { background: rgba(13, 26, 51, .55); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.av3__dialog[open] { animation: av3-pop .35s var(--av-ease); }
@keyframes av3-pop { from { opacity: 0; transform: translateY(14px) scale(.98); } }
.av3__dialog-body .av3-card { border: 0; box-shadow: none; padding: 28px 28px 26px; gap: 14px; }
.av3__dialog-body .av3-text { -webkit-line-clamp: unset; display: block; font-size: 16px; line-height: 1.7; }
.av3__dialog-body .av3-more { display: none !important; }
.av3__dialog-close {
  position: absolute; top: 14px; right: 14px; z-index: 1; display: grid; place-items: center; width: 40px; height: 40px;
  border: 0; border-radius: 50%; background: var(--av-tint); color: var(--av-ink); cursor: pointer;
}
.av3__dialog-close svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.av3__dialog-close:hover { background: #e2e8f4; }
.av3__dialog-close:focus-visible { outline: 2px solid var(--av-blue); outline-offset: 2px; }

/* ========================================================================
   MOBILE / TABLETTE (≤ 880 px)
   ======================================================================== */
@media (max-width: 880px) {
  .av3__head { flex-direction: column; align-items: flex-start; gap: 14px; margin-bottom: 18px; }
  .av3__title { font-size: 26px; }
  .av3__score { gap: 10px; padding: 8px 14px 8px 12px; }
  .av3__score-num { font-size: 28px; }
  .av3-text { font-size: 14px; }
  .av3__track .av3-card { width: 272px; }
  .av3__row { -webkit-mask-image: none; mask-image: none; }
}
@media (max-width: 380px) { .av3__score-cta { display: none; } }

/* ------------------------------------------------- Mouvement réduit ---- */
/* Pas de défilement automatique : les rangées se font défiler à la main. */
@media (prefers-reduced-motion: reduce) {
  .av3 *, .av3 *::before, .av3 *::after { animation: none !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
  .av3__row { overflow-x: auto; }
}
