/* Shared zoom viewer (static/js/zoom.js) + the unstyled trigger buttons that open it.
   Colours come from the site CSS variables, which dark-mode.css redefines, so the toolbar
   follows the theme with no rules of its own. */

/* ── Triggers ─────────────────────────────────────────────────────────────
   A trigger is a <button> wrapped around art, styled so the framed layout is exactly what
   it was without it: no chrome, block, inheriting everything. */
.zoom-trigger{
  display:block; margin:0; padding:0; border:0; background:none;
  font:inherit; color:inherit; text-align:inherit; line-height:inherit;
  border-radius:inherit; cursor:zoom-in;
}
.zoom-trigger:focus-visible{ outline:3px solid var(--accent-dark); outline-offset:2px; }
/* Detail art: fill the same box the bare <img> filled. */
.zoom-trigger--art{ width:100%; }
.detail-art--framed .zoom-trigger--art{ height:100%; }
/* Sprite showcase: shrink-wrap the sprite like the bare div did. */
.zoom-trigger--sprite{ width:auto; border-radius:8px; }

/* ── Viewer ───────────────────────────────────────────────────────────────
   z-index sits above the cropper modal (10000) and the site's .modal-overlay (200). */
.zoom-modal{
  position:fixed; inset:0; z-index:20000;
  background:rgba(30,22,15,.9);
  overscroll-behavior:contain;
}
.zoom-modal[hidden]{ display:none; }
.zoom-modal:focus{ outline:none; }

.zoom-viewport{
  position:absolute; inset:0; overflow:hidden;
  touch-action:none;               /* pointer events own every gesture; no browser pan/zoom */
  cursor:grab;
  user-select:none; -webkit-user-select:none;
}
.zoom-viewport.is-dragging{ cursor:grabbing; }
.zoom-viewport img{ -webkit-user-drag:none; }

/* The stage is sized in px by the script (fit width x zoom) and moved with translate();
   whatever it holds simply fills it. */
.zoom-stage{ position:absolute; left:0; top:0; }
.zoom-stage > *{
  width:100%; height:100%;
  max-width:none; max-height:none; margin:0; box-sizing:border-box;
}
.zoom-stage > img{ display:block; }
.zoom-stage--pixelated, .zoom-stage--pixelated *{ image-rendering:pixelated; }
.zoom-placeholder{ visibility:hidden; }

.zoom-toolbar{
  position:absolute; top:12px; right:12px; z-index:1;
  display:flex; gap:6px;
}
.zoom-btn{
  width:44px; height:44px; padding:0;
  display:inline-flex; align-items:center; justify-content:center;
  font-family:inherit; font-size:1.35rem; font-weight:700; line-height:1;
  color:var(--ink); background:var(--card);
  border:2px solid var(--wood-edge); border-radius:12px; cursor:pointer;
  box-shadow:0 4px 10px rgba(0,0,0,.3);
}
.zoom-btn:hover{ background:var(--bg); }

.zoom-error{
  position:absolute; left:50%; top:50%; transform:translate(-50%,-50%);
  margin:0; padding:.8rem 1.2rem; border-radius:12px;
  color:var(--ink); background:var(--card); border:2px solid var(--wood-edge);
}
