/* SPS wedding album — WebGL canvas gallery + click-to-inspect zoom overlay.
   HTML .photo-list stays hidden; main.js work-slider renders on canvas. */

[data-namespace='photo'] .photo.w-dyn-list,
[data-namespace='photo'] .photo-content .photo.w-dyn-list {
  display: none !important;
  visibility: hidden !important;
}

[data-namespace='photo'] .photo-content canvas {
  display: block !important;
  visibility: visible !important;
}

[data-namespace='photo'] .photo-list {
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

[data-namespace='photo'] .photo-list .photo-item {
  content-visibility: auto;
  contain-intrinsic-size: 860px;
}

[data-namespace='photo'] .photo-list .photo-item img {
  display: block;
  width: 100%;
  height: auto;
  decoding: async;
}

/* Let taps reach the WebGL canvas on touch/tablet — title/counter/header were blocking upper hits */
@media (max-width: 1024px), (hover: none), (pointer: coarse) {
  [data-namespace='photo'] .photo-details,
  [data-namespace='photo'] .photo-details-indicator,
  [data-namespace='photo'] .name-clock__stage,
  [data-namespace='photo'] .name-clock__line,
  [data-namespace='photo'] .number-counter__frame,
  [data-namespace='photo'] .scroll-to-view {
    pointer-events: none;
  }

  body:has([data-namespace='photo']) .header {
    pointer-events: none;
  }

  body:has([data-namespace='photo']) .header a,
  body:has([data-namespace='photo']) .header button {
    pointer-events: auto;
  }

  [data-namespace='photo'] .photo-content,
  [data-namespace='photo'] .photo-content canvas {
    pointer-events: auto;
  }
}

/* Click-to-inspect zoom overlay — does not alter the WebGL gallery layout */
.sps-zoom-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: none;
  padding: 0;
  background: rgba(0, 0, 0, 0.82);
  cursor: zoom-out;
  isolation: isolate;
}

.sps-zoom-overlay.is-open {
  display: block;
}

.sps-zoom-shell {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 100001;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(92vw, 1280px);
  max-width: 96vw;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.sps-zoom-shell > * {
  pointer-events: auto;
}

.sps-zoom-close {
  position: relative;
  z-index: 100002;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 3rem;
  height: 3rem;
  margin-top: 0.85rem;
  margin-bottom: max(0.35rem, env(safe-area-inset-bottom, 0px));
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.sps-zoom-close svg {
  display: block;
  width: 1.15rem;
  height: 1.15rem;
  pointer-events: none;
}

.sps-zoom-close span {
  display: none;
}

.sps-zoom-close:hover,
.sps-zoom-close:focus-visible {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.75);
  outline: none;
}

.sps-zoom-close:active {
  transform: scale(0.94);
}

.sps-zoom-stage {
  position: relative;
  width: 100%;
  height: min(
    calc(100vh - 7.5rem - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)),
    900px
  );
  overflow: hidden;
  line-height: 0;
  cursor: default;
  border-radius: 2px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  background: #050505;
}

@media (max-width: 767px), (hover: none) and (pointer: coarse) {
  .sps-zoom-shell {
    width: min(96vw, 1280px);
  }

  .sps-zoom-close {
    width: 3.35rem;
    height: 3.35rem;
    margin-top: 0.95rem;
    background: rgba(0, 0, 0, 0.82);
    border-color: rgba(255, 255, 255, 0.5);
  }

  .sps-zoom-close svg {
    width: 1.35rem;
    height: 1.35rem;
  }

  .sps-zoom-stage {
    height: min(
      calc(100vh - 8.25rem - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)),
      900px
    );
  }
}

.sps-zoom-image {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  max-width: none;
  max-height: none;
  user-select: none;
  -webkit-user-drag: none;
  transform: translate(0, 0);
  will-change: transform, width, height;
}

.sps-zoom-loading {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: none;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.88);
  font-family: articulat-cf, sans-serif;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  background: rgba(0, 0, 0, 0.28);
}

.sps-zoom-stage.is-loading .sps-zoom-loading {
  display: flex;
}

body.sps-zoom-active {
  overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
  .sps-zoom-image {
    will-change: auto;
  }
}
