/* viewer.js ========= Light-box / zoom / keyboard logic for the result grid. Expects: • the page to contain thumbnails inside elements with class="item" and data-idx attributes that match the order of window.GRID_DATA.sources & window.GRID_DATA.captions • the CSS rules from viewer.css (same selectors as before) */ const INITIAL_SCALE_WHEN_FITS = 1.5; /* ---------------------------------------------------------- 1. Data from Python-generated