/* =====================================================================
   VISUAL MEMORIES — LIVRE D'OR
   - page livre-dor.html (formulaire, confirmation, attente) ;
   - accueil, section Avis : lien discret, « Comment les avis sont
     publiés » et date de dépôt des avis (chargé par vm-livre-dor.js
     seulement quand le livre d'or est ouvert).
   Reprend les styles du formulaire de contact (style.css : .form, .field…).
   ===================================================================== */

/* ---------- Page ---------- */
.gb-page { padding-top: clamp(28px, 4vw, 64px); background: var(--ivoire); }
.gb-wrap { max-width: 780px; margin-inline: auto; }

.gb-form, .gb-success, .gb-closed {
  position: relative;
  padding: clamp(26px, 4.4vw, 60px);
  background: rgba(251, 248, 242, .9);
  border: 1px solid var(--filet);
  box-shadow: 0 40px 90px -60px rgba(122, 96, 60, .5);
}
.gb-form::before, .gb-success::before {
  content: "";
  position: absolute; inset: 6px;
  border: 1px solid rgba(169, 134, 79, .14);
  pointer-events: none;
}
.gb-in { animation: gb-in 1s var(--ease) both; }
@keyframes gb-in { from { opacity: 0; transform: translate3d(0, 14px, 0); } to { opacity: 1; transform: none; } }

.field label .gb-opt, .gb-opt { font-weight: 300; letter-spacing: .04em; text-transform: none; }
.gb-help { margin-top: .45rem; font-size: .85rem; line-height: 1.5; color: var(--encre-douce); }
.gb-count { align-self: flex-end; margin-top: .4rem; font-size: .8rem; letter-spacing: .04em; color: var(--encre-douce); font-variant-numeric: tabular-nums; }
.gb-count.is-near { color: var(--bronze); }

/* Attente (pendant la vérification du serveur) */
.gb-wait {
  display: flex; align-items: center; justify-content: center; gap: .8rem;
  min-height: 200px;
  font-family: var(--ff-serif); font-style: italic; font-size: 1.3rem; color: var(--encre-douce);
}
.gb-wait__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--or); animation: gb-pulse 1.2s ease-in-out infinite; }
@keyframes gb-pulse { 50% { opacity: .25; transform: scale(.7); } }

