ementById('search-input')
    const postsContainer = document.querySelector('.posts-container')
    const noResults = document.getElementById('no-results')
    const tagButtons = document.querySelectorAll('.tag-button')
    const activeTags = new Set()
    let searchIndex = null

    // Load and cache search index
    async function loadSearchIndex() {
      if (searchIndex) return searchIndex
      
      try {
        const response = await fetch('/search_index.json')
        searchIndex = await response.