document.addEventListener("DOMContentLoaded", function () { const blocks = document.querySelectorAll('.policy-toggle-block'); blocks.forEach(function (block) { const btn = block.querySelector('.policy-toggle-btn'); const shortList = block.querySelector('.policy-list--short'); const fullList = block.querySelector('.policy-list--full'); if (!btn || !shortList || !fullList) return; btn.addEventListener('click', function () { const isOpen = fullList.style.display === 'block'; if (isOpen) { fullList.style.display = 'none'; shortList.style.display = 'block'; btn.textContent = '…view more'; } else { fullList.style.display = 'block'; shortList.style.display = 'none'; btn.textContent = 'view less'; } }); }); });