/* core/cover only: a wrapped <img> can't be a GLightbox trigger there (the block's own dim overlay + inner-container always paint on top of it — see WPSHP_Blocks::render_cover_glightbox_markup()). Instead we add a full-size overlay trigger and let clicks fall through the inner-container to reach it, except where the inner-container has its own interactive content (e.g. a button placed inside the cover). */
.wpshp-glightbox-cover-overlay {
  position: absolute;
  inset: 0;
  display: block;
}

/* Inserting the overlay above breaks the .wp-block-cover__background + .wp-block-cover__inner-container direct-sibling adjacency core's own CSS relies on — which makes core apply its *own* defensive z-index rule (dim overlay/inner-container to 1, image/video background to 0), putting those layers back above our overlay regardless of DOM order. Rather than fight that with more z-index, every non-interactive layer gets pointer-events: none so hit-testing skips straight past all of them to our overlay (or to real interactive content inside the cover). */
.wpshp-glightbox-cover > .wp-block-cover__image-background,
.wpshp-glightbox-cover > video.wp-block-cover__video-background,
.wpshp-glightbox-cover > .wp-block-cover__background,
.wpshp-glightbox-cover > .wp-block-cover__gradient-background,
.wpshp-glightbox-cover > .wp-block-cover__inner-container {
  pointer-events: none;
}

.wpshp-glightbox-cover > .wp-block-cover__inner-container > * {
  pointer-events: auto;
}

/* GLightbox's own overlay opacity varies by breakpoint (opaque #000 by default, rgba(0,0,0,.92) from 769px up) — override uniformly to match the Spothopper theme's lighter mask. */
.goverlay {
  background: rgba(0, 0, 0, 0.5) !important;
}

/* GLightbox's touch-action: none also blocks the page's pinch zoom while open; allow it (image drag/zoom stay off in JS). */
/* `body` raises specificity above GLightbox's own rule, which can load after this file. */
body .glightbox-container,
body .glightbox-container .gslide-image img {
  touch-action: manipulation;
}

/* "Skip Photo Gallery" toggle on core/gallery: off screen until focused, same look as the SpotHopper theme's. */
.wpshp-gallery-has-skip {
  position: relative;
}

.wpshp-gallery-skip {
  position: absolute;
  top: 5px;
  left: -10000px;
  width: auto;
  height: auto;
  margin: 0;
  padding: 7px 10px;
  background: #fff;
  color: #000;
  border: 1px solid #000;
  border-radius: 0;
  font-size: 16px;
  line-height: 1.4;
  text-align: center;
  cursor: pointer;
  z-index: 101;
}

.wpshp-gallery-skip:focus {
  left: 5px;
}

/* Screen-reader-only live region announcing the shown image's alt text (glightbox-core-blocks.js). */
.glightbox-container .glightbox-live-region {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* All effects are forced to "fade" in glightbox-core-blocks.js's mapEffect(), but GLightbox's own .gfadeIn/.gfadeOut animation duration (0.5s) is fixed in its CSS, not a JS option — sped up here instead. */
.gfadeIn {
  animation-duration: 0.2s !important;
  -webkit-animation-duration: 0.2s !important;
}

.gfadeOut {
  animation-duration: 0.2s !important;
  -webkit-animation-duration: 0.2s !important;
}

/* GLightbox has no native option to hide the prev/next arrows — the "Show arrow nav?" per-block setting is enforced by toggling this class in glightbox-core-blocks.js's onOpen callback instead. */
.no-glightbox-arrows .gnext,
.no-glightbox-arrows .gprev {
  display: none !important;
}

/* When loop is off, GLightbox adds .disabled to whichever arrow has no slide to go to (only dimming it to opacity:.1 by default) — hide it outright instead, including on hover, since there's nothing left to navigate to on that side. */
.glightbox-container .gprev.disabled,
.glightbox-container .gnext.disabled {
  display: none !important;
}

/* Matches the Spothopper theme's own GLightbox styling exactly (sh-blocks/assets/css/sh-style.css). 10px of white matting surrounds the image on all sides within its slide. */
.glightbox-container .gslide-image {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  background: #fff;
  border-radius: 4px;
  overflow: hidden;
  padding: 10px;
  max-height: 100vh;
}

.glightbox-container .gslide-image img {
  max-height: 100%;
  max-width: 100%;
}

/* Prev/next arrows are always visible, not only on hover (ADA), same as the SpotHopper theme. */
.glightbox-container .gnext,
.glightbox-container .gprev {
  opacity: 1;
}

@media (max-width: 1024px) {
  #glightbox-slider {
    max-width: 90%;
    margin: 0 auto;
  }
}

/* Nav arrows and close button are positioned relative to the actual rendered <img> (not the padded box above), matching the Spothopper theme: the close button overlaps the image's own top-right corner, and the arrows sit just inside its left/right edges rather than at the viewport edges. Positioning is computed in JS from the image's actual getBoundingClientRect() (glightbox-core-blocks.js) and applied as inline styles — immune to the mobile 100vh-vs-real-viewport mismatch that plain CSS calc() would hit. No !important on top/left/right/transform below, so those inline styles always take effect. */

/* Override GLightbox's opacity: .7 (from its 992px-up rule) at higher specificity instead of !important, so this doesn't fight with GLightbox's own .glightbox-closing .gclose { opacity: 0 !important } fade-out, which still needs to win during the close animation. */
.glightbox-container.glightbox-clean .gclose {
  opacity: 1;
}

/* Reuse the same close/prev/next sprite icons as the Spothopper theme instead of GLightbox's default SVGs. Sprite is a vertical strip: close (0), prev (-36px), next (-72px). */
.glightbox-container .gclose,
.glightbox-container .gprev,
.glightbox-container .gnext {
  background-image: url("../lib/glightbox/glightbox_sprite.png");
  background-repeat: no-repeat;
  background-size: 44px 152px;
  background-color: transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

.glightbox-container .gclose:hover,
.glightbox-container .gprev:hover,
.glightbox-container .gnext:hover {
  background-color: transparent !important;
}

.glightbox-container .gclose svg,
.glightbox-container .gprev svg,
.glightbox-container .gnext svg {
  display: none !important;
}

.glightbox-container .gclose {
  width: 36px !important;
  height: 36px !important;
  background-position: 0 0;
}

.glightbox-container .gprev {
  width: 36px !important;
  height: 34px !important;
  background-position: 0 -36px;
}

.glightbox-container .gnext {
  width: 36px !important;
  height: 34px !important;
  background-position: 0 -72px;
}

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .glightbox-container .gclose,
  .glightbox-container .gprev,
  .glightbox-container .gnext {
    background-image: url("../lib/glightbox/glightbox_sprite-2x.png");
  }
}
