document.addEventListener("DOMContentLoaded", function() {
document.querySelectorAll('.eventlist-event').forEach(function(eventItem) {
// Find the source URL (Luma link)
const sourceLink = eventItem.querySelector('.eventitem-sourceurl a');
if (!sourceLink) return;
const lumaUrl = sourceLink.href;
// Replace View Event button link
const viewBtn = eventItem.querySelector('.eventlist-read-more-link');
if (viewBtn) {
viewBtn.href = lumaUrl;
viewBtn.target = "_blank";
viewBtn.rel = "noopener";
}
// OPTIONAL: make title clickable to Luma too
const titleLink = eventItem.querySelector('.eventlist-title a');
if (titleLink) {
titleLink.href = lumaUrl;
titleLink.target = "_blank";
titleLink.rel = "noopener";
}
});
});