/* ---------- Note : 5 étoiles (boutons radio) ---------- */
.gb-rating { margin: 0; padding: 0; border: 0; min-width: 0; }
.gb-rating legend {
  float: left; width: 100%;
  margin-bottom: .5rem; padding: 0;
  font-weight: 500; font-size: .72rem; letter-spacing: .2em; text-transform: uppercase;
  color: var(--encre-douce);
}
.gb-rating legend abbr { text-decoration: none; color: var(--or-texte-petit); border: 0; }
.gb-rating:focus-within legend { color: var(--bronze); }
.gb-rating.is-invalid legend { color: var(--erreur); }
.gb-stars { clear: both; display: flex; flex-wrap: wrap; align-items: center; gap: 0 2px; margin-left: -8px; }
.gb-stars__input { position: absolute; width: 1px; height: 1px; margin: 0; padding: 0; opacity: 0; pointer-events: none; }
.gb-stars__star {
  display: grid; place-items: center;
  width: 48px; height: 48px;
  margin: 0; border-radius: 50%;
  color: rgba(169, 134, 79, .26);
  cursor: pointer;
  transition: color .35s var(--ease-out), transform .45s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.gb-stars__star svg { width: 30px; height: 30px; }
.gb-stars__input:focus-visible + .gb-stars__star { outline: 1.5px solid var(--or-focus); outline-offset: -4px; }
.gb-stars__input:checked + .gb-stars__star { transform: scale(1.08); }
.gb-stars__text {
  margin-left: .8rem;
  font-family: var(--ff-serif); font-style: italic; font-size: 1.2rem; line-height: 48px;
  color: var(--encre-douce);
}
.gb-stars.has-note .gb-stars__text { color: var(--or-texte); }

/* étoiles allumées jusqu'à la note choisie, ou jusqu'à celle survolée */
.gb-stars[data-note="1"] .gb-stars__star:nth-of-type(-n+1),
.gb-stars[data-note="2"] .gb-stars__star:nth-of-type(-n+2),
.gb-stars[data-note="3"] .gb-stars__star:nth-of-type(-n+3),
.gb-stars[data-note="4"] .gb-stars__star:nth-of-type(-n+4),
.gb-stars[data-note="5"] .gb-stars__star:nth-of-type(-n+5) { color: var(--or); }
.gb-stars[data-hover] .gb-stars__star { color: rgba(169, 134, 79, .26); }
.gb-stars[data-hover="1"] .gb-stars__star:nth-of-type(-n+1),
.gb-stars[data-hover="2"] .gb-stars__star:nth-of-type(-n+2),
.gb-stars[data-hover="3"] .gb-stars__star:nth-of-type(-n+3),
.gb-stars[data-hover="4"] .gb-stars__star:nth-of-type(-n+4),
.gb-stars[data-hover="5"] .gb-stars__star:nth-of-type(-n+5) { color: #C4A26A; }
.gb-rating .field__error { clear: both; }

/* ---------- Confirmation ---------- */
.gb-success { min-height: 440px; }
.gb-success__sign { margin-bottom: 1.6rem; font-family: var(--ff-serif); font-style: italic; font-size: 1.25rem; color: var(--or-texte); }

/* ---------- Livre d'or pas encore ouvert ---------- */
.gb-closed {
  text-align: center;
  border-radius: 999px 999px 0 0;
  padding-top: clamp(40px, 6vw, 72px);
  box-shadow: none;
  background: rgba(251, 248, 242, .62);
}
.gb-closed__mark { display: block; height: .46em; font-family: var(--ff-serif); font-weight: 300; font-size: 7rem; line-height: 1; color: var(--or); opacity: .4; }
.gb-closed__title { margin-top: 2rem; font-family: var(--ff-serif); font-weight: 300; font-size: clamp(1.8rem, 3.4vw, 2.6rem); line-height: 1.2; text-wrap: balance; }
.gb-closed__title em { color: var(--or-texte); }
.gb-closed__text { max-width: 420px; margin: 1rem auto 2rem; color: var(--encre-douce); text-wrap: balance; }

/* ---------- Règles de publication (page) ---------- */
.gb-rules { margin-top: clamp(32px, 4vw, 48px); padding-top: 1.6rem; border-top: 1px solid var(--filet); font-size: .92rem; line-height: 1.7; color: var(--encre-douce); }
.gb-rules__title { margin-bottom: .6rem; font-family: var(--ff-sans); font-weight: 500; font-size: var(--fs-label); letter-spacing: .2em; text-transform: uppercase; color: var(--bronze); }
.gb-rules a, .gb-home__rules a { color: var(--bronze); text-decoration: underline; text-decoration-color: var(--or); text-underline-offset: 3px; }

/* ---------- Accueil : section Avis ---------- */
.gb-home { margin-top: clamp(30px, 4vw, 52px); text-align: center; animation: gb-in 1.1s var(--ease) both; }
.gb-home__cta { margin: 0; font-family: var(--ff-serif); font-style: italic; font-size: clamp(1.15rem, 1.6vw, 1.3rem); color: var(--encre-douce); text-wrap: balance; }
.gb-home__cta .link-line { margin-left: .5em; font-style: normal; letter-spacing: .18em; white-space: nowrap; }
.gb-home__rules { max-width: 640px; margin: 1.2rem auto 0; }
.gb-home__rules summary {
  display: inline-flex; align-items: center; gap: .6rem;
  min-height: 44px;
  cursor: pointer; list-style: none;
  font-weight: 500; font-size: var(--fs-label); letter-spacing: .2em; text-transform: uppercase;
  color: var(--bronze);
}
.gb-home__rules summary::-webkit-details-marker { display: none; }
.gb-home__rules summary::after { content: "+"; font-weight: 300; font-size: 1.1rem; letter-spacing: 0; transition: transform .4s var(--ease); }
.gb-home__rules[open] summary::after { transform: rotate(45deg); }
.gb-home__rules p { margin-top: .4rem; font-size: .92rem; line-height: 1.7; color: var(--encre-douce); text-wrap: pretty; }

/* Date de dépôt d'un avis du livre d'or (carrousel, main.js) */
.testimonial__posted { display: block; margin-top: -.2rem; font-size: .82rem; letter-spacing: .02em; color: var(--encre-douce); }

@media (max-width: 600px) {
  .gb-form, .gb-success { margin-inline: calc(var(--gutter) * -.5); padding: 26px 20px 30px; }
  .gb-form .form__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem 1.2rem; }   /* mois et année côte à côte */
  .gb-stars__text { flex-basis: 100%; margin: .1rem 0 0 8px; line-height: 1.4; }
  .gb-home__cta .link-line { display: flex; width: fit-content; margin: .1rem auto 0; letter-spacing: .14em; }
  .gb-home__rules p { text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
  .gb-in, .gb-home, .gb-wait__dot { animation: none; }
  .gb-stars__star { transition: none; }
}
