// support close lightbox with click outside @since 5.0.9
$(document).on('click', function(e) {
const $open = $('.evo_lightbox.show');
if ($open.length === 0) return;
if (!document.contains(e.target)) return;
// If clicked inside any .evolb_box → do nothing
if ($(e.target).closest('.evolb_box').length) return;
// Otherwise close the topmost lightbox
$open.last().evo_lightbox_close({ delay: 300 });
});