/* Kilch Gallery fullscreen overrides (template-level) */

/* Fullscreen host: scrolling + blueprint background */
html body div.kilchgallery-landing.kg-fullscreen-host:fullscreen,
html body div.kilchgallery-landing.kg-fullscreen-host:-webkit-full-screen{
  overflow: auto !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  height: 100% !important;

  background-image: url("/kilchhm/images/Kilch-Gallery-System-Photos/bg.jpg") !important;
  background-repeat: no-repeat !important;
  background-position: center top !important;
  background-size: cover !important;

  /* tune: 0.14 lighter, 0.22 darker */
  background-color: rgba(0,0,0,0.18) !important;
  background-blend-mode: multiply !important;
}

/* Hide "Don't show again" in fullscreen */
html body .kg-fullscreen-host:fullscreen button[data-kg-fs-tip-dismiss],
html body .kg-fullscreen-host:-webkit-full-screen button[data-kg-fs-tip-dismiss]{
  display: none !important;
}

/* Prevent large white panels from covering the background in fullscreen */
html body .kg-fullscreen-host:fullscreen .kilchgallery-toolbar,
html body .kg-fullscreen-host:-webkit-full-screen .kilchgallery-toolbar,
html body .kg-fullscreen-host:fullscreen #kg-container,
html body .kg-fullscreen-host:-webkit-full-screen #kg-container{
  background: transparent !important;
}

/* Cards readable but not fully opaque */
html body .kg-fullscreen-host:fullscreen .kg-card,
html body .kg-fullscreen-host:-webkit-full-screen .kg-card{
  background: rgba(255,255,255,0.86) !important;
}

/* KG fullscreen: force scrolling (must be last) */
html body div.kilchgallery-landing.kg-fullscreen-host:fullscreen,
html body div.kilchgallery-landing.kg-fullscreen-host:-webkit-full-screen{
  overflow: auto !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  height: 100% !important;
  max-height: 100% !important;
}

/* Fullscreen: remove toolbar white wash */
html body div.kilchgallery-landing.kg-fullscreen-host:fullscreen .kilchgallery-toolbar,
html body div.kilchgallery-landing.kg-fullscreen-host:-webkit-full-screen .kilchgallery-toolbar{
  background: transparent !important;
  box-shadow: none !important;
}

/* Fullscreen: force scroll on the fullscreen host (must be last rule) */
html body div.kilchgallery-landing.kg-fullscreen-host:fullscreen,
html body div.kilchgallery-landing.kg-fullscreen-host:-webkit-full-screen{
  overflow: auto !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  height: 100% !important;
  max-height: 100% !important;
}

#sppb-addon-8cad1e13-8a18-415d-b261-450430d21959 .kilchgallery-landing.kg-fullscreen-host:fullscreen{
  overflow: auto !important;
}

/* KG fullscreen (SPPB-specific): force scroll + remove toolbar wash */
#sppb-addon-8cad1e13-8a18-415d-b261-450430d21959 .kilchgallery-landing.kg-fullscreen-host:fullscreen,
#sppb-addon-8cad1e13-8a18-415d-b261-450430d21959 .kilchgallery-landing.kg-fullscreen-host:-webkit-full-screen{
  overflow: auto !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  height: 100% !important;
  max-height: 100% !important;
}

#sppb-addon-8cad1e13-8a18-415d-b261-450430d21959 .kilchgallery-landing.kg-fullscreen-host:fullscreen .kilchgallery-toolbar,
#sppb-addon-8cad1e13-8a18-415d-b261-450430d21959 .kilchgallery-landing.kg-fullscreen-host:-webkit-full-screen .kilchgallery-toolbar{
  background: transparent !important;        /* removes the white overlay */
  box-shadow: none !important;
}

