/**
 * Block: Process
 *
 * Méthode de travail sur fond bronze :
 *   - titre serif sur 2 lignes (ligne 2 italique doré)
 *   - citation italique
 *   - timeline horizontale dorée traversant 3 étapes
 *   - sphère cauri dorée (3D) qui glisse vers l'étape active au survol
 *
 * Reuse design tokens (--cauris-*) declared in style.css.
 */

/* ---------------------------------------------------------------
 * Section frame — fond bronze
 * --------------------------------------------------------------- */

.process-block {
  position: relative;
  padding: 7rem 0 6rem;
  overflow: hidden;
  background: var(--cauris-bronze, #3d2c14);
  color: #fff;
}

/* Coquillages décoratifs */
.process-block__shell {
  position: absolute;
  display: block;
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;
  opacity: .05;
  pointer-events: none;
}
.process-block__shell--tr { top: 6%;     right: 5%;  width: 110px; height: 110px; transform: rotate(18deg); }
.process-block__shell--bl { bottom: 6%;  left: 4%;   width: 90px;  height: 90px;  transform: rotate(-22deg); }

/* ---------------------------------------------------------------
 * Header — titre + citation
 * --------------------------------------------------------------- */

.process-block__header {
  align-items: center;
  margin: 0 0 5rem;
}
.process-block__head {
  max-width: 720px;
}
.process-block__quote-col {
  display: flex;
  align-items: center;
}

.process-block__heading {
  margin: 0;
  font-family: var(--cauris-font-serif);
  font-weight: 400;
  font-size: clamp(2.2rem, 4.5vw, 3.5rem);
  line-height: 1.12;
  letter-spacing: -.01em;
  color: #fff;
}
.process-block__heading-line {
  display: block;
}
.process-block__heading-line--gold {
  font-style: italic;
  line-height: 1.25;
  color: var(--cauris-gold-1, #BF953F);
}

.process-block__quote {
  position: relative;
  margin: 0;
  padding: .25rem 0;
  font-family: var(--cauris-font-spectral, Georgia, serif);
  font-style: italic;
  font-weight: 300;
  font-size: 1.05rem;
  line-height: 1.75;
  color: rgba(252, 246, 186, .68);
  max-width: 100%;
}
.process-block__quote p {
  margin: 0;
}
.process-block__quote p + p {
  margin-top: .75rem;
}

/* ---------------------------------------------------------------
 * Timeline — ligne dorée horizontale + sphère + étapes
 * --------------------------------------------------------------- */

.process-block__timeline {
  position: relative;
  --count: 3;
  --active: 0;
  /* Décalage vertical de la ligne (= hauteur du bloc numéro + clearance visuelle).
     Cette variable est utilisée par .__line ET .__sphere pour rester alignés.
     Le gap entre le bas du numéro (height 4.5rem) et la ligne est de 1.5rem. */
  --line-y: 6rem;
  margin: 0 0 3rem;
  padding: 0;
}

/* Ligne horizontale dorée */
.process-block__line {
  position: absolute;
  top: var(--line-y);
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    to right,
    transparent 0%,
    rgba(191, 149, 63, .55) 8%,
    rgba(252, 246, 186, .85) 50%,
    rgba(179, 135, 40, .55) 92%,
    transparent 100%
  );
  pointer-events: none;
  z-index: 1;
}

/* Aura — wrapper positionné sur la timeline, porte les 2 couronnes en tirets.
   Taille calibrée pour ne pas chevaucher le titre du step (voir margin-top du
   .__step-title plus bas). */
.process-block__sphere-aura {
  position: absolute;
  top: var(--line-y);
  /* Position horizontale = centre de l'étape active */
  left: calc(((var(--active) + .5) / var(--count)) * 100%);
  width: 48px;
  height: 48px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 3;
  transition: left .6s var(--cauris-ease, cubic-bezier(.22, .61, .36, 1));
}

/* Couronne intérieure (proche de la sphère) */
.process-block__sphere-aura::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 30px;
  height: 30px;
  transform: translate(-50%, -50%);
  border: 1.5px dashed rgba(252, 246, 186, .55);
  border-radius: 50%;
  pointer-events: none;
}

/* Couronne extérieure */
.process-block__sphere-aura::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 48px;
  height: 48px;
  transform: translate(-50%, -50%);
  border: 1px dashed rgba(252, 246, 186, .3);
  border-radius: 50%;
  pointer-events: none;
}

