/* Emergency fix CSS - loaded after child style to neutralize overlay and restore layout
   Created: 2025-10-19
   Purpose: make site visible while we perform a careful rollback/cleanup
*/

/* Reset overlay pseudo-element if present */
html.mobile-menu-open::before {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
  opacity: 0 !important;
}

/* Ensure body is scrollable until we finalize behavior */
html.mobile-menu-open, body {
  overflow: auto !important;
}

/* Ensure header and content are visible and not covered */
.site-header, header, #page, #content, .container {
  visibility: visible !important;
  opacity: 1 !important;
}

/* Neutralize aggressive mobile-menu transforms that can hide content */
#mobile-menu, .mobile-menu, .mobile-menu.is-open, #mobile-menu.is-open {
  transform: none !important;
  right: auto !important;
  left: auto !important;
  position: relative !important;
  width: auto !important;
  height: auto !important;
  max-width: none !important;
  box-shadow: none !important;
  pointer-events: auto !important;
}

/* Ensure the mobile off-canvas remains hidden on desktop viewport widths.
   This prevents the mobile menu from displaying permanently on large screens
   while keeping the emergency mobile fixes active for smaller viewports. */
@media (min-width: 992px) {
  #mobile-menu, .mobile-menu {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    position: static !important;
  }
}

/* Mobile (restore off-canvas behavior): hide by default, show when .is-open
   This undoes the global neutralization above but only for small viewports so
   mobile users can open the menu with the hamburger button as intended. */
@media (max-width: 991px) {
  /* keep menu off-screen by default */
  #mobile-menu, .mobile-menu {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    height: 100vh !important;
    width: 84% !important;
    max-width: 420px !important;
    transform: translateX(100%) !important;
    transition: transform 360ms cubic-bezier(0.2,0.9,0.2,1) !important;
    z-index: 1500 !important;
    overflow-y: auto !important;
    pointer-events: none !important;
    opacity: 0 !important;
    box-shadow: -12px 0 36px rgba(0,0,0,0.18) !important;
    background: #fff !important;
  }

  /* visible state when JS adds .is-open */
  #mobile-menu.is-open, .mobile-menu.is-open {
    transform: translateX(0) !important;
    pointer-events: auto !important;
    opacity: 1 !important;
  }

  /* ensure the injected close button is visible and accessible */
  #close-menu, .mobile-close {
    position: absolute !important;
    top: 12px !important;
    right: 12px !important;
    z-index: 1600 !important;
    display: block !important;
  }
}

/* If there is an injected close button, keep it visible but not intrusive */
#close-menu, .mobile-close {
  position: relative !important;
  top: auto !important;
  right: auto !important;
  z-index: 1000 !important;
}

/* Last resort: make sure major sections display correctly */
.testimonials-section, .pourquoi-ouralearn-section, .nos-programmes-section, .final-cta-section {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* Minor: restore pointer events to links if they were disabled */
a { pointer-events: auto !important; }

/* End of emergency fix */
