/*
Theme Name:     Hello Elementor Child
Template:       hello-elementor
Version:        1.1.1
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 (works even if header isn't fixed) --- */

/* Base: keep all header variants hidden and non-interactive */
#menu,
header.elementor-location-header,
[data-elementor-type="header"],
header {
  z-index: 0 !important;
  opacity: 0;
  pointer-events: none;
  transition: opacity 250ms ease;
}

/* OPEN: lift ANY header and make it a full-screen fixed overlay */
body.menu-open #menu,
body.menu-open header.elementor-location-header,
body.menu-open [data-elementor-type="header"],
body.menu-open header {
  position: fixed !important;
  inset: 0 !important;                 /* top/right/bottom/left */
  width: 100vw !important;
  height: 100dvh !important;
  z-index: 2147483640 !important;      /* just under the circle */
  opacity: 1 !important;
  pointer-events: auto !important;

  /* scrolling inside the overlay */
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;

  /* subtle backdrop so it reads as a menu layer */
  background: rgba(255,255,255,0.25);
  backdrop-filter: saturate(130%) blur(1px);
  -webkit-backdrop-filter: saturate(180%) blur(6px);
}

/* Keep the gallery above header until menu-open */
#side-scroll { position: relative; z-index: 1; }

/* Don’t freeze the page; reduce chaining bounce */
body.menu-open { overscroll-behavior: contain; }

/* Ensure Elementor wrappers inside overlay don't constrain width */
body.menu-open #menu .elementor,
body.menu-open #menu .elementor-section,
body.menu-open #menu .elementor-container,
body.menu-open #menu .e-con,
body.menu-open header.elementor-location-header .elementor,
body.menu-open header.elementor-location-header .elementor-section,
body.menu-open header.elementor-location-header .elementor-container,
body.menu-open header.elementor-location-header .e-con,
body.menu-open [data-elementor-type="header"] .elementor,
body.menu-open [data-elementor-type="header"] .elementor-section,
body.menu-open [data-elementor-type="header"] .elementor-container,
body.menu-open [data-elementor-type="header"] .e-con,
body.menu-open header .elementor,
body.menu-open header .elementor-section,
body.menu-open header .elementor-container,
body.menu-open header .e-con {
  max-width: none !important;
  width: 100% !important;
}

/* Admin bar offset */
body.admin-bar.menu-open #menu,
body.admin-bar.menu-open header.elementor-location-header,
body.admin-bar.menu-open [data-elementor-type="header"],
body.admin-bar.menu-open header {
  top: 32px !important;
}
@media (max-width: 782px){
  body.admin-bar.menu-open #menu,
  body.admin-bar.menu-open header.elementor-location-header,
  body.admin-bar.menu-open [data-elementor-type="header"],
  body.admin-bar.menu-open header {
    top: 46px !important;
  }
}

/* Floating O stays on top */
.floating-o { z-index: 2147483647; }