let slides = document.querySelectorAll('#imageSlider .slide');

slides.forEach(slide => {
  slide.addEventListener('mouseenter', () => {
    const caption = slide.querySelector('.caption');
    caption.style.display = 'block';
  });
  slide.addEventListener('mouseleave', () => {
    const caption = slide.querySelector('.caption');
    caption.style.display = 'none';
  });
});