/* Sphère cauri dorée 3D, centrée dans l'aura */
.process-block__sphere {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background:
    radial-gradient(
      circle at 32% 28%,
      #fff7d4 0%,
      #fcf6ba 14%,
      #d9a94a 42%,
      #bf953f 68%,
      #8e6c28 100%
    );
  box-shadow:
    inset 1px 1px 2px rgba(255, 248, 220, .7),
    inset -1px -2px 4px rgba(0, 0, 0, .4),
    0 4px 10px rgba(0, 0, 0, .45),
    0 2px 5px rgba(191, 149, 63, .55),
    0 0 14px rgba(252, 246, 186, .18);
  pointer-events: none;
}

/* Reflet glossy sur le haut-gauche de la sphère */
.process-block__sphere::before {
  content: "";
  position: absolute;
  top: 14%;
  left: 22%;
  width: 34%;
  height: 24%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .85), rgba(255, 255, 255, 0) 70%);
  filter: blur(.5px);
}

/* Étapes — grille */
.process-block__steps {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(var(--count, 3), 1fr);
  gap: 0;
  margin: 0;
  padding: 0;
}

.process-block__step {
  position: relative;
  padding: 0 1rem;
  text-align: center;
  transition: opacity var(--cauris-dur-base, .25s) var(--cauris-ease, cubic-bezier(.22, .61, .36, 1));
}

/* Numéro — au-dessus de la ligne.
   height = boîte visuelle du chiffre. L'écart visuel avec la ligne est obtenu
   via --line-y (6rem) > height (4.5rem) ⇒ 1.5rem de clearance. */
