/* ==========================================================
   rescue.css : correctifs pour le site statique pascalfiorica.fr
   Cause : ~54 fichiers CSS/JS du thème Hai / Elementor renvoient
   une 404 sur le serveur, donc Elementor et Swiper ne tournent plus.
   À charger EN DERNIER dans <head>, après toutes les autres feuilles :
   <link rel="stylesheet" href="/rescue.css">
   ========================================================== */

/* 1. CAUSE PRINCIPALE : contenu invisible ------------------------------
   Elementor masque les blocs animés (.elementor-invisible) jusqu'à ce que
   son JS les révèle. Sans JS, ils restent cachés (page noire sous le header). */
.elementor-invisible,
.elementor-widget.elementor-invisible,
.elementor-element.elementor-invisible {
  visibility: visible !important;
  opacity: 1 !important;
  transform: none !important;
  animation: none !important;
}

/* 2. Base robuste ------------------------------------------------------ */
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { overflow-x: hidden; }
img, video, svg { max-width: 100%; height: auto; }
.elementor-widget-image img { display: block; }
.elementor-section, .e-con { max-width: 100%; }

/* 3. Menu : sous-menu "Nos Services" au survol (JS du thème absent) ---- */
.wdt-header-menu .menu-item-has-children { position: relative; }
.wdt-header-menu .sub-menu {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity .2s ease, transform .2s ease, visibility .2s;
  z-index: 999;
}
.wdt-header-menu .menu-item-has-children:hover > .sub-menu,
.wdt-header-menu .menu-item-has-children:focus-within > .sub-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: none;
}

/* 4. Carrousels Swiper non initialisés -> grilles lisibles ------------- */
.swiper:not(.swiper-initialized) { overflow: visible; height: auto; }
.swiper:not(.swiper-initialized) .swiper-wrapper {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  transform: none !important;
  height: auto !important;
  width: 100% !important;
}
.swiper:not(.swiper-initialized) .swiper-slide {
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
  opacity: 1 !important;
  visibility: visible !important;
}
/* témoignages : une seule colonne centrée */
.wdt-testimonial-container:not(.swiper-initialized) .swiper-wrapper {
  grid-template-columns: minmax(0, 760px);
  justify-content: center;
}
/* flèches / pagination inutiles sans JS */
.swiper-button-prev, .swiper-button-next, .swiper-pagination,
.wdt-swiper-arrow-pagination, .wdt-swiper-pagination { display: none !important; }

/* 5. FAQ (accordéon) : repliée seulement si le JS de secours tourne ----- */
.rescue-js .wdt-accordion-toggle-description { display: none; }
.rescue-js .wdt-accordion-toggle-wrapper.is-open .wdt-accordion-toggle-description { display: block; }
.rescue-js .wdt-accordion-toggle-title-holder { cursor: pointer; }

/* 6. Services (onglets/liste) : empilés proprement ---------------------- */
.wdt-tabs-container .wdt-tabs-content-wrapper > * { display: block; }

/* 7. Images "démo" cassées (hébergées chez wdtwpthemes.wpengine.com) ---- */
img[src*="wdtwpthemes.wpengine.com"] { display: none !important; }

/* 8. Footer : liens et listes ------------------------------------------ */
footer ul { list-style: none; padding-left: 0; }

/* 9. Header : logo cliquable, plus de burger parasite ------------------- */
.rescue-burger { display: none !important; }          /* ancien bouton ajouté par erreur */
header a.rescue-logo, footer a.rescue-logo { display: inline-block; line-height: 0; }
header a.rescue-logo img { display: block; }

/* 10. Menu mobile / tablette : panneau plein écran créé par rescue.js ----
   Le burger affiché est celui du thème (.menu-trigger) ; son panneau d'origine
   est désactivé (vide, car le JS du thème ne tourne plus). */
.mobile-nav-container .mobile-menu,
.mobile-nav-container .overlay { display: none !important; }
.mobile-nav-container .menu-trigger {
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  background: transparent !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important;
  min-width: 44px; min-height: 44px; padding: 0 !important;
  display: inline-flex !important; align-items: center; justify-content: center;
}

