/*
Theme Name:     Hello Elementor Child
Template:       hello-elementor
Version:        1.1.0
Description:    Horizontal gallery + resilient overlay menu (z-index toggle).
Author:         Your Name
*/

/* ──────────────────────────────────────────────
   Horizontal Scroll Container (base)
   ────────────────────────────────────────────── */
#side-scroll{
  display: flex;
  flex-direction: row;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scroll-behavior: auto !important;
  scroll-snap-type: x proximity;
  width: 100vw;
  height: 100svh;
  height: 100dvh;
  position: relative;
  z-index: 1;                  /* gallery above header until menu-open */
  contain: layout paint;
}
@media (hover:none) and (pointer:coarse){ #side-scroll{ touch-action: none; } }
@media (hover:hover) and (pointer:fine){  #side-scroll{ touch-action: pan-x; } }
#side-scroll .snap{ scroll-snap-align: center; }
#side-scroll{ scrollbar-width: none; }
#side-scroll::-webkit-scrollbar{ display: none; }

/* Generic helper if another wrapper is used as the scroller */
.side-scroll{ display:flex; flex-direction:row; overflow-x:auto; overflow-y:hidden; }

/* ──────────────────────────────────────────────
   Images + fixed backgrounds
   ────────────────────────────────────────────── */
.scroll-container{ flex:0 0 auto; width:auto; padding:0; margin:0; }
.scroll-container img,
.scroll-image img{
  display:block;
  height:auto; width:auto;
  max-height: 100svh;
  max-height: 100dvh;
  will-change: transform;
}

.fixed-bg{
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  width:100vw; height:100svh; height:100dvh;
  position:relative; z-index:0;
}
@media (hover:hover) and (pointer:fine){ .fixed-bg{ background-attachment: fixed; } }
@media (hover:none) and (pointer:coarse){ .fixed-bg{ background-attachment: scroll; } }

/* Elementor animation overrides for gallery cards */
.gallery-scroll-image,
.gallery-scroll-image.in-view{ opacity:1 !important; animation:none !important; transition:none !important; }

/* ──────────────────────────────────────────────
   Floating “O” button
   ────────────────────────────────────────────── */
.floating-o{
  position: fixed; bottom:36px; right:36px;
  width: clamp(36px, var(--o-size,36px), 80px);
  height: clamp(36px, var(--o-size,36px), 80px);
  border-radius: 50%;
  background:#fff; box-shadow:0 8px 20px rgba(0,0,0,.25);
  z-index:2147483647; cursor:pointer;
  opacity:0; transform:translateY(-40px);
  animation: dropFade .6s ease-out forwards;
  transition: background .3s, border .3s, transform .25s ease, opacity .25s ease;
}
.floating-o.revealed{ background:#717171cc; border:2px solid #fff; }
@keyframes dropFade{ 0%{opacity:0;transform:translateY(-40px);}60%{opacity:1;transform:translateY(8px);}100%{opacity:1;transform:translateY(0);} }
@media (prefers-reduced-motion: reduce){ .floating-o{ animation:none; transform:none; } }

/* ──────────────────────────────────────────────
   Overlay menu via z-index toggle (supports #menu OR Elementor header)
   ────────────────────────────────────────────── */

/* Base state: keep header under the gallery and non-interactive */
#menu,
header.elementor-location-header{
  z-index: 0 !important;
  opacity: 0;
  pointer-events: none;
  transition: opacity 250ms ease;
  /* If your header isn’t fixed by Elementor, uncomment:
     position: fixed; inset: 0; width:100vw; height:100dvh;
  */
}

/* Open: raise above gallery, allow vertical scroll inside */
body.menu-open #menu,
body.menu-open header.elementor-location-header{
  z-index: 2147483640 !important;   /* just below the circle */
  opacity: 1;
  pointer-events: auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Optional: reduce scroll chaining while menu is open (but don’t freeze page) */
body.menu-open{ overscroll-behavior: contain; }

/* Ensure Elementor wrappers in the overlay don’t constrain width */
#menu .elementor,
#menu .elementor-section,
#menu .elementor-container,
#menu .e-con,
header.elementor-location-header .elementor,
header.elementor-location-header .elementor-section,
header.elementor-location-header .elementor-container,
header.elementor-location-header .e-con{
  max-width:none !important; width:100% !important;
}