import{j as e}from"./vendor-query-DoyCFZ4O.js";import{h as _,r as o,L as r}from"./vendor-react-Rhy2aEWQ.js";import{u as S,d as h,S as C}from"./index-CwDwxmPI.js";import{a as D,B as A}from"./StructuredData-DwdewzgR.js";import{C as B,M,B as T,S as L,c as R,aL as m,a0 as p,m as $,n as I,af as P,e as n,z as q,s as E}from"./vendor-utils-BOMyae96.js";import{m as g}from"./vendor-motion-D3eh3-LB.js";function b(i){const s=i.replace(/<[^>]*>/g,"").split(/\s+/).length;return Math.max(1,Math.ceil(s/200))}function z(){const{slug:i}=_(),[s,u]=o.useState(null),[d,j]=o.useState([]),[f,x]=o.useState(!0),[v,N]=o.useState(!1),{t}=S("blog"),k=[{label:t("detail.sidebarCategories.webSoftware"),icon:B,href:"/services/web-development"},{label:t("detail.sidebarCategories.marketingGrowth"),icon:M,href:"/services/marketing-growth"},{label:t("detail.sidebarCategories.aiAutomation"),icon:T,href:"/services/ai-automation"},{label:t("detail.sidebarCategories.itInfrastructure"),icon:L,href:"/services/it-infrastructure"},{label:t("detail.sidebarCategories.consultingStrategy"),icon:R,href:"/services/consulting"}],l=[{title:t("detail.promos.customWebDev.title"),description:t("detail.promos.customWebDev.desc"),href:"/services/web-development",gradient:"from-blue-600 to-indigo-600"},{title:t("detail.promos.aiAutomation.title"),description:t("detail.promos.aiAutomation.desc"),href:"/services/ai-automation",gradient:"from-violet-600 to-purple-600"},{title:t("detail.promos.digitalMarketing.title"),description:t("detail.promos.digitalMarketing.desc"),href:"/services/marketing-growth",gradient:"from-emerald-600 to-teal-600"}];if(o.useEffect(()=>{Promise.all([h.get(`/public/blog/${i}`),h.get("/public/blog")]).then(([a,w])=>{u(a.data),j(w.data.filter(y=>y.slug!==i).slice(0,4)),x(!1)}).catch(()=>{N(!0),x(!1)})},[i]),f)return e.jsx("div",{className:"min-h-screen bg-white pt-20",children:e.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-16",children:e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-[1fr_340px] gap-12",children:[e.jsxs("div",{className:"animate-pulse space-y-6",children:[e.jsx("div",{className:"h-4 bg-dark-100 rounded w-24"}),e.jsx("div",{className:"h-10 bg-dark-100 rounded w-3/4"}),e.jsx("div",{className:"h-4 bg-dark-50 rounded w-1/3"}),e.jsx("div",{className:"aspect-[16/9] bg-dark-100 rounded-2xl"}),e.jsx("div",{className:"space-y-3",children:[1,2,3,4,5,6].map(a=>e.jsx("div",{className:"h-4 bg-dark-50 rounded"},a))})]}),e.jsxs("div",{className:"space-y-6 hidden lg:block",children:[e.jsx("div",{className:"h-48 bg-dark-50 rounded-2xl animate-pulse"}),e.jsx("div",{className:"h-64 bg-dark-50 rounded-2xl animate-pulse"})]})]})})});if(v||!s)return e.jsx("div",{className:"min-h-screen bg-white pt-20 flex items-center justify-center",children:e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"w-16 h-16 rounded-2xl bg-dark-50 flex items-center justify-center mx-auto mb-5",children:e.jsx(m,{className:"w-7 h-7 text-dark-300"})}),e.jsx("h1",{className:"text-3xl font-bold text-dark-900 mb-3",children:t("detail.notFound")}),e.jsx("p",{className:"text-dark-500 mb-6",children:t("detail.notFoundDesc")}),e.jsxs(r,{to:"/blog",className:"inline-flex items-center gap-2 px-6 py-3 bg-dark-900 text-white font-semibold rounded-xl hover:bg-dark-800 transition-colors",children:[e.jsx(p,{className:"w-4 h-4"}),t("detail.backToBlog")]})]})});const c=window.location.href;return e.jsxs("div",{className:"min-h-screen bg-white pt-20",children:[e.jsx(C,{title:(s==null?void 0:s.title)||"Blog Article",description:(s==null?void 0:s.excerpt)||"Read this article from Sovran Digital.",canonical:s?`/blog/${s.slug}`:"/blog",ogImage:s==null?void 0:s.thumbnail_url}),s&&e.jsxs(e.Fragment,{children:[e.jsx(D,{title:s.title,description:s.excerpt||s.title,slug:s.slug,publishedAt:s.published_at,imageUrl:s.thumbnail_url}),e.jsx(A,{items:[{name:t("common:nav.home"),url:"https://sovrandigital.com/"},{name:t("common:nav.blog"),url:"https://sovrandigital.com/blog"},{name:s.title,url:`https://sovrandigital.com/blog/${s.slug}`}]})]}),e.jsxs("section",{className:"relative py-16 lg:py-20 overflow-hidden",children:[e.jsx("div",{className:"absolute inset-0 bg-[radial-gradient(ellipse_80%_50%_at_50%_-20%,rgba(99,102,241,0.06),transparent)]"}),e.jsx("div",{className:"relative max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:e.jsxs(g.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.6},className:"max-w-3xl",children:[e.jsxs(r,{to:"/blog",className:"inline-flex items-center gap-2 text-sm font-medium text-dark-400 hover:text-primary-600 transition-colors mb-8",children:[e.jsx(p,{className:"w-3.5 h-3.5"}),t("detail.backToBlog")]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-4 text-sm text-dark-400 mb-5",children:[e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx($,{className:"w-3.5 h-3.5"}),new Date(s.published_at||s.created_at).toLocaleDateString("en-GB",{day:"numeric",month:"long",year:"numeric"})]}),e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx(I,{className:"w-3.5 h-3.5"}),b(s.content)," ",t("detail.minRead")]})]}),e.jsx("h1",{className:"text-3xl sm:text-4xl lg:text-[2.75rem] font-bold text-dark-900 leading-[1.15] tracking-tight",children:s.title}),s.excerpt&&e.jsx("p",{className:"mt-5 text-lg text-dark-500 leading-relaxed",children:s.excerpt})]})})]}),e.jsx("section",{className:"pb-20",children:e.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-[1fr_320px] gap-12 xl:gap-16",children:[e.jsxs(g.article,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5,delay:.1},children:[s.thumbnail_url&&e.jsx("div",{className:"rounded-2xl overflow-hidden mb-10 border border-dark-100",children:e.jsx("img",{src:s.thumbnail_url,alt:s.title,className:"w-full aspect-[16/9] object-cover"})}),e.jsx("div",{className:`prose prose-lg max-w-none
prose-headings:text-dark-900 prose-headings:font-bold prose-headings:tracking-tight
prose-h2:text-2xl prose-h2:mt-12 prose-h2:mb-4
prose-h3:text-xl prose-h3:mt-8 prose-h3:mb-3
prose-p:text-dark-600 prose-p:leading-[1.8] prose-p:text-[16px]
prose-a:text-primary-600 prose-a:font-medium prose-a:no-underline hover:prose-a:underline
prose-strong:text-dark-900
prose-ul:text-dark-600 prose-ol:text-dark-600
prose-li:leading-[1.8]
prose-img:rounded-xl prose-img:border prose-img:border-dark-100
prose-blockquote:border-primary-500 prose-blockquote:bg-primary-50/30 prose-blockquote:rounded-r-xl prose-blockquote:py-1 prose-blockquote:text-dark-700
prose-code:text-primary-700 prose-code:bg-primary-50 prose-code:px-1.5 prose-code:py-0.5 prose-code:rounded prose-code:text-sm prose-code:font-medium prose-code:before:content-none prose-code:after:content-none
prose-pre:bg-dark-950 prose-pre:rounded-xl prose-pre:border prose-pre:border-dark-800`,dangerouslySetInnerHTML:{__html:s.content}}),e.jsx("div",{className:"mt-12 pt-8 border-t border-dark-100",children:e.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(P,{className:"w-4 h-4 text-dark-400"}),e.jsx("span",{className:"text-sm font-medium text-dark-500",children:t("detail.shareArticle")})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("a",{href:`https://twitter.com/intent/tweet?url=${encodeURIComponent(c)}&text=${encodeURIComponent(s.title)}`,target:"_blank",rel:"noopener noreferrer",className:"px-4 py-2 text-xs font-semibold bg-dark-50 text-dark-600 rounded-lg hover:bg-dark-100 transition-colors",children:"Twitter / X"}),e.jsx("a",{href:`https://www.linkedin.com/sharing/share-offsite/?url=${encodeURIComponent(c)}`,target:"_blank",rel:"noopener noreferrer",className:"px-4 py-2 text-xs font-semibold bg-dark-50 text-dark-600 rounded-lg hover:bg-dark-100 transition-colors",children:"LinkedIn"}),e.jsx("button",{onClick:()=>navigator.clipboard.writeText(c),className:"px-4 py-2 text-xs font-semibold bg-dark-50 text-dark-600 rounded-lg hover:bg-dark-100 transition-colors",children:t("detail.copyLink")})]})]})}),e.jsxs("div",{className:"mt-12 relative rounded-2xl overflow-hidden",children:[e.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-dark-900 via-dark-950 to-dark-900"}),e.jsx("div",{className:"absolute inset-0 bg-[radial-gradient(ellipse_at_top_right,rgba(99,102,241,0.15),transparent_60%)]"}),e.jsxs("div",{className:"relative px-8 py-10 sm:px-10 sm:py-12",children:[e.jsx("h3",{className:"text-xl sm:text-2xl font-bold text-white leading-tight",children:t("detail.ctaTitle")}),e.jsx("p",{className:"mt-3 text-dark-300 text-sm leading-relaxed max-w-lg",children:t("detail.ctaDesc")}),e.jsxs("div",{className:"mt-6 flex flex-wrap gap-3",children:[e.jsxs(r,{to:"/contact",className:"group inline-flex items-center gap-2 px-6 py-3 bg-white text-dark-900 font-bold text-sm rounded-xl hover:bg-dark-50 transition-all shadow-lg",children:[t("detail.getQuote"),e.jsx(n,{className:"w-3.5 h-3.5 group-hover:translate-x-0.5 transition-transform"})]}),e.jsx(r,{to:"/services",className:"inline-flex items-center gap-2 px-6 py-3 bg-white/5 border border-white/10 text-white font-semibold text-sm rounded-xl hover:bg-white/10 transition-all",children:t("detail.viewServices")})]})]})]})]}),e.jsxs("aside",{className:"space-y-6 lg:sticky lg:top-28 lg:self-start",children:[e.jsx("div",{className:"rounded-2xl overflow-hidden",children:e.jsxs("div",{className:`bg-gradient-to-br ${l[Math.floor(Date.now()/864e5)%l.length].gradient} p-6`,children:[e.jsx(q,{className:"w-5 h-5 text-white/70 mb-3"}),e.jsx("h3",{className:"text-lg font-bold text-white leading-snug",children:l[Math.floor(Date.now()/864e5)%l.length].title}),e.jsx("p",{className:"mt-2 text-white/80 text-sm leading-relaxed",children:l[Math.floor(Date.now()/864e5)%l.length].description}),e.jsxs(r,{to:l[Math.floor(Date.now()/864e5)%l.length].href,className:"inline-flex items-center gap-2 mt-4 text-sm font-semibold text-white hover:gap-3 transition-all",children:[t("detail.learnMore")," ",e.jsx(n,{className:"w-3.5 h-3.5"})]})]})}),e.jsxs("div",{className:"bg-white rounded-2xl border border-dark-100 p-6",children:[e.jsx("h3",{className:"text-sm font-bold text-dark-900 uppercase tracking-wider mb-4",children:t("detail.ourServices")}),e.jsx("div",{className:"space-y-1.5",children:k.map(a=>e.jsxs(r,{to:a.href,className:"group flex items-center gap-3 px-3 py-2.5 rounded-xl text-sm text-dark-600 hover:bg-dark-50 hover:text-dark-900 transition-colors",children:[e.jsx(a.icon,{className:"w-4 h-4 text-dark-400 group-hover:text-primary-500 transition-colors"}),a.label]},a.label))})]}),e.jsxs("div",{className:"bg-dark-900 rounded-2xl p-6",children:[e.jsx("h3",{className:"text-base font-bold text-white mb-2",children:t("detail.readyToStart")}),e.jsx("p",{className:"text-dark-400 text-sm leading-relaxed mb-5",children:t("detail.readyToStartDesc")}),e.jsxs(r,{to:"/contact",className:"flex items-center justify-center gap-2 w-full px-5 py-3 bg-white text-dark-900 font-bold text-sm rounded-xl hover:bg-dark-50 transition-colors",children:[t("detail.getInTouch"),e.jsx(n,{className:"w-3.5 h-3.5"})]}),e.jsx("div",{className:"mt-4 space-y-2",children:[t("detail.noObligation"),t("detail.response24h")].map(a=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(E,{className:"w-3.5 h-3.5 text-primary-400"}),e.jsx("span",{className:"text-xs text-dark-400",children:a})]},a))})]}),d.length>0&&e.jsxs("div",{className:"bg-white rounded-2xl border border-dark-100 p-6",children:[e.jsx("h3",{className:"text-sm font-bold text-dark-900 uppercase tracking-wider mb-4",children:t("detail.moreArticles")}),e.jsx("div",{className:"space-y-4",children:d.map(a=>e.jsx(r,{to:`/blog/${a.slug}`,className:"group block",children:e.jsxs("div",{className:"flex gap-3",children:[a.thumbnail_url?e.jsx("div",{className:"w-16 h-12 rounded-lg overflow-hidden shrink-0 bg-dark-100",children:e.jsx("img",{src:a.thumbnail_url,alt:a.title,className:"w-full h-full object-cover"})}):e.jsx("div",{className:"w-16 h-12 rounded-lg bg-dark-50 flex items-center justify-center shrink-0",children:e.jsx(m,{className:"w-4 h-4 text-dark-300"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("h4",{className:"text-sm font-semibold text-dark-900 group-hover:text-primary-600 transition-colors line-clamp-2 leading-snug",children:a.title}),e.jsxs("span",{className:"text-xs text-dark-400 mt-1 block",children:[b(a.content)," ",t("detail.minRead")]})]})]})},a.id))}),e.jsxs(r,{to:"/blog",className:"inline-flex items-center gap-1.5 mt-5 text-xs font-semibold text-primary-600 hover:text-primary-700 transition-colors",children:[t("detail.viewAllArticles")," ",e.jsx(n,{className:"w-3 h-3"})]})]})]})]})})}),d.length>0&&e.jsx("section",{className:"py-16 bg-dark-50/40 border-t border-dark-100",children:e.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[e.jsxs("div",{className:"flex items-center justify-between mb-10",children:[e.jsx("h2",{className:"text-2xl font-bold text-dark-900",children:t("detail.continueReading")}),e.jsxs(r,{to:"/blog",className:"inline-flex items-center gap-1.5 text-sm font-semibold text-primary-600 hover:text-primary-700 transition-colors",children:[t("detail.allArticles")," ",e.jsx(n,{className:"w-3.5 h-3.5"})]})]}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-5",children:d.map(a=>e.jsxs(r,{to:`/blog/${a.slug}`,className:"group bg-white rounded-xl border border-dark-100 overflow-hidden hover:shadow-md hover:shadow-dark-900/[0.03] hover:border-dark-200 transition-all duration-300",children:[a.thumbnail_url?e.jsx("div",{className:"aspect-[16/10] bg-dark-100 overflow-hidden",children:e.jsx("img",{src:a.thumbnail_url,alt:a.title,className:"w-full h-full object-cover group-hover:scale-[1.03] transition-transform duration-500"})}):e.jsx("div",{className:"aspect-[16/10] bg-gradient-to-br from-dark-50 to-dark-100 flex items-center justify-center",children:e.jsx(m,{className:"w-8 h-8 text-dark-200"})}),e.jsxs("div",{className:"p-5",children:[e.jsx("span",{className:"text-xs text-dark-400",children:new Date(a.published_at||a.created_at).toLocaleDateString("en-GB",{day:"numeric",month:"short",year:"numeric"})}),e.jsx("h3",{className:"mt-1.5 text-sm font-bold text-dark-900 group-hover:text-primary-600 transition-colors line-clamp-2 leading-snug",children:a.title})]})]},a.id))})]})})]})}export{z as default};