/* Fullscreen: force toolbar background off (ultra-specific) */
#sppb-addon-8cad1e13-8a18-415d-b261-450430d21959 .kilchgallery-landing.kg-fullscreen-host:fullscreen div.kilchgallery-toolbar.kilchgallery-toolbar,
#sppb-addon-8cad1e13-8a18-415d-b261-450430d21959 .kilchgallery-landing.kg-fullscreen-host:-webkit-full-screen div.kilchgallery-toolbar.kilchgallery-toolbar{
  background-color: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
}

/* Fullscreen: force toolbar background transparent (anchor via #kg-search) */
#sppb-addon-8cad1e13-8a18-415d-b261-450430d21959
.kilchgallery-landing.kg-fullscreen-host:fullscreen
.kilchgallery-toolbar:has(#kg-search),
#sppb-addon-8cad1e13-8a18-415d-b261-450430d21959
.kilchgallery-landing.kg-fullscreen-host:-webkit-full-screen
.kilchgallery-toolbar:has(#kg-search){
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
}


/* Fallback: very specific descendant chain without :has() */
#sppb-addon-8cad1e13-8a18-415d-b261-450430d21959
.kilchgallery-landing.kg-fullscreen-host:fullscreen
.kilchgallery-toolbar .kilchgallery-search .kg-searchwrap #kg-search,
#sppb-addon-8cad1e13-8a18-415d-b261-450430d21959
.kilchgallery-landing.kg-fullscreen-host:-webkit-full-screen
.kilchgallery-toolbar .kilchgallery-search .kg-searchwrap #kg-search{
  /* no styles here; this selector just boosts specificity for the next rule */
}

/* Apply the background change using the same long selector up to toolbar */
#sppb-addon-8cad1e13-8a18-415d-b261-450430d21959
.kilchgallery-landing.kg-fullscreen-host:fullscreen
.kilchgallery-toolbar,
#sppb-addon-8cad1e13-8a18-415d-b261-450430d21959
.kilchgallery-landing.kg-fullscreen-host:-webkit-full-screen
.kilchgallery-toolbar{
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
}

/* Disable template/SPPB overlay layer for Kilch Gallery ONLY in fullscreen */
.kilchgallery-landing.kg-fullscreen-host:fullscreen::before,
.kilchgallery-landing.kg-fullscreen-host:-webkit-full-screen::before{
  content: none !important;
  display: none !important;
  opacity: 0 !important;
  background: transparent !important;
}

.kilchgallery-landing .kg-fullscreen-host::before {
  border: 1px solid rgba(0,0,0,0);
  box-shadow: 0 18px 60px rgba(0,0,0,0);
}

/* Keep pagebuilder sections from outranking the header */
#sp-page-builder,
#sp-page-builder .sppb-section {
  position: relative;
  z-index: 0 !important;
}

/* =========================================================
   Helix: keep TOP BAR visible with sticky header
   - When Helix makes the header sticky/fixed, the topbar
     can get pushed underneath the fixed header area.
   - This ensures topbar sits above header and the page
     content is offset correctly.
   ========================================================= */

/* Keep top bar in the fixed stack above the menu header */
#sp-top-bar{
  position: relative;
  z-index: 1000000 !important;
}

/* Keep header above page content, but DO NOT force fixed positioning */
#sp-header,
#sp-header.header-sticky,
#sp-header-sticky-wrapper{
  z-index: 999999 !important;
}

#sp-top-bar{
  z-index: 1000000 !important; /* topbar above header */
}

/* When header becomes sticky/fixed, push page content down so nothing hides */
/* body.sticky-header #sp-main-body{
/*   padding-top: calc(var(--kg-sticky-offset, 0px)) !important;
/* }

body.sticky-header #sp-main-body{
  padding-top: 0px !important;
}

/* Kilch Gallery landing (Galleries page): remove white wrapper panel */
body.com-kilchgallery.view-galleries #sp-main-body,
body.com-kilchgallery.view-galleries #sp-component,
body.com-kilchgallery.view-galleries .container,
body.com-kilchgallery.view-galleries .sppb-section,
body.com-kilchgallery.view-galleries .sppb-row-container{
  background: transparent !important;
  box-shadow: none !important;
}

