/* =========================================================
   zoom.css — Zoomable image lightbox with pan + zoom
   Add class="zoomable" to any <img> to enable.
   ========================================================= */

/* Wrapper injected around each .zoomable image */
.zoomable-wrapper {
  position: relative;
  display: block;
  cursor: zoom-in;
}

/* Zoom icon button */
.zoom-icon {
  position: absolute;
  bottom: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  background: rgba(0, 0, 0, 0.55);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.18s ease, background 0.18s ease;
  pointer-events: none;
  z-index: 2;
}

.zoom-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: #ffffff;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.zoomable-wrapper:hover .zoom-icon {
  opacity: 1;
}

/* Overlay backdrop */
#zoom-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s ease, visibility 0.22s ease;
  padding: 32px;
  box-sizing: border-box;
  overflow: hidden;
}

#zoom-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

/* Inner container — intercepts wheel/touch without closing overlay */
#zoom-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  max-height: 100%;
  overflow: visible;
}

/* Lightbox image */
#zoom-img {
  max-width: calc(100vw - 64px);
  max-height: calc(100vh - 64px);
  object-fit: contain;
  border-radius: 4px;
  cursor: default;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
  transform-origin: center center;
  will-change: transform;
  user-select: none;
  -webkit-user-drag: none;
  display: block;
}

/* Entrance animation handled by JS (scale reset on open) */
#zoom-overlay.is-open #zoom-img {
  /* scale set via JS */
}

/* Close button */
#zoom-close {
  position: fixed;
  top: 20px;
  right: 24px;
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.12);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  transition: background 0.15s ease;
}

#zoom-close:hover {
  background: rgba(255, 255, 255, 0.22);
}

#zoom-close svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: #ffffff;
  stroke-width: 2.5;
  stroke-linecap: round;
}

/* +/- zoom controls */
#zoom-controls {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
  z-index: 10000;
}

#zoom-controls button {
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.12);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}

#zoom-controls button:hover {
  background: rgba(255, 255, 255, 0.24);
}

#zoom-controls button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: #ffffff;
  stroke-width: 2.5;
  stroke-linecap: round;
}
