(function() {
  'use strict';
  
  var SORO_BLOG_TITLE = 'aroundtheclockservice.com';
  var SORO_ARTICLES = [{"id":"f87a1658-1af5-40c1-ba9f-bdec8ca7fc9f","title":"Tankless Water Heater Review for Lexington Homes","slug":"tankless-water-heater-review-lexington-homes","excerpt":"Our tankless water heater review covers cost, sizing, performance, and when a conventional tank is the better choice for Central Kentucky homes today.","content":null,"date":"October 10, 2026","isoDate":"2026-10-10T03:23:59.476+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/f0c9310f-822e-4e27-847e-cf8e8605ca0a/workflows/bfb663f7-4d80-4a00-833a-5a9e31ce982f.webp"},{"id":"537f6c5f-4e0e-4a38-b683-62cc6aa8d092","title":"Electrical Services That Keep Properties Safe","slug":"electrical-services-lexington-ky","excerpt":"Get dependable electrical services in Lexington, KY for repairs, panels, lighting, inspections, and commercial projects with clear, fair pricing locally.","content":null,"date":"October 8, 2026","isoDate":"2026-10-08T03:30:28.968+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/f0c9310f-822e-4e27-847e-cf8e8605ca0a/workflows/6ad4e06e-8e37-4e47-b80b-72b43869f9e3.webp"},{"id":"5249e1e9-2481-4004-a3a8-40a69c8b3d93","title":"Restaurant Grease Trap Maintenance That Prevents Closures","slug":"restaurant-grease-trap-maintenance","excerpt":"Restaurant grease trap maintenance prevents drain backups, odors, fines, and shutdowns. Learn when to schedule professional service and when to call a plumber.","content":null,"date":"October 6, 2026","isoDate":"2026-10-06T03:22:56.71+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/f0c9310f-822e-4e27-847e-cf8e8605ca0a/workflows/4c206a46-35c4-47d0-a58c-9552ff323372.webp"},{"id":"5e546ca2-8f4a-4b78-979f-bec8372a3343","title":"What Causes Sewer Odors Around Your Home?","slug":"what-causes-sewer-odors","excerpt":"What causes sewer odors? Learn the common plumbing problems behind the smell, what you can check safely, and when to call a Lexington plumber right away.","content":null,"date":"October 4, 2026","isoDate":"2026-10-04T03:23:07.546+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/f0c9310f-822e-4e27-847e-cf8e8605ca0a/workflows/c5b95c14-e8c3-4f32-8149-454434b7deef.webp"},{"id":"ce644f1a-6a74-4b64-9f2e-12e269cf04d3","title":"How to Seal Air Ducts Without Wasting Energy","slug":"how-to-seal-air-ducts","excerpt":"Learn how to seal air ducts safely, spot hidden leaks, choose the right materials, and know when a Lexington HVAC technician should handle the job safely.","content":null,"date":"October 2, 2026","isoDate":"2026-10-02T03:30:47.778+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/f0c9310f-822e-4e27-847e-cf8e8605ca0a/workflows/129e06be-78f4-40dc-8ceb-576c49e77afd.webp"},{"id":"3214aa01-17d2-4d57-b32b-e386f12168ec","title":"Ductwork Replacement Guide for Lexington Homes","slug":"ductwork-replacement-guide-lexington-homes","excerpt":"This ductwork replacement guide explains warning signs, costs, sizing, and what Lexington homeowners should expect from a qualified installation team.","content":null,"date":"September 30, 2026","isoDate":"2026-09-30T03:23:48.542+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/f0c9310f-822e-4e27-847e-cf8e8605ca0a/workflows/4d802078-268a-4372-822f-2722450d1735.webp"},{"id":"b9682547-efff-4905-8bb0-1c3d5af980ee","title":"10 Sump Pump Failure Signs You Should Not Ignore","slug":"sump-pump-failure-signs","excerpt":"Know the sump pump failure signs that put your Lexington home at risk, what causes them, and when to call for prompt, dependable plumbing repair today.","content":null,"date":"September 28, 2026","isoDate":"2026-09-28T03:22:28.313+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/f0c9310f-822e-4e27-847e-cf8e8605ca0a/workflows/a75a39a9-c930-44b1-89ee-42d04956e677.webp"},{"id":"1f0be2b2-a215-42bc-8243-3faf6d0926d6","title":"Central Air Versus Ductless Systems Compared","slug":"central-air-versus-ductless-systems","excerpt":"Compare central air versus ductless systems for Lexington homes and businesses. See costs, comfort, efficiency, installation needs, and the right fit.","content":null,"date":"September 26, 2026","isoDate":"2026-09-26T03:24:14.254+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/f0c9310f-822e-4e27-847e-cf8e8605ca0a/workflows/9a3a8bbf-13b8-42eb-9ae4-48bd6ac00761.webp"},{"id":"eef4a0b3-3406-40a5-b097-a3656f55d285","title":"Repair Versus Replace Air Conditioner Decisions","slug":"repair-versus-replace-air-conditioner","excerpt":"Repair versus replace air conditioner? Learn how age, repair cost, efficiency, refrigerant, and comfort concerns affect the smart choice for your property.","content":null,"date":"September 24, 2026","isoDate":"2026-09-24T03:25:06.186+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/f0c9310f-822e-4e27-847e-cf8e8605ca0a/workflows/0eb10406-eed3-4e75-be35-788a31b2077f.webp"},{"id":"f6c3d3d0-741f-41e8-99b5-c591a8b7c8d9","title":"When to Replace Electrical Panel in Your Home","slug":"when-to-replace-electrical-panel","excerpt":"Learn when to replace electrical panel equipment, recognize safety warning signs, and plan a practical upgrade for your Lexington, KY home or business.","content":null,"date":"September 22, 2026","isoDate":"2026-09-22T03:23:18.369+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/f0c9310f-822e-4e27-847e-cf8e8605ca0a/workflows/7ee3b526-7741-457a-a61e-3cf42a7b0582.webp"},{"id":"0052e19d-5e55-4852-a59e-ebdb682957e7","title":"Gas Line Installation for Homes and Businesses","slug":"gas-line-installation","excerpt":"Professional gas line installation protects your Lexington property, supports reliable appliances, and helps avoid leaks, code issues, and costly rework.","content":null,"date":"September 20, 2026","isoDate":"2026-09-20T03:24:38.543+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/f0c9310f-822e-4e27-847e-cf8e8605ca0a/workflows/ed479cf1-12af-47c2-bbae-7f482cd4df40.webp"},{"id":"6617860b-0fe4-4db4-bc4f-92f128c6114c","title":"EV Charger Installation Guide for Lexington Homes","slug":"ev-charger-installation-guide-lexington-homes","excerpt":"Use this EV charger installation guide to plan a safe home or business charging setup, from electrical capacity and permits to testing in Lexington, KY.","content":null,"date":"September 18, 2026","isoDate":"2026-09-18T03:33:54.595+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/f0c9310f-822e-4e27-847e-cf8e8605ca0a/workflows/499c95b2-47bf-4fa7-b76a-05c21adf4ef0.webp"},{"id":"2e3dade4-dc12-4032-82a0-ad186eca1bdc","title":"Noisy AC Repair When Your System Gets Loud","slug":"noisy-ac-repair","excerpt":"Noisy AC repair starts with identifying the sound. Learn what rattling, buzzing, squealing, and banging may mean and when to call a Lexington technician.","content":null,"date":"September 16, 2026","isoDate":"2026-09-16T03:40:59.458+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/f0c9310f-822e-4e27-847e-cf8e8605ca0a/workflows/a296ef0d-9941-46b0-b6de-36bfc7d9e2f6.webp"},{"id":"3c410ca1-e857-4cf1-866b-3a80458e207b","title":"Commercial Plumbing That Keeps Your Business Open","slug":"commercial-plumbing-keeps-business-open","excerpt":"Commercial plumbing protects your Lexington business from leaks, clogs, and downtime with prompt repairs, planned maintenance, and clear, fair pricing.","content":null,"date":"September 14, 2026","isoDate":"2026-09-14T03:33:50.62+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/f0c9310f-822e-4e27-847e-cf8e8605ca0a/workflows/ed68ba5e-d2ea-4184-98c4-178506747054.webp"},{"id":"2840202c-bf55-4519-b1a5-7c578597c48b","title":"Electric Versus Gas Furnace: Which Fits Your Home?","slug":"electric-versus-gas-furnace","excerpt":"Compare electric versus gas furnace costs, efficiency, safety, and installation needs to choose reliable heat for your Lexington, KY home for winter.","content":null,"date":"September 12, 2026","isoDate":"2026-09-12T02:44:35.069+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/f0c9310f-822e-4e27-847e-cf8e8605ca0a/workflows/89e9d9f2-307c-4a67-9e4c-a8b0d74b4ed4.webp"},{"id":"eaa628c1-4a1d-4107-bce5-70d66abea907","title":"How to Choose a Water Heater for Your Home","slug":"how-to-choose-water-heater","excerpt":"Learn how to choose water heater size, fuel type, and efficiency for reliable hot water in your Lexington home, without paying for more than you need.","content":null,"date":"September 10, 2026","isoDate":"2026-09-10T02:05:38.416+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/f0c9310f-822e-4e27-847e-cf8e8605ca0a/workflows/80f9e641-ed54-4823-820d-f99647c16c47.webp"},{"id":"9cab4265-b623-4ce3-9623-779cce6bb2c5","title":"How to Lower Cooling Bills Without Losing Comfort","slug":"how-to-lower-cooling-bills","excerpt":"Learn how to lower cooling bills with practical thermostat, airflow, insulation, and AC maintenance steps for Lexington homes and businesses this summer.","content":null,"date":"September 8, 2026","isoDate":"2026-09-08T06:54:54.085+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/f0c9310f-822e-4e27-847e-cf8e8605ca0a/workflows/5e7ecc74-bb7f-48ad-88c1-658f1844a07d.webp"},{"id":"073503b2-6178-4369-9cef-26a93a43f122","title":"Why Does Toilet Keep Running After a Flush?","slug":"why-does-toilet-keep-running","excerpt":"Why does toilet keep running after a flush? Learn the common causes, safe checks, and when Lexington homeowners should call a licensed plumber for help.","content":null,"date":"September 6, 2026","isoDate":"2026-09-06T07:57:54.712+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/f0c9310f-822e-4e27-847e-cf8e8605ca0a/workflows/60b87a92-aee9-4df4-b8fa-8a712741a2fe.webp"},{"id":"707cd338-3af3-47aa-863f-d4c39f05ecb9","title":"Commercial HVAC That Keeps Business Running","slug":"commercial-hvac","excerpt":"Commercial HVAC service helps Lexington businesses reduce breakdowns, control energy costs, and keep occupants comfortable in every season, all year long.","content":null,"date":"September 4, 2026","isoDate":"2026-09-04T07:54:53.214+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/f0c9310f-822e-4e27-847e-cf8e8605ca0a/workflows/62f22c42-e9f4-43ef-891b-0006a5a9cbae.webp"},{"id":"cf110be5-8c40-4c09-9cb5-a4fa23df8a65","title":"Electrical Wiring: Signs Your Home Needs an Upgrade","slug":"electrical-wiring-signs-home-needs-upgrade","excerpt":"Learn when electrical wiring needs attention, what an upgrade involves, and how licensed Lexington electricians protect your home or business safely, too.","content":null,"date":"September 2, 2026","isoDate":"2026-09-02T07:54:53.694+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/f0c9310f-822e-4e27-847e-cf8e8605ca0a/workflows/d94319e4-868d-440e-a537-fa015ff1450c.webp"},{"id":"9ca56692-902a-4fdb-8646-cad132d77565","title":"HVAC Installation That Fits Your Lexington Home","slug":"hvac-installation-lexington-ky","excerpt":"Plan your HVAC installation with the right system, honest pricing, and skilled service for dependable comfort in Lexington and Central Kentucky homes.","content":null,"date":"August 31, 2026","isoDate":"2026-08-31T07:54:51.824+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/f0c9310f-822e-4e27-847e-cf8e8605ca0a/workflows/a38f7abf-c16e-4e15-a276-300c47b4e786.webp"},{"id":"8cddeb4c-b751-4d03-8688-a858e48c1cac","title":"Plumbing Repair Problems You Should Not Ignore","slug":"plumbing-repair-problems-you-should-not-ignore","excerpt":"Get clear answers on plumbing repair, from small leaks to drain backups. Learn what you can check, when to call a pro, and protect your property at home.","content":null,"date":"August 29, 2026","isoDate":"2026-08-29T07:51:41.492+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/f0c9310f-822e-4e27-847e-cf8e8605ca0a/workflows/b4fe78e5-4ee9-47e7-a7fc-7eb2e7e501d9.webp"},{"id":"89b31bc1-010c-410e-9085-b819d36ccaeb","title":"When to Replace Air Conditioner: 8 Clear Signs","slug":"when-to-replace-air-conditioner","excerpt":"Wondering when to replace air conditioner equipment? Learn the signs, costs, and smart timing for a reliable new AC system in Central Kentucky homes today.","content":null,"date":"August 27, 2026","isoDate":"2026-08-27T07:51:31.824+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/f0c9310f-822e-4e27-847e-cf8e8605ca0a/workflows/3bf2a7e9-e391-4315-9edb-ea5c76a3a5e6.webp"},{"id":"8c6e2b0a-e76f-4a54-ae41-7b62dd5a3ccf","title":"Why Outlets Spark and When to Call an Electrician","slug":"why-outlets-spark","excerpt":"Why outlets spark: understand normal plug-in flashes, warning signs of wiring trouble, and when Lexington homeowners should call a licensed electrician.","content":null,"date":"August 25, 2026","isoDate":"2026-08-25T07:48:49.869+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/f0c9310f-822e-4e27-847e-cf8e8605ca0a/workflows/85b0c20c-796a-4a92-bb52-a476cd1c3c18.webp"},{"id":"508d7eb9-4e07-46c2-8a15-e1f2856242a0","title":"10 Signs of Hidden Leaks You Should Not Ignore","slug":"signs-of-hidden-leaks","excerpt":"Learn the signs of hidden leaks, from higher water bills to wall stains, and know when Lexington homeowners and businesses should call a licensed plumber.","content":null,"date":"August 23, 2026","isoDate":"2026-08-23T07:42:30.461+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/f0c9310f-822e-4e27-847e-cf8e8605ca0a/workflows/6dcd376d-fc92-42a0-a9ce-ca939571b22e.webp"},{"id":"9f6f79cd-34ff-4ce8-8e68-cfa42d706ab8","title":"Unclogging a Toilet Without Making It Worse","slug":"unclogging-a-toilet-without-making-it-worse","excerpt":"Unclogging a toilet safely starts with stopping an overflow, using the right plunger, and knowing when it is time to call a Lexington plumber quickly.","content":null,"date":"August 21, 2026","isoDate":"2026-08-21T07:43:01.801+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/f0c9310f-822e-4e27-847e-cf8e8605ca0a/9f6f79cd-34ff-4ce8-8e68-cfa42d706ab8.webp"},{"id":"9cce81b0-0765-40b5-8295-de4c94fa932e","title":"Commercial Rooftop Unit Maintenance That Pays Off","slug":"commercial-rooftop-unit-maintenance","excerpt":"Commercial rooftop unit maintenance reduces breakdowns, protects comfort, and controls energy costs for local Lexington businesses in all four seasons.","content":null,"date":"August 19, 2026","isoDate":"2026-08-19T06:21:31.492+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/f0c9310f-822e-4e27-847e-cf8e8605ca0a/9cce81b0-0765-40b5-8295-de4c94fa932e.webp"},{"id":"70cdd068-7f38-46da-8850-48361f427f9e","title":"Why Breakers Keep Tripping in Your Home","slug":"why-breakers-keep-tripping","excerpt":"Learn why breakers keep tripping, what you can safely check, and when Lexington homeowners should call a licensed electrician for a lasting repair today.","content":null,"date":"August 17, 2026","isoDate":"2026-08-17T03:33:59.779+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/f0c9310f-822e-4e27-847e-cf8e8605ca0a/70cdd068-7f38-46da-8850-48361f427f9e.webp"},{"id":"55dcd5de-31e2-4c8f-9d93-789ee7eaa743","title":"Heat Pump Installation Costs in Lexington, KY","slug":"heat-pump-installation-costs-lexington-ky","excerpt":"Understand heat pump installation costs in Lexington, KY, including equipment, labor, electrical work, rebates, and what a written quote should cover.","content":null,"date":"August 15, 2026","isoDate":"2026-08-15T03:46:05.66+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/f0c9310f-822e-4e27-847e-cf8e8605ca0a/55dcd5de-31e2-4c8f-9d93-789ee7eaa743.webp"},{"id":"eca4e9d3-8d8d-4f53-9bad-cde6d9abd954","title":"Tankless Versus Standard Water Heater Choices","slug":"tankless-versus-standard-water-heater","excerpt":"Compare tankless versus standard water heater options for Lexington homes or businesses, including cost, efficiency, capacity, service needs, and lifespan.","content":null,"date":"August 13, 2026","isoDate":"2026-08-13T04:57:27.692+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/f0c9310f-822e-4e27-847e-cf8e8605ca0a/eca4e9d3-8d8d-4f53-9bad-cde6d9abd954.webp"},{"id":"ca75a1bb-244c-45ab-9ea2-0b70d2dbd1ed","title":"Ductless Mini Split Benefits for Kentucky Homes","slug":"ductless-mini-split-benefits-kentucky-homes","excerpt":"See the ductless mini split benefits that matter in Central Kentucky, from room-by-room comfort and lower energy use to simpler additions and upgrades.","content":null,"date":"August 11, 2026","isoDate":"2026-08-11T05:12:57.52+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/f0c9310f-822e-4e27-847e-cf8e8605ca0a/ca75a1bb-244c-45ab-9ea2-0b70d2dbd1ed.webp"},{"id":"5b5382e1-2b97-4eb5-a040-ba98da7d785b","title":"How to Detect Slab Leaks Before Damage Spreads","slug":"how-to-detect-slab-leaks","excerpt":"Learn how to detect slab leaks early, recognize warning signs, and know when Lexington homeowners should call a licensed plumber for accurate repairs.","content":null,"date":"August 9, 2026","isoDate":"2026-08-09T03:57:20.858+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/f0c9310f-822e-4e27-847e-cf8e8605ca0a/5b5382e1-2b97-4eb5-a040-ba98da7d785b.webp"},{"id":"b77faf6e-f476-4818-85f6-46351f3546f6","title":"Whole House Surge Protection: Is It Worth It?","slug":"whole-house-surge-protection","excerpt":"Whole house surge protection helps guard Lexington homes and businesses from damaging power spikes. Learn what it covers and when to install it safely.","content":null,"date":"August 7, 2026","isoDate":"2026-08-07T04:24:19.752+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/f0c9310f-822e-4e27-847e-cf8e8605ca0a/b77faf6e-f476-4818-85f6-46351f3546f6.webp"},{"id":"0a102a89-1b5f-4442-9791-c4dfc7c7acd5","title":"How Often Should HVAC Be Serviced in Kentucky?","slug":"how-often-should-hvac-be-serviced","excerpt":"How often should HVAC be serviced? Learn the right schedule for Lexington homes and businesses, plus signs your system needs professional maintenance now.","content":null,"date":"August 5, 2026","isoDate":"2026-08-05T05:42:34.676+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/c7d78ee3-548a-4628-be41-6acf3921615a/0a102a89-1b5f-4442-9791-c4dfc7c7acd5.webp"},{"id":"c60f066f-060e-4bb4-b1b2-fe275e04607b","title":"Can Old Wiring Cause Fires? Warning Signs to Know","slug":"can-old-wiring-cause-fires","excerpt":"Can old wiring cause fires? Learn the warning signs, common electrical hazards, and when to call a licensed electrician for a safety inspection today.","content":null,"date":"August 3, 2026","isoDate":"2026-08-03T05:48:35.325+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/c7d78ee3-548a-4628-be41-6acf3921615a/c60f066f-060e-4bb4-b1b2-fe275e04607b.webp"},{"id":"3f38752f-d714-4435-8e1b-f3b82a0b85ec","title":"How to Winterize Pipes Before a Kentucky Freeze","slug":"how-to-winterize-pipes","excerpt":"Learn how to winterize pipes before freezing weather hits Lexington. Protect indoor and outdoor plumbing with simple steps to help prevent burst pipes.","content":null,"date":"August 1, 2026","isoDate":"2026-08-01T06:09:20.117+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/c7d78ee3-548a-4628-be41-6acf3921615a/3f38752f-d714-4435-8e1b-f3b82a0b85ec.webp"},{"id":"66475af6-b005-4c43-90f9-f72a8f536bae","title":"Heat Pump Versus Furnace for Kentucky Homes","slug":"heat-pump-versus-furnace-kentucky-homes","excerpt":"Heat pump versus furnace: compare comfort, efficiency, upfront cost, and Central Kentucky winter performance before choosing a heating system for home.","content":null,"date":"July 30, 2026","isoDate":"2026-07-30T05:55:04.266+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/c7d78ee3-548a-4628-be41-6acf3921615a/66475af6-b005-4c43-90f9-f72a8f536bae.webp"},{"id":"2fc0c9b1-33f2-40a4-825a-4de693963996","title":"What Causes Low Water Pressure in Your Home?","slug":"what-causes-low-water-pressure","excerpt":"Learn what causes low water pressure, how to narrow down the problem, and when Lexington homeowners should call a licensed plumber for fast help today.","content":null,"date":"July 28, 2026","isoDate":"2026-07-28T05:09:30.055+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/c7d78ee3-548a-4628-be41-6acf3921615a/2fc0c9b1-33f2-40a4-825a-4de693963996.webp"},{"id":"d4a8c91c-4ec2-4983-a9ae-80efd24d5108","title":"Why Is My AC Blowing Warm Air? 8 Common Causes","slug":"why-is-my-ac-blowing-warm-air","excerpt":"Why is my AC blowing warm air? Learn common causes, safe checks, and when Lexington HVAC service can restore cool, reliable comfort fast today.","content":null,"date":"July 26, 2026","isoDate":"2026-07-26T05:39:36.7+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/c7d78ee3-548a-4628-be41-6acf3921615a/d4a8c91c-4ec2-4983-a9ae-80efd24d5108.webp"},{"id":"4ca7d342-6fe4-4868-b163-cf384af94322","title":"Best Value HVAC Contractor in Lexington, KY","slug":"best-value-hvac-contractor-lexington-ky","excerpt":"Need the best value HVAC contractor Lexington homeowners and businesses can trust? Learn how quotes, skilled work, and fast response protect your budget.","content":null,"date":"July 24, 2026","isoDate":"2026-07-24T05:36:56.876+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/c7d78ee3-548a-4628-be41-6acf3921615a/4ca7d342-6fe4-4868-b163-cf384af94322.webp"},{"id":"4851478f-2392-4de2-8df0-cd2f2d9d5d35","title":"Choosing an Industrial Electrical Contractor in Kentucky","slug":"industrial-electrical-contractor-kentucky","excerpt":"Need an industrial electrical contractor Kentucky businesses can trust? Get safe, code-ready installations, repairs, upgrades, and clear project pricing.","content":null,"date":"July 22, 2026","isoDate":"2026-07-22T06:48:20.905+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/c7d78ee3-548a-4628-be41-6acf3921615a/4851478f-2392-4de2-8df0-cd2f2d9d5d35.webp"},{"id":"86d3a4c1-7155-46b6-8659-6a3a86286211","title":"Electrical Inspection Lexington KY Warning Signs","slug":"electrical-inspection-lexington-ky-warning-signs","excerpt":"An electrical inspection in Lexington, KY finds wiring risks early, supports safer upgrades, and helps prevent unexpected home and business disruptions.","content":null,"date":"July 21, 2026","isoDate":"2026-07-21T06:54:19.924+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/c7d78ee3-548a-4628-be41-6acf3921615a/86d3a4c1-7155-46b6-8659-6a3a86286211.webp"},{"id":"5a5de3a7-40f6-40f8-948f-55e917f7574f","title":"Lighting Installation Lexington KY: Plan It Right","slug":"lighting-installation-lexington-ky","excerpt":"For lighting installation Lexington KY homeowners and businesses can trust, get safe wiring, practical design, clear pricing, and dependable results today.","content":null,"date":"July 20, 2026","isoDate":"2026-07-20T07:03:49.032+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/c7d78ee3-548a-4628-be41-6acf3921615a/5a5de3a7-40f6-40f8-948f-55e917f7574f.webp"},{"id":"aa8f9e1c-c964-4416-88d2-26fdbd47ef71","title":"Electrical Panel Upgrades in Lexington: When to Act","slug":"electrical-panel-upgrade-lexington","excerpt":"Need an electrical panel upgrade in Lexington? Learn the warning signs, capacity options, permitting needs, and why licensed work protects your property.","content":null,"date":"July 19, 2026","isoDate":"2026-07-19T07:06:43.277+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/c7d78ee3-548a-4628-be41-6acf3921615a/aa8f9e1c-c964-4416-88d2-26fdbd47ef71.webp"},{"id":"ad33b1f8-fd7b-42e4-9792-d27dab7d891d","title":"Electrician Lexington KY for Repairs and Upgrades","slug":"electrician-lexington-ky","excerpt":"Need an electrician Lexington KY property owners can count on? Get safe repairs, upgrades, lighting, and upfront pricing for homes and businesses locally.","content":null,"date":"July 18, 2026","isoDate":"2026-07-18T07:12:42.738+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/c7d78ee3-548a-4628-be41-6acf3921615a/ad33b1f8-fd7b-42e4-9792-d27dab7d891d.webp"},{"id":"740c0263-d241-4714-bded-282acfcb6686","title":"Burst Pipe Repair Lexington Homeowners Can Trust","slug":"burst-pipe-repair-lexington","excerpt":"Need burst pipe repair Lexington homeowners can count on? Shut off the water, limit damage, and get a licensed plumber there quickly, day or night.","content":null,"date":"July 17, 2026","isoDate":"2026-07-17T07:18:37.135+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/c7d78ee3-548a-4628-be41-6acf3921615a/740c0263-d241-4714-bded-282acfcb6686.webp"},{"id":"30eade5b-841e-44a5-b081-a2d4b4683d4f","title":"Commercial Plumbing Contractor Lexington Businesses Trust","slug":"commercial-plumbing-contractor-lexington","excerpt":"Choose a commercial plumbing contractor Lexington businesses can count on for repairs, fair quotes, and dependable service that keeps operations moving.","content":null,"date":"July 16, 2026","isoDate":"2026-07-16T07:24:06.733+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/c7d78ee3-548a-4628-be41-6acf3921615a/30eade5b-841e-44a5-b081-a2d4b4683d4f.webp"},{"id":"4e9a3946-aadc-4be0-bf77-2c6aede35f2c","title":"Drain Cleaning Lexington KY When Drains Back Up","slug":"drain-cleaning-lexington-ky","excerpt":"Need drain cleaning Lexington KY homeowners can trust? Learn the warning signs, what causes clogs, and when professional service protects your property.","content":null,"date":"July 15, 2026","isoDate":"2026-07-15T07:27:34.459+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/c7d78ee3-548a-4628-be41-6acf3921615a/4e9a3946-aadc-4be0-bf77-2c6aede35f2c.webp"},{"id":"1b61e9e2-d1c5-422a-8aed-c7d73bd2b715","title":"Water Heater Installation Lexington KY Guide","slug":"water-heater-installation-lexington-ky","excerpt":"For water heater installation Lexington KY homeowners can trust, choose the right system, protect your home, and get clear, fair pricing from pros today.","content":null,"date":"July 14, 2026","isoDate":"2026-07-14T07:36:26.653+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/c7d78ee3-548a-4628-be41-6acf3921615a/1b61e9e2-d1c5-422a-8aed-c7d73bd2b715.webp"},{"id":"d2e6c5a1-b777-4b9a-8088-12ee808af6cb","title":"HVAC Maintenance Plans Lexington Homeowners Need","slug":"hvac-maintenance-plans-lexington","excerpt":"HVAC maintenance plans Lexington homeowners can count on: learn what service should include, when to schedule it, and how it helps control repair costs.","content":null,"date":"July 13, 2026","isoDate":"2026-07-13T07:42:25.707+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/c7d78ee3-548a-4628-be41-6acf3921615a/d2e6c5a1-b777-4b9a-8088-12ee808af6cb.webp"},{"id":"14996220-3306-4666-a528-2b057e9e33f0","title":"When to Plan Furnace Replacement Lexington KY","slug":"furnace-replacement-lexington-ky","excerpt":"Need furnace replacement in Lexington, KY? See the warning signs, cost factors, and practical steps for choosing dependable, efficient home heat now.","content":null,"date":"July 12, 2026","isoDate":"2026-07-12T07:51:25.238+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/c7d78ee3-548a-4628-be41-6acf3921615a/14996220-3306-4666-a528-2b057e9e33f0.webp"},{"id":"d7031867-4539-4734-b9aa-9a8d01be98a0","title":"Air Conditioning Installation in Lexington","slug":"air-conditioning-installation-lexington","excerpt":"Air conditioning installation Lexington homeowners can trust starts with proper sizing, honest options, and licensed work built for Kentucky long summers.","content":null,"date":"July 11, 2026","isoDate":"2026-07-11T07:54:25.488+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/c7d78ee3-548a-4628-be41-6acf3921615a/d7031867-4539-4734-b9aa-9a8d01be98a0.webp"},{"id":"f05ba8db-68af-4f61-8a47-39bff2693928","title":"HVAC Repair Lexington KY Homeowners Trust","slug":"hvac-repair-lexington-ky-homeowners-trust","excerpt":"Need hvac repair lexington ky homeowners can count on? Learn common issues, warning signs, costs, and how to choose reliable service fast.","content":null,"date":"July 10, 2026","isoDate":"2026-07-10T11:09:37.602+00:00","image":"https://afocirmbqdxnkyescnev.supabase.co/storage/v1/object/public/featured-images/c7d78ee3-548a-4628-be41-6acf3921615a/f05ba8db-68af-4f61-8a47-39bff2693928.webp"}];
  var SORO_TOKEN = 'ecc1906a-6f77-4014-a4f6-fd8d3b39c097';
  var SORO_API_BASE = 'https://app.trysoro.com';
  var SORO_T = {"allArticles":"All Articles","backToAll":"Back to all articles","loading":"Loading article...","error":"Failed to load article. Please try again.","empty":"Published articles may take up to 60 minutes to appear here.","blogArticles":"Blog articles"};
  
  // Content cache (loaded on demand)
  var contentCache = {};
  
  // Pre-populate cache with any server-included content (for SEO deep links)
  SORO_ARTICLES.forEach(function(article) {
    if (article.content) {
      contentCache[article.id] = article.content;
    }
  });
  
  // Find the container
  var container = document.getElementById('soro-blog');
  if (!container) {
    console.error('Soro Blog: No element with id="soro-blog" found');
    return;
  }
  
  // Save the original page title so we can restore it
  var originalTitle = document.title;
  var originalDescription = '';
  var descMeta = document.querySelector('meta[name="description"]');
  if (descMeta) originalDescription = descMeta.getAttribute('content') || '';
  
  // Detect if running inside a srcdoc iframe (website builders like GoDaddy, Wix, etc.)
  var isSrcdocIframe = false;
  var parentBaseUrl = null;
  try {
    isSrcdocIframe = window.location.href === 'about:srcdoc' || 
                     window.location.pathname === '/srcdoc' ||
                     (window.self !== window.top && window.location.origin === 'null');
  } catch(e) {
    isSrcdocIframe = true; // cross-origin means we're in an iframe
  }
  
  // Try to get the parent page URL for building article links
  if (isSrcdocIframe) {
    try {
      var pUrl = new URL(window.parent.location.href);
      pUrl.searchParams.delete('post');
      parentBaseUrl = pUrl.origin + pUrl.pathname + pUrl.search;
    } catch(e) {
      parentBaseUrl = null;
    }
  }
  
  // Detect deep-linked article from URL query param: ?post=slug
  function getRequestedSlug() {
    try {
      if (isSrcdocIframe) {
        // In srcdoc iframe, check parent URL if accessible
        try {
          var params = new URLSearchParams(window.parent.location.search);
          return params.get('post') || null;
        } catch(e) {
          return null;
        }
      }
      var params = new URLSearchParams(window.location.search);
      return params.get('post') || null;
    } catch(e) {
      return null;
    }
  }
  
  // Build article URL with query param (preserves existing params)
  function getArticleUrl(slug) {
    try {
      if (isSrcdocIframe && parentBaseUrl) {
        // Build full parent page URL with ?post= param so new tab works
        var sep = parentBaseUrl.indexOf('?') !== -1 ? '&' : '?';
        return parentBaseUrl + sep + 'post=' + encodeURIComponent(slug);
      }
      if (isSrcdocIframe) {
        return '#post=' + encodeURIComponent(slug);
      }
      var url = new URL(window.location.href);
      url.searchParams.set('post', slug);
      return url.pathname + url.search;
    } catch(e) {
      return '#post=' + encodeURIComponent(slug);
    }
  }
  
  // Get the base list URL (current page without post param)
  function getListUrl() {
    try {
      if (isSrcdocIframe && parentBaseUrl) {
        return parentBaseUrl;
      }
      if (isSrcdocIframe) {
        return '#';
      }
      var url = new URL(window.location.href);
      url.searchParams.delete('post');
      var search = url.search;
      return url.pathname + (search ? search : '');
    } catch(e) {
      return window.location.pathname;
    }
  }
  
  // Safe pushState wrapper (fails silently in srcdoc iframes)
  function safePushState(state, title, url) {
    if (isSrcdocIframe) return;
    try {
      history.pushState(state, title, url);
    } catch(e) {
      // pushState not available (srcdoc iframe, cross-origin, etc.)
    }
  }
  
  // Update page meta tags for SEO (title, description, canonical, JSON-LD)
  // Skip in srcdoc iframes since we can't meaningfully update the parent page
  function updatePageMeta(article) {
    if (isSrcdocIframe) return;
    if (article) {
      // Article view: set article-specific meta
      document.title = article.title + ' | ' + SORO_BLOG_TITLE;
      
      var desc = document.querySelector('meta[name="description"]');
      if (!desc) {
        desc = document.createElement('meta');
        desc.setAttribute('name', 'description');
        document.head.appendChild(desc);
      }
      desc.setAttribute('content', article.excerpt);
      
      // Set canonical URL to the article deep link
      var canonical = document.querySelector('link[rel="canonical"][data-soro]');
      if (!canonical) {
        canonical = document.createElement('link');
        canonical.setAttribute('rel', 'canonical');
        canonical.setAttribute('data-soro', 'true');
        document.head.appendChild(canonical);
      }
      canonical.setAttribute('href', window.location.href);
      
      // JSON-LD: single BlogPosting
      injectJsonLd({
        '@context': 'https://schema.org',
        '@type': 'BlogPosting',
        'headline': article.title,
        'description': article.excerpt,
        'datePublished': article.isoDate,
        'image': article.image || undefined,
        'url': window.location.href
      });
    } else {
      // List view: restore original meta
      document.title = originalTitle;
      
      var desc = document.querySelector('meta[name="description"]');
      if (desc && originalDescription) {
        desc.setAttribute('content', originalDescription);
      }
      
      // Remove soro canonical
      var canonical = document.querySelector('link[rel="canonical"][data-soro]');
      if (canonical) canonical.remove();
      
      // JSON-LD: Blog with all articles
      var blogPosting = SORO_ARTICLES.map(function(a) {
        var item = {
          '@type': 'BlogPosting',
          'headline': a.title,
          'description': a.excerpt,
          'datePublished': a.isoDate,
          'url': window.location.origin + getArticleUrl(a.slug)
        };
        if (a.image) item.image = a.image;
        return item;
      });
      
      injectJsonLd({
        '@context': 'https://schema.org',
        '@type': 'Blog',
        'name': SORO_BLOG_TITLE,
        'blogPost': blogPosting
      });
    }
  }
  
  // Inject styles
  var styleId = 'soro-blog-styles-light';
  if (!document.getElementById(styleId)) {
    var style = document.createElement('style');
    style.id = styleId;
    style.textContent = `
      .soro-blog {
        font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
        max-width: 800px;
        margin: 0 auto;
        color: #1a1a1a;
        background: transparent;
      }
      .soro-blog * {
        box-sizing: border-box;
      }
      .soro-blog a {
        text-decoration: none;
        color: inherit;
      }
      .soro-blog-header {
        display: none;
        align-items: center;
        margin-bottom: 16px;
      }
      .soro-blog-back {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        background: transparent;
        border: 1px solid #e5e5e5;
        color: #666;
        cursor: pointer;
        font-size: 14px;
        padding: 8px 16px;
        border-radius: 6px;
        transition: background 0.2s, border-color 0.2s;
        text-decoration: none;
      }
      .soro-blog-back:hover {
        background: #f5f5f5;
        border-color: #d0d0d0;
      }
      .soro-blog-list {
        display: flex;
        flex-direction: column;
        gap: 24px;
      }
      .soro-blog-card {
        display: flex;
        gap: 20px;
        padding: 20px;
        background: transparent;
        border: 1px solid #e5e5e5;
        border-radius: 12px;
        cursor: pointer;
        transition: box-shadow 0.2s, border-color 0.2s;
        text-decoration: none;
        color: inherit;
      }
      .soro-blog-card:hover {
        box-shadow: 0 4px 12px rgba(0,0,0,0.08);
        border-color: #d0d0d0;
      }
      .soro-blog-card-image {
        width: 140px;
        height: 100px;
        object-fit: cover;
        border-radius: 8px;
        flex-shrink: 0;
      }
      .soro-blog-card-content {
        flex: 1;
        min-width: 0;
      }
      .soro-blog-card-title {
        font-size: 18px;
        font-weight: 600;
        margin: 0 0 8px 0;
        line-height: 1.3;
        color: #1a1a1a;
      }
      h2.soro-blog-card-title {
        font-size: 18px;
      }
      .soro-blog-card-excerpt {
        font-size: 14px;
        color: #666;
        margin: 0 0 12px 0;
        line-height: 1.5;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
      }
      .soro-blog-card-date {
        font-size: 12px;
        color: #999;
      }
      .soro-blog-article {
        display: none;
      }
      .soro-blog-article.visible {
        display: block;
      }
      .soro-blog-article-title {
        font-size: 32px;
        font-weight: 700;
        margin: 0 0 12px 0;
        line-height: 1.2;
        color: #1a1a1a;
      }
      .soro-blog-article-date {
        font-size: 14px;
        color: #666;
        margin-bottom: 24px;
      }
      .soro-blog-article-image {
        width: 100%;
        max-height: 400px;
        object-fit: cover;
        border-radius: 12px;
        margin-bottom: 24px;
      }
      .soro-blog-article-content {
        font-size: 16px;
        line-height: 1.7;
        color: #1a1a1a;
      }
      .soro-blog-article-content h1,
      .soro-blog-article-content h2,
      .soro-blog-article-content h3 {
        margin-top: 32px;
        margin-bottom: 16px;
        line-height: 1.3;
        color: #1a1a1a;
      }
      .soro-blog-article-content h2 {
        font-size: 24px;
      }
      .soro-blog-article-content h3 {
        font-size: 20px;
      }
      .soro-blog-article-content p {
        margin: 0 0 16px 0;
      }
      .soro-blog-article-content ul,
      .soro-blog-article-content ol {
        margin: 0 0 16px 0;
        padding-left: 24px;
        padding-right: 0;
      }
      .soro-blog-article-content li {
        margin-bottom: 8px;
      }
      .soro-blog-article-content a {
        color: #0066cc;
      }
      .soro-blog-article-content img {
        max-width: 100%;
        height: auto;
        border-radius: 8px;
      }
      .soro-blog-empty {
        text-align: center;
        padding: 48px 24px;
        color: #666;
      }
      .soro-blog-loading {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 48px 24px;
        color: #666;
      }
      .soro-blog-spinner {
        width: 24px;
        height: 24px;
        border: 2px solid #e5e5e5;
        border-top-color: #1a1a1a;
        border-radius: 50%;
        animation: soro-spin 0.8s linear infinite;
        margin-right: 12px;
      }
      @keyframes soro-spin {
        to { transform: rotate(360deg); }
      }
      .soro-blog-error {
        text-align: center;
        padding: 48px 24px;
        color: #dc2626;
      }
      @media (max-width: 600px) {
        .soro-blog-card {
          flex-direction: column;
          gap: 12px;
        }
        .soro-blog-card-image {
          width: 100%;
          height: 180px;
        }
        .soro-blog-article-title {
          font-size: 24px;
        }
      }
    `;
    document.head.appendChild(style);
  }
  
  // Inject or update JSON-LD structured data
  function injectJsonLd(data) {
    var jsonLdId = 'soro-blog-jsonld';
    var existing = document.getElementById(jsonLdId);
    if (existing) existing.remove();
    
    var script = document.createElement('script');
    script.id = jsonLdId;
    script.type = 'application/ld+json';
    script.textContent = JSON.stringify(data);
    document.head.appendChild(script);
  }
  
  // State
  var currentView = 'list';
  var currentArticle = null;
  var isLoading = false;
  
  // Fetch article content on demand
  function fetchArticleContent(articleId, callback) {
    // Check cache first (includes server-pre-rendered content for deep links)
    if (contentCache[articleId]) {
      callback(null, contentCache[articleId]);
      return;
    }
    
    var url = SORO_API_BASE + '/api/embed/' + SORO_TOKEN + '/article/' + articleId;
    
    fetch(url)
      .then(function(response) {
        if (!response.ok) throw new Error('Failed to load article');
        return response.json();
      })
      .then(function(data) {
        contentCache[articleId] = data.content;
        callback(null, data.content);
      })
      .catch(function(error) {
        callback(error, null);
      });
  }
  
  // Render article list — cards are real <a> links for SEO crawlability
  function renderList() {
    if (SORO_ARTICLES.length === 0) {
      return '<div class="soro-blog-empty"><p>' + SORO_T.empty + '</p></div>';
    }
    
    var html = '<section class="soro-blog-list" role="feed" aria-label="' + SORO_T.blogArticles + '">';
    SORO_ARTICLES.forEach(function(article) {
      var articleUrl = getArticleUrl(article.slug);
      var targetAttr = isSrcdocIframe ? ' target="_blank" rel="noopener"' : '';
      html += '<a href="' + articleUrl + '"' + targetAttr + ' class="soro-blog-card" data-slug="' + escapeHtml(article.slug) + '" itemscope itemtype="https://schema.org/BlogPosting">';
      if (article.image) {
        html += '<img class="soro-blog-card-image" src="' + article.image + '" alt="' + escapeHtml(article.title) + '" loading="lazy" itemprop="image">';
      }
      html += '<div class="soro-blog-card-content">';
      html += '<h2 class="soro-blog-card-title" itemprop="headline">' + escapeHtml(article.title) + '</h2>';
      html += '<p class="soro-blog-card-excerpt" itemprop="description">' + escapeHtml(article.excerpt) + '</p>';
      html += '<time class="soro-blog-card-date" datetime="' + article.isoDate + '" itemprop="datePublished">' + article.date + '</time>';
      html += '</div></a>';
    });
    html += '</section>';
    return html;
  }
  
  function renderArticle(article, content) {
    var html = '<article class="soro-blog-article visible" itemscope itemtype="https://schema.org/BlogPosting">';
    html += '<header>';
    html += '<h1 class="soro-blog-article-title" itemprop="headline">' + escapeHtml(article.title) + '</h1>';
    html += '<time class="soro-blog-article-date" datetime="' + article.isoDate + '" itemprop="datePublished">' + article.date + '</time>';
    html += '</header>';
    if (article.image) {
      html += '<img class="soro-blog-article-image" src="' + article.image + '" alt="' + escapeHtml(article.title) + '" itemprop="image">';
    }
    html += '<div class="soro-blog-article-content" itemprop="articleBody">' + content + '</div>';
    html += '</article>';
    return html;
  }
  
  function renderLoading() {
    return '<div class="soro-blog-loading"><div class="soro-blog-spinner"></div>' + SORO_T.loading + '</div>';
  }
  
  function renderError() {
    return '<div class="soro-blog-error"><p>' + SORO_T.error + '</p></div>';
  }
  
  function escapeHtml(str) {
    var div = document.createElement('div');
    div.textContent = str;
    return div.innerHTML;
  }
  
  // Make all links inside article content open in a new tab
  // This is critical for embeds running on external sites or inside iframes
  function processContentLinks(parentEl) {
    var links = parentEl.querySelectorAll('.soro-blog-article-content a');
    for (var i = 0; i < links.length; i++) {
      links[i].setAttribute('target', '_blank');
      links[i].setAttribute('rel', 'noopener noreferrer');
    }
  }
  
  // Navigate to article view (updates URL without full reload)
  function showArticle(slug) {
    var article = null;
    for (var i = 0; i < SORO_ARTICLES.length; i++) {
      if (SORO_ARTICLES[i].slug === slug) {
        article = SORO_ARTICLES[i];
        break;
      }
    }
    if (!article) {
      // Unknown slug (deleted or unpublished article) — show the list instead of a blank widget
      showList();
      return;
    }

    currentArticle = article;
    currentView = 'article';
    
    // Update URL (pushState so back button works)
    var articleUrl = getArticleUrl(slug);
    if (!isSrcdocIframe && window.location.pathname + window.location.search !== articleUrl) {
      safePushState({ post: slug }, '', articleUrl);
    }
    
    // Update page meta for SEO
    updatePageMeta(article);
    
    var header = container.querySelector('.soro-blog-header');
    var content = container.querySelector('.soro-blog-content');
    header.style.display = 'flex';
    
    // Check if content is already available (pre-rendered or cached)
    if (contentCache[article.id]) {
      content.innerHTML = renderArticle(article, contentCache[article.id]);
      processContentLinks(content);
    } else {
      // Show loading, then fetch
      isLoading = true;
      content.innerHTML = renderLoading();
      
      fetchArticleContent(article.id, function(error, articleContent) {
        isLoading = false;
        if (error) {
          content.innerHTML = renderError();
        } else {
          content.innerHTML = renderArticle(article, articleContent);
          processContentLinks(content);
        }
      });
    }
    
    container.scrollIntoView({ behavior: 'smooth', block: 'start' });
  }
  
  // Navigate to list view
  function showList() {
    currentView = 'list';
    currentArticle = null;
    isLoading = false;
    
    // Update URL
    var listUrl = getListUrl();
    if (!isSrcdocIframe && window.location.pathname + window.location.search !== listUrl) {
      safePushState({ post: null }, '', listUrl);
    }
    
    // Restore page meta
    updatePageMeta(null);
    
    var header = container.querySelector('.soro-blog-header');
    var content = container.querySelector('.soro-blog-content');
    header.style.display = 'none';
    content.innerHTML = renderList();
    
    // Intercept card link clicks
    var cards = content.querySelectorAll('.soro-blog-card');
    cards.forEach(function(card) {
      card.addEventListener('click', function(e) {
        e.preventDefault();
        var slug = card.getAttribute('data-slug');
        if (isSrcdocIframe) {
          // In srcdoc iframe, open article in a new tab with real URL
          var url = getArticleUrl(slug);
          window.open(url, '_blank');
        } else {
          showArticle(slug);
        }
      });
    });
  }
  
  // Handle browser back/forward buttons (not applicable in srcdoc iframes)
  if (!isSrcdocIframe) {
    window.addEventListener('popstate', function(e) {
      var slug = getRequestedSlug();
      if (slug) {
        showArticle(slug);
      } else {
        showList();
      }
    });
  }
  
  // Initial render
  var backArrow = '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M19 12H5M12 19l-7-7 7-7"/></svg>';
  container.innerHTML = '<div class="soro-blog">' +
    '<div class="soro-blog-header" style="display: none;">' +
      '<a href="' + getListUrl() + '" class="soro-blog-back" aria-label="' + SORO_T.backToAll + '">' +
        backArrow +
        SORO_T.allArticles +
      '</a>' +
    '</div>' +
    '<div class="soro-blog-content"></div>' +
  '</div>';
  
  // Add back button handler (intercept for SPA navigation)
  container.querySelector('.soro-blog-back').addEventListener('click', function(e) {
    e.preventDefault();
    showList();
  });
  
  // Check if URL has a deep-linked article on initial load
  var initialSlug = getRequestedSlug();
  if (initialSlug) {
    showArticle(initialSlug);
  } else {
    showList();
  }
})();