(function () { if (!window.matchMedia('(max-width: 640px)').matches) return; const getImageAlt = (video, card) => { const fromData = video.getAttribute('data-img-alt'); if (fromData !== null) return fromData.trim(); const fromAlt = video.getAttribute('alt'); if (fromAlt !== null && fromAlt.trim() !== 'decorative') return fromAlt.trim(); const titleEl = card.querySelector( '.card_info .title, .card_info [class*="title"], .card_info h3, .card_info h4' ); return titleEl?.textContent?.trim() || ''; }; const removeVideos = () => { document.querySelectorAll('.orbit_card').forEach(card => { const coreVideo = card.querySelector('.core_video video'); card.querySelectorAll('video').forEach(video => { if (video === coreVideo || coreVideo?.contains(video)) return; const poster = video.getAttribute('poster'); if (poster) { const img = document.createElement('img'); img.src = poster; img.alt = getImageAlt(video, card); if (!img.alt) { img.setAttribute('aria-hidden', 'true'); } img.style.width = '100%'; img.style.height = '100%'; img.style.objectFit = 'cover'; video.parentNode.insertBefore(img, video); } video.remove(); }); }); }; if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', removeVideos); } else if (window.requestIdleCallback) { requestIdleCallback(removeVideos, { timeout: 100 }); } else { setTimeout(removeVideos, 0); } })();