/* ============================================================
   SAINTE-HÉLÈNE — Animations & effets spécifiques
   Chargé uniquement sur secteurs/saint-helene.html
   Aucune dépendance externe — CSS pur
   ============================================================ */

/* ===== 1. Hero — parallax léger + figure ===== */
.hero-figure {
  margin: 0;
  overflow: hidden;
  border-radius: 16px;
  box-shadow: 0 24px 60px -28px rgba(0, 104, 91, 0.35);
  position: relative;
}
.hero-figure img {
  width: 100%;
  height: auto;
  display: block;
  transform: scale(1.04);
  transition: transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.hero-figure.in-view img {
  transform: scale(1);
}

/* ===== 2. H1 — split-text reveal (lettres animées dans un mot indivisible) ===== */
.page-hero-secteur h1 .word {
  display: inline-block;
  white-space: nowrap;     /* le mot ne se coupe jamais en plein milieu */
}
.page-hero-secteur h1 .char {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.4em) rotate(2deg);
  animation: char-in 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: calc(var(--i, 0) * 28ms);
}
@keyframes char-in {
  to {
    opacity: 1;
    transform: translateY(0) rotate(0);
  }
}

/* ===== 3. Carrousel galerie équipements ===== */
.gallery-carousel {
  position: relative;
  margin: 2.5rem 0 1rem;
  border-radius: 18px;
  background: linear-gradient(135deg, #fafafa, #f0f4f3);
  padding: 1.25rem 1.25rem 1.5rem;
  box-shadow: 0 8px 32px -16px rgba(0, 0, 0, 0.12);
}
.carousel-track {
  display: flex;
  overflow: hidden;
  scroll-behavior: smooth;
  border-radius: 12px;
  position: relative;
  aspect-ratio: 16 / 9;
  background: #1b1c1c;
}
.carousel-slide {
  flex: 0 0 100%;
  margin: 0;
  position: relative;
  opacity: 0;
  transition: opacity 0.6s ease;
}
.carousel-slide.active {
  opacity: 1;
  z-index: 2;
}
.carousel-slide:not(.active) {
  position: absolute;
  inset: 0;
}
.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
  transition: transform 6s ease-out;
}
.carousel-slide.active img {
  transform: scale(1.05);
}
.carousel-slide figcaption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.85rem 1.1rem;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.78) 60%);
  color: #fff;
  font: 700 0.95rem/1.3 'Manrope', sans-serif;
  letter-spacing: 0.2px;
  z-index: 3;
}
.carousel-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1rem;
  gap: 1rem;
}
.carousel-arrow {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: #00685b;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.25s ease, transform 0.25s ease;
  flex-shrink: 0;
}
.carousel-arrow:hover {
  background: #004d44;
  transform: scale(1.08);
}
.carousel-arrow svg {
  width: 20px;
  height: 20px;
}
.carousel-dots {
  display: flex;
  gap: 0.5rem;
  flex: 1;
  justify-content: center;
  flex-wrap: wrap;
}
.carousel-dot {
  width: 28px;
  height: 4px;
  border-radius: 4px;
  background: #c4c7c5;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background 0.3s ease, width 0.3s ease;
}
.carousel-dot.active {
  background: #00685b;
  width: 44px;
}

/* ===== 4. Lightbox (overlay au clic sur image carrousel) ===== */
.sh-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 2rem;
  cursor: zoom-out;
  animation: lb-fade 0.3s ease;
}
.sh-lightbox.open {
  display: flex;
}
.sh-lightbox img {
  max-width: 100%;
  max-height: 85vh;
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
  animation: lb-zoom 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.sh-lightbox-caption {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font: 600 0.95rem/1.4 'Manrope', sans-serif;
  text-align: center;
  max-width: 80%;
  padding: 0.5rem 1rem;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 6px;
}
.sh-lightbox-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.25s ease, transform 0.25s ease;
}
.sh-lightbox-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg);
}
.sh-lightbox-close svg {
  width: 22px;
  height: 22px;
}
@keyframes lb-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes lb-zoom {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ===== 5. Compteurs animés ===== */
.callout-chiffres .chiffre-value {
  font-variant-numeric: tabular-nums;
  transition: color 0.4s ease;
}
.callout-chiffres .chiffre-item.counting .chiffre-value {
  color: #00685b;
}

/* ===== 6. Process SVG — tracé animé au scroll ===== */
.process-svg-animated .process-line-fill {
  stroke-dasharray: 760;
  stroke-dashoffset: 760;
  transition: stroke-dashoffset 1.6s cubic-bezier(0.65, 0, 0.35, 1);
}
.process-svg-animated.in-view .process-line-fill {
  stroke-dashoffset: 0;
}
.process-svg-animated .process-step {
  opacity: 0;
  transform: translateY(8px);
  transform-origin: center;
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: calc(var(--i) * 220ms + 200ms);
}
.process-svg-animated.in-view .process-step {
  opacity: 1;
  transform: translateY(0);
}
.process-svg-animated .step-circle {
  transition: transform 0.4s ease;
  transform-box: fill-box;
  transform-origin: center;
}
.process-svg-animated:hover .step-circle {
  transform: scale(1.06);
}

/* ===== 7. Reveal scroll affiné (over-ride léger du global) ===== */
.service-detail .reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.service-detail .reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* ===== 8. Hover renforcé sur related-services-v2 ===== */
.related-services-v2 .related-card-v2 {
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.4s ease,
              border-color 0.4s ease;
  position: relative;
  overflow: hidden;
}
.related-services-v2 .related-card-v2::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%),
              rgba(0, 104, 91, 0.10), transparent 60%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}
.related-services-v2 .related-card-v2:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px -18px rgba(0, 104, 91, 0.28);
  border-color: #00685b;
}
.related-services-v2 .related-card-v2:hover::before {
  opacity: 1;
}

/* ===== Respect des préférences utilisateurs (accessibilité) ===== */
@media (prefers-reduced-motion: reduce) {
  .page-hero-secteur h1 .char,
  .hero-figure img,
  .carousel-slide,
  .carousel-slide img,
  .process-svg-animated .process-line-fill,
  .process-svg-animated .process-step,
  .service-detail .reveal,
  .related-services-v2 .related-card-v2 {
    animation: none !important;
    transition: none !important;
    transform: none !important;
    opacity: 1 !important;
    stroke-dashoffset: 0 !important;
  }
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .gallery-carousel {
    padding: 0.8rem;
    margin: 2rem -0.5rem 1rem;
    border-radius: 12px;
  }
  .carousel-slide figcaption {
    font-size: 0.85rem;
    padding: 0.7rem 0.9rem;
  }
  .carousel-arrow {
    width: 36px;
    height: 36px;
  }
  .carousel-arrow svg {
    width: 16px;
    height: 16px;
  }
  .carousel-dot {
    width: 22px;
  }
  .carousel-dot.active {
    width: 32px;
  }
}
