/* =========================================================================
   Couche de mouvement — reprise de la mécanique de La Dolfina Jumping
   Loader, curseur, révélations, parallaxe, cartes à vidéo, modales fiches.
   Chargée après site.css. Tout est neutralisé sous prefers-reduced-motion.
   ========================================================================= */

/* --- Loader ------------------------------------------------------------- */
/* Le site s'ouvre sur sa marque, pas sur une page à moitié peinte.
   body.is--loading bloque le défilement le temps du chargement. */

body.is--loading {
  overflow: hidden;
}

.loader {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  background: var(--vert-sombre);
  transition: opacity 0.8s var(--sortie), visibility 0.8s;
}

.loader::after {
  /* Le grain : la même texture sourde que sur le fond du hero. */
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.06;
  background-image: radial-gradient(currentColor 1px, transparent 1px);
  background-size: 4px 4px;
  color: var(--or);
  pointer-events: none;
}

body:not(.is--loading) .loader {
  opacity: 0;
  visibility: hidden;
}

.loader__marque {
  position: relative;
  display: grid;
  place-items: center;
  gap: 1.75rem;
  color: var(--or);
}

.loader__roue {
  width: clamp(5rem, 12vw, 8rem);
  animation: tourne 6s linear infinite;
}

.loader__nom {
  font-family: var(--serif);
  font-size: clamp(1.25rem, 3vw, 1.875rem);
  color: var(--blanc);
  letter-spacing: 0.01em;
  text-align: center;
}

.loader__nom span {
  display: block;
  font-family: var(--sans);
  font-size: 0.6875rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--or);
  margin-top: 0.5rem;
}

.loader__progres {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 0;
  background: var(--or);
}

.loader__compte {
  position: absolute;
  right: var(--marge);
  bottom: 1.5rem;
  font-size: var(--t-petit);
  letter-spacing: 0.12em;
  color: var(--or);
  font-variant-numeric: tabular-nums;
}

/* --- Curseur ------------------------------------------------------------ */
/* Deux pastilles qui suivent la souris, la seconde en retard. Sur les
   cartes, l'anneau grossit et porte le libellé de l'action. */

.curseur,
.curseur__anneau {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 250;
  pointer-events: none;
  border-radius: 50%;
  will-change: transform;
}

.curseur {
  width: 6px;
  height: 6px;
  background: var(--or);
  margin: -3px 0 0 -3px;
}

.curseur__anneau {
  width: 34px;
  height: 34px;
  margin: -17px 0 0 -17px;
  border: 1px solid var(--or);
  display: grid;
  place-items: center;
  transition: width 0.35s var(--sortie), height 0.35s var(--sortie),
              margin 0.35s var(--sortie), background-color 0.35s;
}

.curseur__texte {
  font-size: 0.625rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--vert-sombre);
  opacity: 0;
  transition: opacity 0.25s;
  white-space: nowrap;
}

.curseur__anneau[data-actif="oui"] {
  width: 86px;
  height: 86px;
  margin: -43px 0 0 -43px;
  background: var(--or);
}

.curseur__anneau[data-actif="oui"] .curseur__texte {
  opacity: 1;
}

/* Le curseur natif reste pour qui n'a pas de souris fine. */
@media (hover: hover) and (pointer: fine) {
  body[data-curseur="oui"] {
    cursor: none;
  }

  body[data-curseur="oui"] a,
  body[data-curseur="oui"] button {
    cursor: none;
  }
}

@media not all and (hover: hover) {
  .curseur,
  .curseur__anneau {
    display: none;
  }
}

/* --- Révélation des images ---------------------------------------------- */
/* L'image est découverte par un volet qui remonte, pendant que la photo
   elle-même se dézoome. C'est le geste des <picture class="reveal"> du site
   d'origine. */

.reveal {
  display: block;
  overflow: hidden;
  position: relative;
  clip-path: inset(0 0 100% 0);
}

.reveal img {
  transform: scale(1.25);
  transform-origin: center;
}

/* --- Parallaxe ----------------------------------------------------------- */

[data-vitesse] {
  will-change: transform;
}

.parallaxe {
  will-change: transform;
}

/* --- Apparition de groupe ------------------------------------------------ */

[data-groupe] > * {
  opacity: 0;
}

/* --- Cartes de prestation ------------------------------------------------ */
/* Au survol : la photo recule, la vidéo — ou la seconde photo — se
   superpose, et le curseur affiche « Voir la fiche ». */

