{"version":3,"file":"CustomBlogOverviewStyling.B2ahCmhy.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/utGpqtD9VuHovbeKQGtL/Gi12NOVaYZqk4Zqq28Vu/CustomBlogOverviewStyling.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useState}from\"react\";function applyMaxChars(options){const{selector,maxChars,suffix=\"…\",preserveWords=true}=options;if(!Number.isFinite(maxChars)||maxChars<=0)return;const nodes=document.querySelectorAll(selector);nodes.forEach(node=>{const original=(node.textContent||\"\").trim();if(original.length<=maxChars)return;let truncated=original.slice(0,maxChars);if(preserveWords){// Backtrack to last whitespace to avoid cutting a word mid-way\nconst lastSpace=truncated.lastIndexOf(\" \");if(lastSpace>0)truncated=truncated.slice(0,lastSpace);}// Avoid duplicating suffix if original already ends with punctuation\nconst needsSuffix=suffix&&truncated.length<original.length;node.textContent=needsSuffix?`${truncated}${suffix}`:truncated;// Optional: add title for full-text tooltip\nnode.setAttribute(\"title\",original);});}function addPageLoadStyles(){const[isProcessed,setIsProcessed]=useState(false);const applyStyles=()=>{// Wait for DOM to be fully loaded\nsetTimeout(()=>{try{// Only add styles once to prevent duplicates\nif(!document.getElementById(\"custom-blog-styles\")){const styleElement=document.createElement(\"style\");styleElement.id=\"custom-blog-styles\";styleElement.innerHTML=`\n                        @media (min-width: 810px) {\n                            [aria-label=\"post-hover\"]::after {\n                                content: '' !important;\n                                position: absolute !important;\n                                left: 0 !important;\n                                top: 0 !important;\n                                background-color: #f779d0 !important;\n                                height: 100% !important;\n                                width: 0 !important;\n                                z-index: 0 !important;\n                            }\n\n                            [aria-label=\"post-hover\"]::after {\n                                transition: all .35s ease !important;\n                            }\n\n                            [aria-label=\"post-hover\"]:hover::after {\n                                width: 100% !important;\n                            }\n\n                            [data-framer-name=\"Article List\"] {\n                                z-index: 1 !important;\n                            }\n                        }\n                    `;document.head.appendChild(styleElement);}let maxCharsNumber;if(window.innerWidth<=1200&&window.innerWidth>=810){maxCharsNumber=28;}else{maxCharsNumber=32;}const handleResize=()=>{if(window.innerWidth<=1200&&window.innerWidth>=810){maxCharsNumber=28;}else{maxCharsNumber=32;}applyMaxChars({selector:'[data-framer-name=\"Text Article\"] h2',maxChars:maxCharsNumber,suffix:\"…\",preserveWords:true});};window.addEventListener(\"resize\",handleResize);applyMaxChars({selector:'[data-framer-name=\"Text Article\"] h2',maxChars:maxCharsNumber,suffix:\"…\",preserveWords:true});setIsProcessed(true);}catch(error){console.error(\"Error in custom styling:\",error);}},100)// Small delay to ensure DOM is ready\n;};// Use both useEffect and window.onload for better reliability\nuseEffect(()=>{// Initial attempt on component mount\napplyStyles();// Backup: also run when window is fully loaded\nconst handleLoad=()=>{applyStyles();};window.addEventListener(\"load\",handleLoad);// Clean up event listener\nreturn()=>{window.removeEventListener(\"load\",handleLoad);};},[]);}export function customStyling(Component){return props=>{addPageLoadStyles();return /*#__PURE__*/_jsx(Component,{...props});};}\nexport const __FramerMetadata__ = {\"exports\":{\"customStyling\":{\"type\":\"reactHoc\",\"name\":\"customStyling\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CustomBlogOverviewStyling.map"],"mappings":"uIAAiF,SAAS,EAAc,EAAQ,CAAC,GAAK,CAAC,WAAS,WAAS,SAAO,IAAI,gBAAc,IAAM,EAAW,CAAC,OAAO,SAAS,EAAS,EAAE,GAAU,GAAqB,SAAS,iBAAiB,EAAS,CAAO,QAAQ,GAAM,CAAC,IAAM,GAAU,EAAK,aAAa,IAAI,MAAM,CAAC,GAAG,EAAS,QAAQ,EAAS,OAAO,IAAI,EAAU,EAAS,MAAM,EAAE,EAAS,CAAC,GAAG,EAAc,CAClb,IAAM,EAAU,EAAU,YAAY,IAAI,CAAI,EAAU,IAAE,EAAU,EAAU,MAAM,EAAE,EAAU,EACrC,EAAK,YAA9C,GAAQ,EAAU,OAAO,EAAS,OAAoC,GAAG,IAAY,IAAS,EAChH,E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