.process-block__step-num {
  display: block;
  height: 4.5rem;
  margin: 0 0 .5rem;
  font-family: var(--cauris-font-serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(3rem, 5.5vw, 4.25rem);
  line-height: 1;
  letter-spacing: -.02em;
  color: var(--cauris-gold-1, #BF953F);
  transition: transform var(--cauris-dur-base, .25s) var(--cauris-ease, cubic-bezier(.22, .61, .36, 1));
}

/* Titre — juste sous la ligne.
   margin-top calibrée pour laisser respirer l'aura (24px sous la ligne) +
   ~12px d'air visuel avant le titre. Suit --line-y (6rem) ⇒ doit pousser
   au-delà de l'aura bottom (7.5rem) ; ici 5 + 3.75 = 8.75rem. */
.process-block__step-title {
  margin: 3.75rem 0 .85rem;
  font-family: var(--cauris-font-spectral, var(--cauris-font-serif));
  font-style: italic;
  font-weight: 400;
  font-size: 1.3rem;
  line-height: 1.25;
  color: var(--cauris-gold-2, #FCF6BA);
}
.process-block__step-dot {
  color: var(--cauris-gold-1, #BF953F);
  margin-left: .04em;
}

.process-block__step-body p {
  margin: 0;
  max-width: 18rem;
  margin-left: auto;
  margin-right: auto;
  font-family: var(--cauris-font-sans);
  font-size: .92rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, .65);
}
.process-block__step-body p + p { margin-top: .65rem; }

/* Hover state : étape active mise en avant, autres atténuées */
@media (hover: hover) {
  .process-block__timeline:hover .process-block__step {
    /* Pas moins de .8 : cumulée à l'opacité du corps, l'étape non survolée
       passait sous le seuil AA sur le bronze. */
    opacity: .8;
  }
  .process-block__timeline:hover .process-block__step:hover,
  .process-block__timeline .process-block__step.is-active {
    opacity: 1;
  }
  .process-block__step:hover .process-block__step-num {
    transform: translateY(-2px);
  }
}

/* ---------------------------------------------------------------
 * Actions (CTAs) — optionnels
 * --------------------------------------------------------------- */

.process-block__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1.5rem 2rem;
  margin-top: 3rem;
}

.process-block__btn--ghost {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .95rem 1.9rem;
  border-radius: 999px;
  font-family: var(--cauris-font-sans);
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--cauris-gold-2, #FCF6BA);
  text-decoration: none;
  background: transparent;
  background-image:
    linear-gradient(var(--cauris-bronze, #3d2c14), var(--cauris-bronze, #3d2c14)),
    var(--cauris-grad-gold, linear-gradient(to right, #BF953F, #FCF6BA, #B38728));
  background-origin: border-box;
  background-clip: padding-box, border-box;
  border: 1px solid transparent;
  transition: transform var(--cauris-dur-base, .25s) var(--cauris-ease, cubic-bezier(.22, .61, .36, 1)),
              color var(--cauris-dur-base, .25s) var(--cauris-ease, cubic-bezier(.22, .61, .36, 1)),
              box-shadow var(--cauris-dur-base, .25s) var(--cauris-ease, cubic-bezier(.22, .61, .36, 1));
}
.process-block__btn--ghost:hover,
.process-block__btn--ghost:focus-visible {
  transform: translateY(-1px);
  color: #fff;
  box-shadow: 0 8px 24px rgba(191, 149, 63, .22);
}

.process-block__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  padding: .9rem 1.9rem;
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 999px;
  font-family: var(--cauris-font-sans);
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .85);
  text-decoration: none;
  background: transparent;
  transition: color var(--cauris-dur-base, .25s) var(--cauris-ease, cubic-bezier(.22, .61, .36, 1)),
              background-color var(--cauris-dur-base, .25s) var(--cauris-ease, cubic-bezier(.22, .61, .36, 1)),
              border-color var(--cauris-dur-base, .25s) var(--cauris-ease, cubic-bezier(.22, .61, .36, 1));
}
.process-block__link:hover,
.process-block__link:focus-visible {
  color: var(--cauris-bronze, #3d2c14);
  background: var(--cauris-gold-2, #FCF6BA);
  border-color: var(--cauris-gold-2, #FCF6BA);
}
.process-block__link-arrow {
  display: none;
}

/* ---------------------------------------------------------------
 * Responsive
 * --------------------------------------------------------------- */

@media (max-width: 991.98px) {
  .process-block { padding: 5.5rem 0 5rem; }
  .process-block__header { margin-bottom: 3.5rem; }
  .process-block__quote-col { padding-bottom: 0; margin-top: 1.5rem; }
  .process-block__timeline {
    --line-y: 5rem;
  }
  .process-block__step-num {
    height: 3.75rem;
    font-size: 2.75rem;
  }
  /* Aura tablet : taille réduite pour conserver le ratio aération desktop. */
  .process-block__sphere-aura { width: 40px; height: 40px; }
  .process-block__sphere-aura::before { width: 26px; height: 26px; }
  .process-block__sphere-aura::after  { width: 40px; height: 40px; }
  .process-block__sphere { width: 16px; height: 16px; }
  /* Plus d'air sous l'aura avant le titre. */
  .process-block__step-title { margin-top: 3rem; }
}

@media (max-width: 767.98px) {
  .process-block { padding: 4.5rem 0 4rem; }
  .process-block__header { margin-bottom: 2.5rem; }
  .process-block__heading { font-size: 2rem; }
  .process-block__quote { font-size: .98rem; }

  /* Passage en vertical en dessous de 768px (range 576-767 inclus).
     Au-dessus de 600 le grid 3-col devenait trop serré sur les body texts.
     On garde --count (posé par PHP) pour que la sphère reste sur l'étape active
     en valeur fractionnaire le long de la timeline verticale. */
  .process-block__timeline {
    --line-y: 3.25rem;
  }
  .process-block__steps {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
  .process-block__line {
    top: 0;
    bottom: 0;
    left: 1.5rem;
    right: auto;
    width: 1px;
    height: auto;
    background: linear-gradient(
      to bottom,
      transparent 0%,
      rgba(191, 149, 63, .55) 8%,
      rgba(252, 246, 186, .85) 50%,
      rgba(179, 135, 40, .55) 92%,
      transparent 100%
    );
  }
  .process-block__sphere-aura {
    top: calc(((var(--active) + .5) / var(--count, 3)) * 100%);
    left: 1.5rem;
    transform: translate(-50%, -50%);
    transition: top .6s var(--cauris-ease, cubic-bezier(.22, .61, .36, 1)),
                left .6s var(--cauris-ease, cubic-bezier(.22, .61, .36, 1));
    width: 42px;
    height: 42px;
  }
  .process-block__sphere-aura::before { width: 26px; height: 26px; }
  .process-block__sphere-aura::after  { width: 42px; height: 42px; }
  .process-block__sphere { width: 14px; height: 14px; }
  .process-block__step {
    padding: 0 0 0 3rem;
    text-align: left;
  }
  .process-block__step-num {
    display: inline-block;
    height: auto;
    font-size: 2.25rem;
    margin: 0 0 .4rem;
  }
  .process-block__step-title {
    margin: .4rem 0 .65rem;
    font-size: 1.2rem;
  }
  .process-block__step-body p {
    max-width: none;
    margin: 0;
    text-align: left;
  }
  .process-block__actions {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
    margin-top: 2.5rem;
  }
  .process-block__btn--ghost { width: 100%; }
  .process-block__link { justify-content: center; }
}

/* ---------------------------------------------------------------
 * Réduction des animations
 * --------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .process-block__btn--ghost,
  .process-block__link,
  .process-block__link-arrow,
  .process-block__sphere-aura,
  .process-block__step-num,
  .process-block__step {
    transition: none;
  }
}
