document.addEventListener('DOMContentLoaded', () => {
  const big = document.getElementById('big-image');
  const caption = document.getElementById('big-caption');
  document.querySelectorAll('.grid img').forEach(img => {
    img.addEventListener('click', () => {
      big.src = img.dataset.full;
      big.alt = img.alt;
      caption.textContent = img.dataset.caption || img.alt;
    });
  });
});