.rescue-menu {
  display: none;
  position: fixed; top: 0; right: 0; bottom: 0; left: 0;
  z-index: 2147483000;
  background: #0a0a0a; color: #fff;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 88px 24px 40px;
  font-family: inherit;
}
.rescue-menu.is-open { display: block; }
body.rescue-menu-open { overflow: hidden; }
.rescue-menu ul { list-style: none; margin: 0; padding: 0; }
.rescue-menu li { display: block; margin: 0; padding: 0; border-bottom: 1px solid rgba(255,255,255,.14); background: transparent; }
.rescue-menu li li { border-bottom: 0; }
.rescue-menu a {
  display: block; padding: 16px 4px; background: transparent !important;
  color: #fff !important; font-size: 1.15rem; line-height: 1.3; text-decoration: none; text-transform: none;
}
.rescue-menu .is-current > a, .rescue-menu a.is-current { color: #fee500 !important; }
.rescue-menu ul ul { padding: 0 0 8px 16px; }
.rescue-menu ul ul a { font-size: 1rem; padding: 10px 4px; opacity: .85; }
.rescue-menu .rescue-menu-close {
  position: absolute; top: 20px; right: 20px;
  width: 48px !important; height: 48px !important; min-width: 0; min-height: 0; padding: 0 !important;
  border: 1px solid rgba(255,255,255,.45) !important; border-radius: 50% !important;
  background: transparent !important; box-shadow: none !important;
  color: #fff !important; font-size: 28px !important; line-height: 1 !important; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.rescue-menu .rescue-menu-cta {
  margin-top: 28px; padding: 16px 20px; text-align: center;
  background: linear-gradient(90deg, #fee500, #e8a87c) !important; color: #0a0a0a !important;
  font-weight: 700; border-radius: 40px;
}

/* 11. Tablette et mobile ------------------------------------------------ */
@media (max-width: 1024px) {
  .elementor-section > .elementor-container { flex-wrap: wrap; }
  .elementor-heading-title { word-break: break-word; }
  /* colonnes du contenu empilées (le header est traité à part) */
  .content-full-width .elementor-column,
  footer .elementor-column { width: 100% !important; }

  /* header compact : logo à gauche, burger à droite, même ligne */
  header .elementor-container { flex-wrap: nowrap !important; align-items: center; }
  header .elementor-column { width: auto !important; flex: 0 1 auto; }
  header .elementor-column:first-child { flex: 1 1 auto; }
  header .elementor-widget-image img { max-width: 150px; width: 150px; height: auto; }
  header .elementor-widget-heading .elementor-heading-title { font-size: 13px; line-height: 1.25; }
  .header-top-absolute { margin-bottom: 0 !important; background: #0a0a0a; }

  /* accueil : le hero ne passe plus sous le header */
  body.home .content-full-width > .elementor > .elementor-top-section:first-child,
  body.home .content-full-width .elementor-top-section:first-of-type {
    margin-top: 0 !important; padding-top: 32px !important;
  }
  body.home .elementor-element-0da1ba5 .elementor-widget-wrap.elementor-element-populated { margin-top: 0 !important; }
  header .elementor-widget { text-align: left !important; }
  header .elementor-widget-image img { margin-left: 0; }
}

@media (max-width: 767px) {
  html { -webkit-tap-highlight-color: transparent; }
  body { font-size: 16px; line-height: 1.55; }
  .elementor-section { padding-left: 0; padding-right: 0; }
  .elementor-container { padding-left: 16px; padding-right: 16px; }
  .content-full-width .wdt-heading-title { font-size: clamp(1.7rem, 8vw, 2.4rem) !important; line-height: 1.15 !important; }
  header .elementor-widget-heading .elementor-heading-title { font-size: 13px !important; line-height: 1.25 !important; }
  .swiper:not(.swiper-initialized) .swiper-wrapper { grid-template-columns: 1fr; }
  /* zones tactiles confortables */
  .elementor-button, .wdt-button, a.button, input[type=submit], button[type=submit] { min-height: 46px; }
  footer a { display: inline-block; padding: 6px 0; }
  /* formulaire : champs lisibles, pas de zoom automatique iOS */
  .cf-form input[type=text], .cf-form input[type=tel], .cf-form input[type=email], .cf-form textarea { font-size: 16px; width: 100%; box-sizing: border-box; }
  /* bouton "remonter" plus discret */
  a[href="#"].wdt-scroll-to-top, .wdt-scroll-to-top { width: 48px !important; height: 48px !important; right: 12px !important; bottom: 12px !important; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition-duration: .01ms !important; }
}
