/* ============================================================
   anim-hrm.css — Animations Clinique Vétérinaire HRM
   Template : médical institutionnel (ancrage guadeloupéen)
   Toutes les animations sont enfermées dans prefers-reduced-motion: no-preference
   ============================================================ */

/* ---- Bloc illustrations (remplace image-prompt-block) ---- */
.illus-block {
  margin: 0;
  overflow: hidden;
  border-radius: 10px;
  border: 1px solid #E5E7EB;
  background: color-mix(in srgb, #1E3A8A 4%, #fff);
  line-height: 0; /* évite l'espace sous l'img */
}
.illus-block img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 10px;
}

/* ============================================================
   1. HERO — apparition titre + accroche au load
   ============================================================ */
@media (prefers-reduced-motion: no-preference) {
  .hero-text h1 {
    opacity: 0;
    transform: translateY(22px);
    animation: hrm-fade-up 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.1s forwards;
  }
  .hero-lead {
    opacity: 0;
    transform: translateY(18px);
    animation: hrm-fade-up 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.22s forwards;
  }
  .hero-ctas {
    opacity: 0;
    transform: translateY(14px);
    animation: hrm-fade-up 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.36s forwards;
  }
  .google-badge {
    opacity: 0;
    transform: translateY(10px);
    animation: hrm-fade-up 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.5s forwards;
  }
  .hero-image .illus-block {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
    animation: hrm-fade-up-scale 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.3s forwards;
  }

  /* ============================================================
     2. BANDEAU URGENCES TOP — slide-down au load
     ============================================================ */
  .alert-urgence {
    animation: hrm-slide-down 0.4s cubic-bezier(0.16, 1, 0.3, 1) 0s both;
    transform-origin: top center;
  }

  /* ============================================================
     3. SCROLL REVEAL — sections via IntersectionObserver
        data-reveal="0|1|2|..." pour stagger sur grilles
     ============================================================ */
  [data-reveal] {
    opacity: 0;
    transform: translateY(24px);
    transition:
      opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
      transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  }
  [data-reveal="1"] { transition-delay: 0.08s; }
  [data-reveal="2"] { transition-delay: 0.16s; }
  [data-reveal="3"] { transition-delay: 0.24s; }
  [data-reveal="4"] { transition-delay: 0.32s; }
  [data-reveal="5"] { transition-delay: 0.40s; }
  [data-reveal].is-visible {
    opacity: 1;
    transform: translateY(0);
  }

  /* ============================================================
     4. CARDS SERVICES — hover lift + micro-ombre
        (remplace le hover style.css existant, plus fluide)
     ============================================================ */
  .card {
    transition:
      box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1),
      transform  0.25s cubic-bezier(0.16, 1, 0.3, 1),
      border-color 0.25s;
    will-change: transform;
  }
  .card:hover,
  .card:focus-within {
    transform: translateY(-4px);
    box-shadow: 0 10px 28px rgba(30, 58, 138, 0.13);
    border-color: color-mix(in srgb, #1E3A8A 30%, transparent);
  }
  .card-icon {
    transition: background 0.25s, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .card:hover .card-icon,
  .card:focus-within .card-icon {
    background: color-mix(in srgb, #1E3A8A 18%, #fff);
    transform: scale(1.08) rotate(3deg);
  }

  /* ============================================================
     5. CTA URGENCES — pulse subtil au load + hover brighten
     ============================================================ */
  .btn-urgence {
    animation: hrm-urgence-pulse 2.8s cubic-bezier(0.4, 0, 0.6, 1) 1.2s 2;
  }
  .btn-urgence:hover,
  .btn-urgence:focus {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 38, 38, 0.35);
    transition:
      background 0.2s,
      transform  0.2s cubic-bezier(0.16, 1, 0.3, 1),
      box-shadow 0.2s;
  }
  /* Bouton sticky urgences */
  .urgency-sticky {
    transition: background 0.2s, box-shadow 0.2s;
    animation: hrm-sticky-in 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.8s both;
  }
  .urgency-sticky:hover,
  .urgency-sticky:focus {
    box-shadow: 0 -4px 20px rgba(220, 38, 38, 0.4);
  }

  /* ============================================================
     6. LIENS NAV & BOUTONS PRIMAIRES — hover lift
     ============================================================ */
  .site-nav a {
    transition:
      background  0.18s,
      color       0.18s,
      transform   0.18s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform;
  }
  .site-nav a:hover,
  .site-nav a:focus {
    transform: translateY(-1px);
  }
  .btn-primary,
  .btn-outline {
    transition:
      background  0.2s,
      color       0.2s,
      transform   0.2s cubic-bezier(0.16, 1, 0.3, 1),
      box-shadow  0.2s;
    will-change: transform;
  }
  .btn-primary:hover,
  .btn-primary:focus {
    transform: translateY(-2px);
    box-shadow: 0 5px 16px rgba(30, 58, 138, 0.25);
  }
  .btn-outline:hover,
  .btn-outline:focus {
    transform: translateY(-2px);
    box-shadow: 0 5px 16px rgba(30, 58, 138, 0.15);
  }

  /* ============================================================
     7. ILLUSTRATIONS — hover lift + curseur zoom
     ============================================================ */
  .illus-block {
    transition:
      transform  0.3s cubic-bezier(0.16, 1, 0.3, 1),
      box-shadow 0.3s;
    will-change: transform;
    cursor: zoom-in;
  }
  .illus-block:hover {
    transform: translateY(-3px) scale(1.012);
    box-shadow: 0 12px 32px rgba(30, 58, 138, 0.12);
  }
  .illus-block img {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .illus-block:hover img {
    transform: scale(1.02);
  }

  /* ============================================================
     8. CARTE OSM — fade-in après chargement iframe
     ============================================================ */
  .map-wrapper {
    transition: opacity 0.5s ease;
  }
  .map-wrapper.map-loaded {
    opacity: 1;
  }
  .map-wrapper:not(.map-loaded) {
    opacity: 0.2;
  }

  /* ============================================================
     9. FOCUS VISIBLE ÉLÉGANT — ring animé
     ============================================================ */
  :focus-visible {
    outline: none;
    box-shadow:
      0 0 0 2px #fff,
      0 0 0 4px #1E3A8A,
      0 0 0 6px rgba(30, 58, 138, 0.25);
    border-radius: 4px;
    transition: box-shadow 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .btn-urgence:focus-visible,
  .urgency-sticky:focus-visible {
    box-shadow:
      0 0 0 2px #fff,
      0 0 0 4px #DC2626,
      0 0 0 6px rgba(220, 38, 38, 0.25);
  }

  /* ============================================================
     10. SECTIONS — titre section (underline décoratif glissant)
     ============================================================ */
  .section-title {
    position: relative;
    display: inline-block;
  }
  .section-title::after {
    content: "";
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, #1E3A8A, #DC2626);
    border-radius: 2px;
    transition: width 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .section-title.is-visible::after {
    width: 60%;
  }

  /* ============================================================
     11. REVIEW CARDS — cascade stagger via data-reveal
     ============================================================ */
  .review-card {
    transition:
      box-shadow 0.25s,
      transform  0.25s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform;
  }
  .review-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 22px rgba(30, 58, 138, 0.1);
  }

  /* ============================================================
     12. GOOGLE BADGE — hover bounce léger
     ============================================================ */
  .google-badge {
    transition:
      box-shadow 0.2s,
      transform  0.2s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .google-badge:hover,
  .google-badge:focus {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
  }

  /* ============================================================
     13. DETAILS/SUMMARY FAQ — icône rotate
     ============================================================ */
  summary::after {
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    display: inline-block;
  }
  details[open] summary::after {
    transform: rotate(45deg);
  }

  /* ============================================================
     14. FORM SUBMIT — micro-bounce
     ============================================================ */
  .form-submit {
    transition:
      background  0.2s,
      transform   0.15s cubic-bezier(0.16, 1, 0.3, 1),
      box-shadow  0.2s;
  }
  .form-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(30, 58, 138, 0.28);
  }
  .form-submit:active {
    transform: translateY(0px);
  }
}

/* ============================================================
   KEYFRAMES
   ============================================================ */
@keyframes hrm-fade-up {
  to { opacity: 1; transform: translateY(0); }
}
@keyframes hrm-fade-up-scale {
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes hrm-slide-down {
  from { opacity: 0; transform: translateY(-100%); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes hrm-urgence-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
  50%       { box-shadow: 0 0 0 8px rgba(220, 38, 38, 0.22); }
}
@keyframes hrm-sticky-in {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* ============================================================
   RÉDUCTION DE MOUVEMENT — désactive tout (déjà dans style.css,
   mais on renforce au cas où anim-hrm.css est chargé seul)
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
  .hero-text h1, .hero-lead, .hero-ctas, .google-badge,
  .hero-image .illus-block, .alert-urgence, .urgency-sticky {
    opacity: 1 !important; transform: none !important;
    animation: none !important;
  }
}