/* =========================================================
   Kilch Gallery / Galleries landing page
   Remove the semi-transparent white BODY overlay from SPPB page
   (the overlay was coming from body background: rgba(255,255,255,.85))
   ========================================================= */
body.itemid-370{
  background: transparent !important;
}

/* If Helix sets the overlay on a wrapper instead of body on some pages */
body.itemid-370 .body-wrapper{
  background: transparent !important;
}

body.com_sppagebuilder.view-page.itemid-370{
  background: transparent !important;
}

/* ===== Kill the white wash overlay on Galleries page (SPPB/Helix) ===== */
body.itemid-370,
body.itemid-370.site,
body.itemid-370.view-page,
body.itemid-370.layout-default,
body.itemid-370.hu{
  background: transparent !important;
}

/* Helix sometimes paints the wash on wrappers/pseudo elements */
body.itemid-370 .body-wrapper,
body.itemid-370 .body-wrapper::before,
body.itemid-370 .body-wrapper::after,
body.itemid-370 .body-innerwrapper,
body.itemid-370 .body-innerwrapper::before,
body.itemid-370 .body-innerwrapper::after{
  background: transparent !important;
  box-shadow: none !important;
  opacity: 1 !important;
  content: none !important; /* only affects ::before/::after if they exist */
}

/* Galleries grid: enforce uniform thumbnail sizing */
#kg-container img{
  width: 100% !important;
  height: 220px !important;
  object-fit: cover !important;
  display: block !important;
}

/* Kill the "Tap to return to Full Screen" bottom overlay everywhere */
#kg-fs-reenter{
  display: none !important;
}

details.kg-fs-tip,
summary.kg-fs-tip__summary{
  display: none !important;
}

/* Keep Helix header sticky on the single Gallery normal page */
body.com-kilchgallery.view-gallery #sp-header-sticky-wrapper{
  position: sticky !important;
  top: 0 !important;
  z-index: 1000000 !important;
}

body.com-kilchgallery.view-gallery #sp-header{
  z-index: 1000000 !important;
}

/* Gallery normal page: keep header/menu visible while scrolling */
body.com-kilchgallery.view-gallery #sp-header{
  position: sticky !important;
  top: 0 !important;
  z-index: 1000000 !important;
}

/* Ensure share icon span is visible */
.kg-share.kg-share-icon .kg-fa{
  display: inline-block !important;
}

/* Keep header visible while scrolling on single Gallery page */
body.com-kilchgallery.view-gallery #sp-header{
  position: sticky !important;
  top: 0 !important;
  z-index: 1000000 !important;
}

/* Ensure sticky works (parents must not clip it) */
body.com-kilchgallery.view-gallery .body-wrapper,
body.com-kilchgallery.view-gallery .body-innerwrapper{
  overflow: visible !important;
}

/* Force Helix header to stay visible while scrolling on Gallery page */
body.com-kilchgallery.view-gallery #sp-header{
  position: sticky !important;
  top: 0 !important;
  z-index: 1000000 !important;
}

/* Gallery normal page: allow sticky header (body overflow breaks sticky) */
body.com-kilchgallery.view-gallery{
  overflow: visible !important;
}

/* Force Helix header to stick */
body.com-kilchgallery.view-gallery #sp-header{
  position: sticky !important;
  top: 0 !important;
  z-index: 2000000 !important;
}

html body.com-kilchgallery.view-gallery #sp-header{
  position: sticky !important;
}

/* Force share icon glyph */
body .kg-share.kg-share-icon .kg-fa.fa-share-alt::before{
  content: "\f1e0" !important;
  font-family: "Font Awesome 6 Free","Font Awesome 5 Free","FontAwesome" !important;
  font-weight: 900 !important;
  display: inline-block !important;
}

body .kg-share.kg-share-icon{
  color: #111 !important;
}

/* Only on the normal Galleries page */
body.itemid-370 {
  --kg-sticky-offset: 40px; /* adjust to taste */
}