window.addEventListener('load', () => {
   readthis();
})
function readthis(){
    document.querySelectorAll('p').forEach(par => {
        if(par.innerHTML.includes('[zak')){
           par.style.setProperty('display','none');
        }
    })
    document.querySelectorAll('p:not(article),:not(article)').forEach(par => {
        if(par.innerHTML.includes('[zak') && !par.innerHTML.includes('*')){
           par.style.setProperty('display','none');
           par.nextElementSibling.style.setProperty('color','#0A7535');
           par.nextElementSibling.style.setProperty('border-bottom','1px');
           par.nextElementSibling.style.setProperty('border-bottom-style','solid');
           par.nextElementSibling.style.setProperty('border-bottom-color','#0A7535');
          
           par.nextElementSibling.style.setProperty('font-size','24px');
           par.nextElementSibling.addEventListener('click', () => {

            document.querySelectorAll('p:not(article),:not(article)').forEach(items => {
                items.style.removeProperty('font-weight');

            })


            
              par.nextElementSibling.style.setProperty('font-weight','600');
              par.nextElementSibling.style.setProperty('cursor','pointer');
           })
        
          
        }
    })
    document.querySelectorAll('article ').forEach(articles => {
        if(articles.innerHTML.includes('[zak')){
            articles.style.setProperty('opacity','0');
            articles.style.setProperty('display','none');
            articles.style.setProperty('border-bottom','none');
        }
    })


    document.querySelectorAll('p').forEach(tag => {
        tag.addEventListener('click', () => {
            document.querySelectorAll('article ').forEach(articles => {
                if(articles.innerHTML.includes('[zak')){
                    articles.style.setProperty('opacity','0');
                    articles.style.setProperty('display','none');
                }
            })
         var tag1=  tag.previousElementSibling.innerHTML.replace('[','').replace(']','');
         console.log(tag1);
           document.querySelectorAll('article p').forEach(arts => {
         
               if(arts.innerHTML.includes(tag1+'*')){
                arts.closest('article').style.removeProperty('opacity');
                arts.closest('article').style.removeProperty('display');
               }
           })

        })
    })
}