document.querySelectorAll('.more-link').forEach(link => { link.addEventListener('click', (e) => { e.preventDefault(); // Find the parent text-container and then the truncated-text div const container = link.closest('.text-container').querySelector('.truncated-text'); container.classList.toggle('full'); link.textContent = container.classList.contains('full') ? 'Less' : 'More'; link.setAttribute('aria-expanded', container.classList.contains('full')); }); });