document.querySelectorAll('.accordion-item__trigger').forEach((item) =>
    item.addEventListener('click', () => {
        const parent = item.parentNode;
        const link = parent.querySelector('.link-item');

        if (parent.classList.contains('accordion-item--active')) {
            parent.classList.remove('accordion-item--active');
        } else {
            document
                .querySelectorAll('.accordion-item')
                .forEach((child) => child.classList.remove('accordion-item--active'))
        
            parent.classList.add('accordion-item--active');
        
        }

        if (link.classList.contains('link-item--active')) {
            link.classList.remove('link-item--active');
        } else {
            document
                .querySelectorAll('.link-item')
                .forEach((child) => child.classList.remove('link-item--active'))
        
            link.classList.add('link-item--active');
        
        }

        // if (parent.classList.contains('accordion-item--active')) {
        //     link.style.color = 'gray';

        // } else {
        //     link.style.color = 'blue';

        // }
        
    })
)