${highlightMatch(t.title||"",e)}
${t.summary?`${highlightMatch(t.summary.substring(0,150),e)}...
`:""}
${t.date?``:""}
`).join(""),toggleSearchResultsVisibility()}function toggleClearButton(){const e=document.getElementById("search-input-clear"),t=document.getElementById("search-input");if(!e||!t)return;t.value.length>0?e.classList.add("visible"):e.classList.remove("visible")}function openSearchModal(){const e=document.getElementById("search-modal");if(!e)return;e.setAttribute("aria-hidden","false"),document.body.style.overflow="hidden",setTimeout(()=>{const e=document.getElementById("search-input");e?.focus(),toggleClearButton()},MODAL_FOCUS_DELAY)}function closeSearchModal(){const t=document.getElementById("search-modal");if(!t)return;t.setAttribute("aria-hidden","true"),document.body.style.overflow="";const n=document.getElementById("search-input"),e=document.getElementById("search-results");n&&(n.value="",toggleClearButton()),e&&(e.innerHTML="",e.style.display="none")}function setupSearchInput(){const e=document.getElementById("search-input");if(!e)return;const t=debounce(e=>{performSearch(e)},SEARCH_DEBOUNCE_DELAY);e.addEventListener("input",e=>{const n=e.target.value;toggleClearButton(),t(n)}),toggleClearButton()}function setupClearButton(){const e=document.getElementById("search-input-clear");if(!e)return;e.addEventListener("click",e=>{e.preventDefault(),e.stopPropagation();const t=document.getElementById("search-input"),n=document.getElementById("search-results");t&&(t.value="",t.focus(),toggleClearButton(),n&&(n.innerHTML="",n.style.display="none"),t.dispatchEvent(new Event("input",{bubbles:!0})))})}function setupKeyboardShortcuts(){document.addEventListener("keydown",e=>{const t=document.getElementById("search-modal");e.key==="Escape"&&t?.getAttribute("aria-hidden")==="false"&&closeSearchModal()})}function setupModalClickHandling(){const e=document.getElementById("search-modal"),t=e?.querySelector(".search-modal-container");t?.addEventListener("click",e=>{e.stopPropagation()})}function initSearch(){const e=document.getElementById("search-toggle"),t=document.getElementById("search-modal-backdrop"),n=document.getElementById("search-modal-close");e&&e.addEventListener("click",openSearchModal),t&&t.addEventListener("click",closeSearchModal),n&&n.addEventListener("click",closeSearchModal),setupSearchInput(),setupClearButton(),setupKeyboardShortcuts(),setupModalClickHandling(),loadSearchIndex()}(function(){document.readyState==="loading"?document.addEventListener("DOMContentLoaded",initSearch):initSearch()})();function toggleScrollButton(){const e=document.getElementById("scroll-to-top");if(!e)return;window.scrollY>SCROLL_THRESHOLD?e.classList.add("visible"):e.classList.remove("visible")}function scrollToTop(){window.scrollTo({top:0,behavior:"smooth"})}function initScrollToTop(){const e=document.getElementById("scroll-to-top");if(!e)return;window.addEventListener("scroll",toggleScrollButton),e.addEventListener("click",scrollToTop)}(function(){document.readyState==="loading"?document.addEventListener("DOMContentLoaded",initScrollToTop):initScrollToTop()})();function initGlassDockNavigation(){const t=document.querySelector(".glass-dock-toggle"),e=document.querySelector(".glass-dock-list");if(!t||!e)return;t.addEventListener("click",function(){const t=this.getAttribute("aria-expanded")==="true";this.setAttribute("aria-expanded",!t),e.classList.toggle("mobile-open",!t)}),e.querySelectorAll(".glass-dock-link").forEach(n=>{n.addEventListener("click",function(){window.innerWidth<=MOBILE_BREAKPOINT&&(t.setAttribute("aria-expanded","false"),e.classList.remove("mobile-open"))})}),document.addEventListener("click",function(n){window.innerWidth<=MOBILE_BREAKPOINT&&!t.contains(n.target)&&!e.contains(n.target)&&(t.setAttribute("aria-expanded","false"),e.classList.remove("mobile-open"))})}function initSmoothScroll(){document.querySelectorAll('a[href^="#"]').forEach(e=>{e.addEventListener("click",function(e){const t=this.getAttribute("href");if(t==="#"||t.length<=1)return;const n=document.querySelector(t);n&&(e.preventDefault(),n.scrollIntoView({behavior:"smooth",block:"start"}))})})}function initPostCardClick(){document.querySelectorAll(".post-card[data-post-url]").forEach(e=>{e.addEventListener("click",function(e){if(e.target.closest("a"))return;const t=this.getAttribute("data-post-url");t&&(window.location.href=t)})})}function initNavigation(){initGlassDockNavigation(),initSmoothScroll(),initPostCardClick()}(function(){document.readyState==="loading"?document.addEventListener("DOMContentLoaded",initNavigation):initNavigation()})();function isWideScreen(){return window.innerWidth>WIDE_SCREEN_BREAKPOINT}function expandTOC(e,t){e.setAttribute("aria-expanded","true"),t.classList.add("expanded")}function collapseTOC(e,t){e.setAttribute("aria-expanded","false"),t.classList.remove("expanded")}function toggleTOC(e,t){const n=e.getAttribute("aria-expanded")==="true";n?collapseTOC(e,t):expandTOC(e,t)}function initializeTOCState(e,t){isWideScreen()?expandTOC(e,t):collapseTOC(e,t)}function updateActiveTOCItem(e,t,n){const o=window.scrollY+TOC_SCROLL_OFFSET;let s=null;for(let t=e.length-1;t>=0;t--){const{element:n}=e[t];if(n&&n.offsetTop<=o){s=e[t];break}}if(t.forEach(e=>e.classList.remove("active")),s&&(s.link.classList.add("active"),n.classList.contains("expanded")&&s.link)){const e=s.link.offsetTop,t=s.link.offsetHeight,o=n.offsetHeight,i=n.scrollTop;e