/* T222 — Safari homepage single-scene reset.
   The mobile homepage already has one approved continuous lower scene from
   T145/T146. Later Safari-only fixes (notably T178 atmosphere overrides) could
   repaint individual sections as separate navy/image panels. This final layer
   restores one visual source after the live hero while preserving all cards,
   content, images inside cards, spacing, and interactions. Chrome/desktop are
   untouched. */

@media (max-width: 920px) {
  @supports (-webkit-touch-callout: none) {
    /* Root/lower containers must not paint a second scene. */
    body.nile-home-active,
    body.nile-home-active > .page-shell,
    body.nile-home-active #home,
    body.nile-home-active #home .home-page,
    body.nile-home-active #home .home-after-hero-content {
      background-color: transparent !important;
      background-image: none !important;
    }

    /* Keep exactly ONE lower-page image: the continuous Safari scene. */
    body.nile-home-active.nile-lower-bg-ready::before {
      content: "" !important;
      display: block !important;
      position: fixed !important;
      inset: 0 !important;
      z-index: 0 !important;
      pointer-events: none !important;
      opacity: 1 !important;
      background:
        linear-gradient(180deg,
          rgba(2,11,25,.57) 0%,
          rgba(2,11,25,.50) 34%,
          rgba(2,11,25,.53) 72%,
          rgba(2,7,18,.61) 100%),
        #020713 url("assets/home-policy-scene-mobile.jpg") center 69% / auto 128% no-repeat !important;
      -webkit-transform: translateZ(0) !important;
      transform: translateZ(0) !important;
    }

    body.nile-home-active > .page-shell {
      position: relative !important;
      z-index: 1 !important;
    }

    /* Disable every old lower-home background carrier/fallback image. */
    body.nile-home-active #home .home-after-hero-media,
    body.nile-home-active #home .t124-ios-scene-layer,
    body.nile-home-active #home .t126-policy-background {
      display: none !important;
      background: none !important;
    }

    /* Section wrappers are only layout/glass hosts — never independent scenes. */
    body.nile-home-active #home .home-after-hero-content > .booking-policies-lux,
    body.nile-home-active #home .home-after-hero-content > .atmosphere-highlight,
    body.nile-home-active #home .home-after-hero-content > .gallery-showcase,
    body.nile-home-active #home .home-after-hero-content > .identity-section,
    body.nile-home-active #home .home-after-hero-content > .stats-strip,
    body.nile-home-active #home .home-after-hero-content > .feature-strip,
    body.nile-home-active #home .home-after-hero-content > .guest-reviews-section,
    body.nile-home-active #home .home-after-hero-content > .partner-promo {
      background-color: transparent !important;
      background-image: none !important;
      background-attachment: scroll !important;
      background-repeat: no-repeat !important;
      isolation: auto !important;
    }

    /* T178 explicitly repainted atmosphere as a solid navy card. Cancel only
       the wrapper repaint; keep the real photo panel and copy card intact. */
    body.nile-home-active #home .home-after-hero-content > .atmosphere-highlight {
      background: transparent !important;
      -webkit-backdrop-filter: none !important;
      backdrop-filter: none !important;
    }

    body.nile-home-active #home .atmosphere-highlight .photo-panel {
      background-color: rgba(4,18,31,.22) !important;
      background-image: none !important;
    }

    body.nile-home-active #home .atmosphere-highlight .section-copy {
      background:
        radial-gradient(circle at 16% 4%, rgba(210,236,255,.13), transparent 34%),
        linear-gradient(145deg, rgba(93,137,176,.16) 0%, rgba(34,73,108,.105) 42%, rgba(2,13,26,.27) 100%) !important;
      -webkit-backdrop-filter: blur(9px) saturate(150%) brightness(1.055) !important;
      backdrop-filter: blur(9px) saturate(150%) brightness(1.055) !important;
    }

    /* Footer continues over the exact same scene. */
    body.nile-home-active .site-footer-open {
      background: transparent !important;
    }

    /* Keep texture only; it must not introduce a second photographic crop. */
    body.nile-home-active .site-footer-open::before {
      background-image: repeating-linear-gradient(135deg, rgba(212,175,55,.035) 0 1px, transparent 1px 76px) !important;
      background-color: transparent !important;
      background-attachment: scroll !important;
      opacity: .15 !important;
    }
  }
}

/* T223 — Safari lower-home clarity reset.
   Safari renders the legacy T145/T147 backdrop blur much more visibly than
   Chrome, making the single shared scene look like a second blurred image.
   Keep the glass tint/borders, but remove backdrop filtering from large lower
   homepage surfaces. Small content remains readable through translucent fills. */
@media (max-width: 920px) {
  @supports (-webkit-touch-callout: none) {
    body.nile-home-active #home .booking-policies-lux .booking-policy-card,
    body.nile-home-active #home .home-after-hero-content .gallery-card,
    body.nile-home-active #home .home-after-hero-content .identity-section,
    body.nile-home-active #home .home-after-hero-content .stats-strip,
    body.nile-home-active #home .home-after-hero-content .feature-strip,
    body.nile-home-active #home .home-after-hero-content .reviews-list-card,
    body.nile-home-active #home .home-after-hero-content .review-form-card,
    body.nile-home-active #home .home-after-hero-content .review-card,
    body.nile-home-active #home .home-after-hero-content .partner-promo,
    body.nile-home-active #home .home-after-hero-content .partner-promo-copy,
    body.nile-home-active #home .home-after-hero-content .atmosphere-highlight .section-copy {
      -webkit-backdrop-filter: none !important;
      backdrop-filter: none !important;
    }

    /* Keep only a transparent tint, never a blur layer, over the shared image. */
    body.nile-home-active #home .home-after-hero-content .identity-section,
    body.nile-home-active #home .home-after-hero-content .stats-strip,
    body.nile-home-active #home .home-after-hero-content .feature-strip,
    body.nile-home-active #home .home-after-hero-content .partner-promo {
      background-color: rgba(3,15,29,.13) !important;
    }

    /* Footer belongs to the same clear scene. Remove legacy Safari glass blur
       from its outer surface while preserving its individual bordered cards. */
    body.nile-home-active .site-footer-open,
    body.nile-home-active .site-footer-open::before {
      -webkit-backdrop-filter: none !important;
      backdrop-filter: none !important;
      filter: none !important;
    }
  }
}
