/* ============================================================
   ZOOMABLE / LIGHTBOX (shared)
   ------------------------------------------------------------
   Same component used on case-study pages (there it lives inline
   in css/pages/case-study.css to keep that file fully
   self-contained). This copy is for pages that don't otherwise
   load case-study.css — currently the photo/illustration gallery
   pages (css/pages/gallery.css + js/lightbox.js).

   Add `.zoomable` to any img. Hover -> lift + shadow. Click ->
   opens a shadowbox overlay with the enlarged image.

   When the clicked image lives inside a `.gallery-grid` (or a
   `.carousel-wrapper`), the lightbox builds a browsable gallery
   from the other images in that container and shows prev/next
   chevrons — captions come from each image's `data-zoom-caption`.
   Single images outside either container show only the close
   button.

   ESC, overlay click, or the x button closes. Left/Right arrow
   keys navigate. Scroll wheel or trackpad pinch zooms the open
   image (centered); drag to pan once zoomed; double-click toggles
   2x; +/-/reset buttons in the corner cover touch/no-wheel input.
   Zoom resets on navigate/close. The overlay is injected lazily
   by the shared JS.
   ============================================================ */
.zoomable {
  cursor: zoom-in;
  border-radius: 8px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.zoomable:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 36px rgba(26, 26, 46, 0.18);
}
.zoomable:active { transform: translateY(-1px); }
.zoomable img { border-radius: inherit; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(13, 13, 24, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
.lightbox.is-open { opacity: 1; visibility: visible; }
.lightbox-stage {
  width: 80vw;
  height: 80vh;
  overflow: hidden;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transform: scale(0.96);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox.is-open .lightbox-stage { transform: scale(1); }
.lightbox-img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  background: var(--ink);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
  cursor: zoom-in;
  transform-origin: center center;
  transition: transform 0.12s ease-out;
  touch-action: none;
  user-select: none;
  -webkit-user-drag: none;
}
.lightbox-img.is-zoomed { cursor: grab; }
.lightbox-img.is-panning { cursor: grabbing; transition: none; }
.lightbox-zoom {
  position: absolute;
  bottom: 1.5rem;
  right: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.15rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 100px;
  padding: 0.3rem;
}
.lightbox-zoom-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: #fff;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}
.lightbox-zoom-btn:hover { background: rgba(255, 255, 255, 0.15); }
.lightbox-zoom-btn.reset {
  width: auto;
  border-radius: 100px;
  padding: 0 0.75rem;
  font-size: 0.72rem;
  font-family: var(--sans);
  font-weight: 500;
}
@media (max-width: 768px) {
  .lightbox-zoom { bottom: 1rem; right: 1rem; }
  .lightbox-zoom-btn { width: 30px; height: 30px; font-size: 0.9rem; }
}
.lightbox-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: #fff;
  font-size: 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.2s ease;
}
.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: rotate(90deg);
}
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  transition: background 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
}
.lightbox-nav:hover { background: #fff; transform: translateY(-50%) scale(1.05); }
.lightbox-nav.prev { left: 1.5rem; }
.lightbox-nav.next { right: 1.5rem; }
.lightbox-nav[hidden] { display: none; }
@media (max-width: 768px) {
  .lightbox-nav { width: 40px; height: 40px; font-size: 1.1rem; }
  .lightbox-nav.prev { left: 0.5rem; }
  .lightbox-nav.next { right: 0.5rem; }
}
.lightbox-caption {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.85rem;
  font-family: var(--sans);
  max-width: 80vw;
  text-align: center;
}