.carte__media {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

.carte__media img,
.carte__media video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.carte__media .carte__survol {
  opacity: 0;
  transform: scale(1.08);
  transition: opacity 0.7s var(--sortie), transform 1.2s var(--sortie);
}

.carte:hover .carte__media .carte__survol,
.carte:focus-within .carte__media .carte__survol {
  opacity: 1;
  transform: scale(1);
}

.carte__numero {
  position: absolute;
  top: 0.9rem;
  left: 1rem;
  z-index: 2;
  font-family: var(--serif);
  font-size: 0.875rem;
  color: var(--blanc);
  letter-spacing: 0.08em;
  text-shadow: 0 1px 6px rgba(4, 44, 5, 0.6);
}

/* --- Modale fiche -------------------------------------------------------- */
/* Le geste central du site d'origine : la carte n'emmène pas ailleurs, elle
   ouvre une fiche par-dessus la page. Ici la fiche porte aussi un lien vers
   la vraie page, qui reste celle que Google indexe. */

.modale {
  position: fixed;
  inset: 0;
  z-index: 260;
  background: var(--blanc);
  overflow-y: auto;
  overscroll-behavior: contain;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s var(--sortie), visibility 0.5s;
}

.modale[data-ouverte="oui"] {
  opacity: 1;
  visibility: visible;
}

.modale__fermer {
  position: sticky;
  top: 0;
  z-index: 3;
  margin-left: auto;
  display: grid;
  place-items: center;
  width: 3.5rem;
  height: 3.5rem;
  background: var(--vert);
  color: var(--blanc);
  border: 0;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.fiche {
  display: none;
  padding-bottom: var(--bloc);
}

.fiche[data-active="oui"] {
  display: block;
}

.fiche__chemin {
  font-size: var(--t-petit);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--or-texte);
  font-weight: 600;
  margin-bottom: 1rem;
}

.fiche__tete {
  display: grid;
  gap: clamp(1.5rem, 4vw, 3rem);
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  align-items: center;
  padding-block: clamp(1rem, 3vw, 2rem) clamp(2rem, 5vw, 3.5rem);
}

.fiche__tete h2 {
  font-size: var(--t-titre);
  color: var(--vert);
}

.fiche__tete p {
  margin-top: 1rem;
  color: var(--gris);
  max-width: 40ch;
}

.fiche__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.75rem;
}

/* Le carrousel de la fiche */
.fiche__slider {
  position: relative;
  overflow: hidden;
  background: var(--creme);
}

.fiche__piste {
  display: flex;
  transition: transform 0.7s var(--sortie);
}

.fiche__vue {
  flex: 0 0 100%;
  min-width: 0;
}

.fiche__vue img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.fiche__fleche {
  position: absolute;
  top: 50%;
  translate: 0 -50%;
  width: 2.75rem;
  height: 2.75rem;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.9);
  border: 0;
  cursor: pointer;
  color: var(--vert);
}

.fiche__fleche[data-sens="prec"] {
  left: 0.75rem;
}

.fiche__fleche[data-sens="suiv"] {
  right: 0.75rem;
}

.fiche__points {
  position: absolute;
  bottom: 0.9rem;
  left: 50%;
  translate: -50% 0;
  display: flex;
  gap: 0.4rem;
}

.fiche__points button {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 0;
  padding: 0;
  background: rgba(255, 255, 255, 0.55);
  cursor: pointer;
}

.fiche__points button[aria-current="true"] {
  background: var(--or);
}

/* La fiche technique, colonne de gauche du site d'origine */
.fiche__corps {
  display: grid;
  gap: clamp(2rem, 5vw, 4rem);
  grid-template-columns: minmax(0, 20rem) minmax(0, 1fr);
  padding-top: clamp(2rem, 5vw, 3.5rem);
  border-top: 1px solid var(--trait);
}

.fiche__donnees {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
  font-size: 0.9375rem;
}

.fiche__donnees li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--trait);
}

.fiche__donnees b {
  font-weight: 500;
  color: var(--gris);
}

.fiche__donnees span {
  font-variant-numeric: tabular-nums;
  color: var(--vert);
  font-weight: 600;
  white-space: nowrap;
}

.fiche__citation {
  font-family: var(--serif);
  font-size: 1.375rem;
  line-height: 1.3;
  color: var(--vert);
  margin-top: 1.75rem;
}

/* L'arborescence : chez eux le pedigree du cheval, ici le déroulé de la
   prestation, du premier geste au dernier. */
.arbre {
  list-style: none;
  margin: 2.5rem 0 0;
  padding: 0;
  display: grid;
  gap: 0;
}

.arbre li {
  position: relative;
  padding: 0 0 1.75rem 2.25rem;
  border-left: 1px solid var(--trait);
}

.arbre li:last-child {
  border-left-color: transparent;
  padding-bottom: 0;
}

.arbre li::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 0.45rem;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--or);
}

.arbre b {
  display: block;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.1875rem;
  color: var(--vert);
  margin-bottom: 0.2rem;
}

.arbre span {
  color: var(--gris);
  font-size: 0.9375rem;
}

@media (max-width: 62rem) {
  .fiche__tete,
  .fiche__corps {
    grid-template-columns: 1fr;
  }
}

/* --- Vidéo de fond ------------------------------------------------------- */

.fond-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* --- Sobriété ------------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
  .loader {
    display: none;
  }

  body.is--loading {
    overflow: auto;
  }

  .curseur,
  .curseur__anneau {
    display: none;
  }

  .reveal {
    clip-path: none;
  }

  .reveal img {
    transform: none;
  }

  [data-groupe] > * {
    opacity: 1;
  }
}
