/* =====================================================================
   Avis des voyageurs (chargé dans <head> par _haut_page.php)

   - .avis           section avant le pied de page : carrousel d'avis (avis.js le fait
                     avancer d'un avis toutes les 7 s ; sans JS, on fait défiler à la main)
   - .avis-note-*    note en une ligne : accueil, page Réservation, pied de page
   ===================================================================== */

.avis {
    --avis-papier: #fcefdc;
    --avis-encre: #3d2614;
    --avis-titre: #4a260b;
    --avis-doux: #6e5340;      /* 7:1 sur blanc */
    --avis-filet: #f0dfc9;
    --avis-etoile: #b7791f;    /* 3,6:1 sur blanc : assez pour un dessin */
    --avis-lien: #7a4612;
    --avis-violet: #6f2a86;
    --avis-marge: max(16px, calc((100vw - 1180px) / 2));
    --avis-ecart: 24px;
    --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
    position: relative;
    padding: 56px 0 48px;
    background: var(--avis-papier);
    color: var(--avis-encre);
    font-family: "Poppins", system-ui, sans-serif;
}

/* Texte réservé aux lecteurs d'écran */
.avis-cache {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* ---------- En-tête : titre, notes des plateformes, boutons ---------- */
.avis-entete {
    display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 24px;
    max-width: 1180px; margin: 0 auto 26px; padding: 0 16px;
}
.avis-titre {
    display: flex; align-items: center; gap: 10px; margin: 0 0 6px;
    font-family: 'Rancho', cursive; font-weight: 400; font-size: clamp(2.3rem, 7vw, 3.3rem); line-height: 1;
    color: var(--avis-titre);
}
.avis-fleur { flex: none; width: 40px; height: 40px; }
.avis-resume { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 0; font-size: .95rem; }
.avis .avis-resume a:link, .avis .avis-resume a:visited {
    display: inline-flex; align-items: center; gap: 6px; min-height: 32px;
    color: var(--avis-lien); text-decoration: underline; text-decoration-color: rgba(122, 70, 18, .35);
    text-underline-offset: 3px; transition: text-decoration-color .2s ease;
}
.avis-resume strong { color: var(--avis-titre); }
.avis-separateur { color: var(--avis-doux); }

.avis-commandes { display: flex; flex: none; align-items: center; gap: 8px; }
.avis-commandes[hidden], .avis-commandes [hidden] { display: none; }
.avis-bouton {
    position: relative; display: grid; place-items: center; width: 44px; height: 44px; padding: 0;
    border: 1px solid rgba(122, 70, 18, .22); border-radius: 50%; background: #fffaf3; color: var(--avis-titre);
    cursor: pointer; transition: transform .16s var(--ease-out), background-color .2s ease, opacity .2s ease;
}
.avis-bouton:active { transform: scale(.97); }
.avis-bouton[aria-disabled="true"] { opacity: .4; cursor: default; }
.avis-bouton svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Petit bouton Pause du bandeau : discret (32 px), zone de clic de 44 px */
.avis-pause {
    position: relative; display: grid; place-items: center; width: 32px; height: 32px; padding: 0;
    border: 1px solid rgba(122, 70, 18, .22); border-radius: 50%; background: transparent; color: var(--avis-doux);
    cursor: pointer; transition: color .2s ease, background-color .2s ease, transform .16s var(--ease-out);
}
.avis-pause::before { content: ""; position: absolute; inset: -6px; }
.avis-pause:active { transform: scale(.94); }
.avis-pause svg { width: 12px; height: 12px; fill: currentColor; }
.avis-pause .icone-lecture { display: none; }
.avis-pause[data-en-pause] { color: var(--avis-titre); background: #fff; }
.avis-pause[data-en-pause] .icone-pause { display: none; }
.avis-pause[data-en-pause] .icone-lecture { display: block; }
@media (hover: hover) and (pointer: fine) {
    .avis-pause:hover { color: var(--avis-titre); background: #fff; }
}

/* ---------- Rail des cartes (défilement horizontal, aimanté) ---------- */
.avis-rail {
    overflow-x: auto; overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory; scroll-padding-inline: var(--avis-marge); scroll-behavior: auto;
    scrollbar-width: none;
}
.avis-rail::-webkit-scrollbar { display: none; }
.avis-rail:focus-visible { outline: 3px solid #a2631d; outline-offset: -3px; }
.avis-piste {
    display: flex; gap: var(--avis-ecart);
    width: max-content; max-width: none; /* style.css limite tout à 100 % */
    margin: 0 auto; padding: 8px var(--avis-marge) 30px; list-style: none;
}

/* Bandeau continu (avis.js ajoute data-avis-bandeau) : pleine largeur, bords fondus,
   défilement par transformation, on le tient au doigt ou à la souris */
.avis[data-avis-bandeau] .avis-rail {
    overflow: hidden; overflow: clip; scroll-snap-type: none; touch-action: pan-y;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 32px, #000 calc(100% - 32px), transparent);
    mask-image: linear-gradient(90deg, transparent, #000 32px, #000 calc(100% - 32px), transparent);
}
.avis[data-avis-bandeau] .avis-piste { margin: 0; padding-inline: 0; will-change: transform; }
.avis[data-avis-bandeau] .avis-carte { scroll-snap-align: none; }
.avis.avis-glisse .avis-rail { cursor: grabbing; -webkit-user-select: none; user-select: none; }
@media (hover: hover) and (pointer: fine) {
    .avis[data-avis-bandeau] .avis-rail { cursor: grab; }
}
@media (min-width: 769px) {
    .avis[data-avis-bandeau] .avis-rail {
        -webkit-mask-image: linear-gradient(90deg, transparent, #000 64px, #000 calc(100% - 64px), transparent);
        mask-image: linear-gradient(90deg, transparent, #000 64px, #000 calc(100% - 64px), transparent);
    }
}

/* ---------- Carte ---------- */
.avis-carte {
    flex: 0 0 min(372px, 84vw); scroll-snap-align: start; list-style: none;
    display: flex;
}
.avis-carte figure {
    display: flex; flex-direction: column; gap: 12px; width: 100%; margin: 0; padding: 24px 24px 18px;
    background: #fff; border: 1px solid var(--avis-filet); border-radius: 20px;
    box-shadow: 0 1px 0 rgba(122, 70, 18, .08), 0 18px 36px -24px rgba(74, 38, 11, .55);
}
.avis-carte-haut { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.avis-etoiles { display: inline-flex; flex: none; gap: 2px; line-height: 0; }
.avis-etoiles svg { width: 18px; height: 18px; fill: var(--avis-etoile); stroke: var(--avis-etoile); stroke-width: 1; stroke-linejoin: round; }
.avis-etoiles svg.vide { fill: none; }
.avis-etoiles-petites svg { width: 15px; height: 15px; }
.avis-etoiles .demie { position: relative; display: inline-block; }
.avis-etoiles .demie svg.pleine { position: absolute; left: 0; top: 0; clip-path: inset(0 50% 0 0); }

/* Plateforme : nom écrit en clair, pastille aux couleurs de la marque (jamais sous du texte) */
.avis-source {
    display: inline-flex; align-items: center; gap: 7px; height: 26px; padding: 0 10px 0 8px;
    border: 1px solid var(--avis-filet); border-radius: 999px; background: #faf6f0;
    font-size: .78rem; font-weight: 600; color: var(--avis-encre); white-space: nowrap;
}
.avis-source::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--avis-doux); }
.avis-source-tripadvisor::before { background: #34e0a1; box-shadow: 0 0 0 1px #000; }
.avis-source-google::before { background: conic-gradient(#ea4335 0 25%, #fbbc05 0 50%, #34a853 0 75%, #4285f4 0); }

.avis-a-verifier {
    margin: 0; padding: 6px 10px; border-radius: 8px; background: #fff4d6; border: 1px dashed #c98a12;
    font-size: .78rem; line-height: 1.35; color: #6b4300;
}
.avis-carte-titre {
    margin: 0; font-size: 1.05rem; font-weight: 600; line-height: 1.35; color: var(--avis-titre);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.avis-texte { margin: 0; padding: 0; border: 0; }
.avis-texte p {
    margin: 0; font-size: 1rem; line-height: 1.6; color: var(--avis-encre);
    /* filet de sécurité : le texte est déjà raccourci en PHP */
    display: -webkit-box; -webkit-line-clamp: 8; -webkit-box-orient: vertical; overflow: hidden;
}

.avis-traduction { margin: -4px 0 0; font-size: .8rem; font-style: italic; color: var(--avis-doux); }

/* « Voir les 6 photos ↗ » : photos jointes à l'avis, sur la plateforme */
.avis .avis-carte a.avis-photos:link, .avis .avis-carte a.avis-photos:visited {
    display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; min-height: 32px; margin-top: auto;
    padding: 0 12px 0 10px; border: 1px solid var(--avis-filet); border-radius: 999px; background: #faf6f0;
    font-size: .82rem; font-weight: 600; color: var(--avis-lien); transition: background-color .2s ease;
}
.avis-photos svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; }
.avis-photos + .avis-signature { margin-top: 0; }
@media (hover: hover) and (pointer: fine) {
    .avis .avis-carte a.avis-photos:hover { background: #fff; }
}

/* Signature : initiales (ou photo), prénom, date, lien vers l'avis d'origine */
.avis-signature {
    display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 4px 12px;
    margin-top: auto; padding-top: 14px; border-top: 1px solid var(--avis-filet);
}
.avis-avatar {
    display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
    background: #f6e9fa; color: #4f1a63; font-size: .85rem; font-weight: 600; letter-spacing: .02em;
}
img.avis-avatar { object-fit: cover; box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--avis-filet); }
.avis-qui { display: grid; min-width: 0; line-height: 1.3; }
.avis-nom { font-size: .95rem; font-weight: 600; color: var(--avis-titre); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avis-detail { overflow: hidden; font-size: .85rem; color: var(--avis-doux); }
/* Points de séparation : celui qui tombe en début de ligne est caché (marge négative) */
.avis-detail > span { display: flex; flex-wrap: wrap; margin-left: -14px; }
.avis-detail > span > * { white-space: nowrap; }
.avis-detail > span > *::before { content: "·"; display: inline-block; width: 14px; text-align: center; }
.avis .avis-carte a.avis-lien:link, .avis .avis-carte a.avis-lien:visited {
    display: inline-flex; align-items: center; gap: 4px; min-height: 44px;
    font-size: .88rem; font-weight: 600; color: var(--avis-lien); white-space: nowrap;
    text-decoration: underline; text-decoration-color: rgba(122, 70, 18, .35); text-underline-offset: 3px;
    transition: text-decoration-color .2s ease;
}
@media (hover: hover) and (pointer: fine) {
    .avis .avis-carte a.avis-lien:hover, .avis .avis-resume a:hover { text-decoration-color: currentColor; }
    .avis-bouton:not([aria-disabled="true"]):hover { background: #fff; }
}

.avis-mention { max-width: 1180px; margin: 4px auto 0; padding: 0 16px; font-size: .82rem; color: var(--avis-doux); }

/* Apparition des cartes à l'arrivée de la section (avis.js ajoute .avis-visible) */
@media (prefers-reduced-motion: no-preference) {
    .js .avis[data-avis-pret] .avis-carte:nth-child(-n+4) {
        opacity: 0; transform: translateY(12px);
        transition: opacity .45s var(--ease-out), transform .6s var(--ease-out);
        transition-delay: calc(70ms + var(--i, 0) * 45ms);
    }
    .js .avis.avis-visible .avis-carte:nth-child(-n+4) { opacity: 1; transform: none; }
}

/* Sans avis recopiés : seulement la note */
.avis-sans-cartes { padding: 26px 16px; }
.avis-sans-cartes .avis-resume { justify-content: center; font-size: 1.02rem; }

/* Téléphone : une carte et le bord de la suivante ; boutons sous les cartes, à droite */
@media (max-width: 768px) {
    .avis { --avis-ecart: 14px; display: flex; flex-direction: column; padding: 44px 0 36px; }
    .avis-entete { display: contents; }
    .avis-entete > div:first-child { margin-bottom: 18px; padding: 0 16px; }
    .avis-rail { order: 1; }
    .avis-commandes { order: 2; align-self: flex-end; margin: 0 16px 8px; }
    .avis-mention { order: 3; }
    .avis-separateur { display: none; }
    .avis-resume { column-gap: 16px; }
    .avis-carte figure { padding: 20px 18px 16px; }
    .avis-texte p { -webkit-line-clamp: 11; }
    .avis-signature { grid-template-columns: 40px 1fr; }
    .avis-signature .avis-lien { grid-column: 1 / -1; justify-self: start; }
}

/* =====================================================================
   Note en une ligne
   ===================================================================== */
.avis-note .avis-etoiles svg { fill: #f2b300; stroke: #f2b300; }
.avis-note .avis-etoiles svg.vide { fill: none; }

/* Accueil : sous le bouton Réservation, posée sur la photo */
#section_slider .avis-note-accueil {
    position: absolute; z-index: 20; left: 0; right: 0; bottom: clamp(96px, 16vh, 150px);
    display: flex; align-items: center; gap: 8px; width: max-content; max-width: calc(100% - 32px);
    min-height: 40px; margin: 0 auto; padding: 6px 16px;
    border-radius: 999px; background: rgba(43, 23, 9, .62); color: #fff;
    -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
    font-size: .92rem; white-space: nowrap; transition: background-color .2s ease;
}
#section_slider .avis-note-accueil strong { font-weight: 600; }
@media (hover: hover) and (pointer: fine) {
    #section_slider .avis-note-accueil:hover { background: rgba(43, 23, 9, .78); }
}

/* Page Réservation : texte seul, qui revient à la ligne comme une phrase */
.avis-note-formulaire { margin: 8px 0 0; font-size: .92rem; }
.avis-note-formulaire > span + span::before { content: " · "; }
.avis-note-formulaire .avis-etoiles { vertical-align: -2px; margin-right: 4px; }
.avis-note-formulaire .avis-etoiles svg { fill: #b7791f; stroke: #b7791f; }
.avis-note-formulaire .avis-etoiles svg.vide { fill: none; }

/* Pied de page : pastilles comme les réseaux sociaux */
.avis-note-pied { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 0 !important; padding: 0; list-style: none; }
.avis-note-pied li { list-style: none; }
.pied-site .avis-note-pied a {
    display: inline-flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; min-height: 40px; padding: 4px 12px;
    border: 1px solid rgba(243, 227, 207, .28); border-radius: 999px; color: #f3e3cf;
    font-size: .84rem; line-height: 1.3; transition: background-color .2s ease;
}
.avis-note-pied a > span { white-space: nowrap; }
.avis-note-pied .avis-etoiles svg { width: 13px; height: 13px; }
.avis-note-pied strong { color: #fff; font-weight: 600; }
@media (hover: hover) and (pointer: fine) {
    .pied-site .avis-note-pied a:hover { background: rgba(243, 227, 207, .1); }
}
