/**
 * Blank Page Fix CSS
 * Ensures body, main content, and critical elements are always visible
 * This file should load LAST to override any conflicting styles
 */

/* =========================================== */
/* CRITICAL: Ensure body is always visible */
/* =========================================== */
html body,
body {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  overflow: auto !important;
  position: relative !important;
  z-index: 1 !important;
}

/* =========================================== */
/* CRITICAL: Ensure main content is always visible */
/* =========================================== */
html body main,
html body #main-content-section,
html body .main-content-section,
body main,
body #main-content-section,
body .main-content-section,
main,
#main-content-section,
.main-content-section {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  position: relative !important;
  z-index: 1 !important;
}

/* Override display-none class on main content */
html body .display-none#main-content-section,
html body #main-content-section.display-none,
html body .display-none.main-content-section,
html body main.display-none,
body .display-none#main-content-section,
body #main-content-section.display-none,
body .display-none.main-content-section,
body main.display-none {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* =========================================== */
/* CRITICAL: Ensure overlay starts CLOSED */
/* =========================================== */
html body .editorial-nav-overlay:not(.active),
html body #editorialNavOverlay:not(.active),
body .editorial-nav-overlay:not(.active),
body #editorialNavOverlay:not(.active),
.editorial-nav-overlay:not(.active),
#editorialNavOverlay:not(.active) {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  display: block !important; /* Keep display:block for transitions */
  z-index: 999999 !important;
}

/* Ensure overlay doesn't block when closed */
html body .editorial-nav-overlay:not(.active) *,
html body #editorialNavOverlay:not(.active) * {
  pointer-events: none !important;
}

/* =========================================== */
/* CRITICAL: Ensure hero section is visible */
/* =========================================== */
html body #hero-section,
html body .hero-section,
body #hero-section,
body .hero-section,
#hero-section,
.hero-section {
  display: flex !important; /* Hero section uses flex, not block */
  visibility: visible !important;
  opacity: 1 !important;
  position: relative !important;
  z-index: 1 !important;
}

/* =========================================== */
/* CRITICAL: Ensure navbar is visible */
/* =========================================== */
html body .editorial-navbar,
html body header.editorial-navbar,
body .editorial-navbar,
body header.editorial-navbar,
.editorial-navbar,
header.editorial-navbar {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  position: fixed !important;
  z-index: 10000 !important;
}

/* =========================================== */
/* Ensure content is above overlay when overlay is closed */
/* =========================================== */
html body:not(:has(.editorial-nav-overlay.active)) main,
html body:not(:has(.editorial-nav-overlay.active)) #main-content-section,
html body:not(:has(.editorial-nav-overlay.active)) .main-content-section,
html body:not(:has(.editorial-nav-overlay.active)) #hero-section {
  z-index: 1 !important;
  position: relative !important;
}

/* =========================================== */
/* Prevent any element from hiding entire page */
/* =========================================== */
/* REMOVED: This was too aggressive and broke hero section flex layout */
/* html body > *:not(.editorial-nav-overlay):not(.editorial-navbar):not(script):not(style) {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
} */

/* Exception: Allow hidden elements that are meant to be hidden */
html body .sr-only,
html body .visually-hidden,
html body [aria-hidden="true"]:not(.editorial-nav-overlay),
html body .skip-link {
  /* These can be hidden - they're accessibility elements */
}

/* =========================================== */
/* Force visible on critical containers */
/* =========================================== */
html body .container,
html body .container-fluid,
body .container,
body .container-fluid {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}
/* Hide hero corner links on mobile only */
@media (max-width: 767px) {
  body.jfsn-home #hero-section .hero-corner-links {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }
}
