/* Clochat photo viewer — intentionally mirrors the PDF reader shell.
   Direct, unmodified port of css/40-photo-viewer.css. This is the
   AUTHORITATIVE styling for in-chat photo taps (media/photo-viewer.js's
   #clochat-photo-viewer), distinct from video-pdf-viewers.css's
   `.viewer.v50-photo-viewer`, which only serves the profile media grid. */
html.clochat-photo-viewer-open,
body.clochat-photo-viewer-open {
  overflow: hidden !important;
  overscroll-behavior: none !important;
}

#clochat-photo-viewer {
  position: fixed !important;
  inset: 0 !important;
  z-index: 2147483647 !important;
  width: 100vw !important;
  height: 100dvh !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  isolation: isolate !important;
  background: #000 !important;
  color: #fff !important;
  -webkit-user-select: none !important;
  user-select: none !important;
}

#clochat-photo-viewer .clochat-photo-bar {
  flex: 0 0 calc(62px + env(safe-area-inset-top)) !important;
  height: calc(62px + env(safe-area-inset-top)) !important;
  box-sizing: border-box !important;
  width: 100% !important;
  padding: env(safe-area-inset-top) 14px 0 !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  background: #10182e !important;
  border-bottom: 1px solid rgba(255,255,255,.12) !important;
}

#clochat-photo-viewer .clochat-photo-bar__button {
  flex: 0 0 44px !important;
  width: 44px !important;
  height: 44px !important;
  border: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border-radius: 50% !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  background: transparent !important;
  color: #fff !important;
  display: grid !important;
  place-items: center !important;
  font: 400 37px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
}
#clochat-photo-viewer .clochat-photo-bar__share { font-size: 27px !important; }
#clochat-photo-viewer .clochat-photo-bar__title {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  text-align: center !important;
  color: #fff !important;
  font: 700 16px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
}

#clochat-photo-viewer .clochat-photo-stage {
  position: relative !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  width: 100% !important;
  overflow: hidden !important;
  display: grid !important;
  place-items: center !important;
  background: #000 !important;
  touch-action: none !important;
}
#clochat-photo-viewer .clochat-photo-canvas {
  position: absolute !important;
  left: 50% !important;
  top: 50% !important;
  transform: translate3d(calc(-50% + var(--photo-x, 0px)), calc(-50% + var(--photo-y, 0px)), 0) scale(var(--photo-scale, 1)) !important;
  transform-origin: center center !important;
  will-change: transform !important;
}
#clochat-photo-viewer .clochat-photo-image {
  position: absolute !important;
  inset: 0 !important;
  display: block !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: contain !important;
  pointer-events: none !important;
  -webkit-user-drag: none !important;
}
#clochat-photo-viewer .clochat-photo-counter {
  position: absolute !important;
  left: 50% !important;
  bottom: calc(16px + env(safe-area-inset-bottom)) !important;
  transform: translateX(-50%) !important;
  z-index: 3 !important;
  color: rgba(255,255,255,.72) !important;
  font: 600 13px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  pointer-events: none !important;
}
