import{j as e}from"./vendor-query-DoyCFZ4O.js";import{r as o,L as m}from"./vendor-react-Rhy2aEWQ.js";import{u as S,d as C,S as _}from"./index-CwDwxmPI.js";import{m as c}from"./vendor-motion-D3eh3-LB.js";import{z as L,ah as P,aL as h,C as A,M as $,B,S as M,c as R,m as v,n as w,e as u}from"./vendor-utils-BOMyae96.js";const k=[{id:"all",label:"All Posts",icon:h},{id:"web",label:"Web & Software",icon:A,keywords:["web","react","next","software","frontend","backend","api","development","ecommerce","app"]},{id:"marketing",label:"Marketing",icon:$,keywords:["seo","marketing","ads","social media","growth","brand","content","email"]},{id:"ai",label:"AI & Automation",icon:B,keywords:["ai","chatbot","automation","machine learning","gpt","artificial intelligence","nlp"]},{id:"it",label:"IT & Security",icon:M,keywords:["cloud","devops","security","infrastructure","server","docker","kubernetes","cyber","monitor"]},{id:"strategy",label:"Strategy",icon:R,keywords:["strategy","consulting","digital transformation","business","cto","leadership","planning"]}];function z(t){const n=`${t.title} ${t.excerpt||""} ${t.content}`.toLowerCase(),x=k.filter(r=>{var d;return r.id!=="all"&&((d=r.keywords)==null?void 0:d.some(i=>n.includes(i)))}).map(r=>r.id);return x.length>0?x:["all"]}function N(t){const n=t.replace(/<[^>]*>/g,"").split(/\s+/).length;return Math.max(1,Math.ceil(n/200))}const D={hidden:{},visible:{transition:{staggerChildren:.06}}},E={hidden:{opacity:0,y:20},visible:{opacity:1,y:0,transition:{duration:.45,ease:[.25,.46,.45,.94]}}};function Q(){const{t}=S("blog"),[n,x]=o.useState([]),[r,d]=o.useState(!0),[i,b]=o.useState("all"),[l,f]=o.useState("");o.useEffect(()=>{C.get("/public/blog").then(a=>{x(a.data),d(!1)}).catch(()=>d(!1))},[]);const g=n.filter(a=>{const p=i==="all"||z(a).includes(i),y=!l||a.title.toLowerCase().includes(l.toLowerCase())||(a.excerpt||"").toLowerCase().includes(l.toLowerCase());return p&&y}),s=g[0],j=g.slice(1);return e.jsxs("div",{className:"min-h-screen bg-white pt-20",children:[e.jsx(_,{title:t("blog.title"),description:t("blog.description"),canonical:"/blog"}),e.jsxs("section",{className:"relative py-24 lg:py-32 overflow-hidden",children:[e.jsx("div",{className:"absolute inset-0 bg-[radial-gradient(ellipse_80%_50%_at_50%_-20%,rgba(99,102,241,0.08),transparent)]"}),e.jsx("div",{className:"absolute inset-0 bg-[linear-gradient(rgba(0,0,0,0.02)_1px,transparent_1px),linear-gradient(90deg,rgba(0,0,0,0.02)_1px,transparent_1px)] bg-[size:72px_72px]"}),e.jsx("div",{className:"relative max-w-5xl mx-auto px-4 sm:px-6 lg:px-8 text-center",children:e.jsxs(c.div,{initial:{opacity:0,y:30},animate:{opacity:1,y:0},transition:{duration:.7,ease:[.25,.46,.45,.94]},children:[e.jsxs("div",{className:"inline-flex items-center gap-2.5 px-5 py-2.5 bg-white border border-dark-100 rounded-full shadow-sm mb-10",children:[e.jsx(L,{className:"w-3.5 h-3.5 text-primary-500"}),e.jsx("span",{className:"text-xs font-semibold text-dark-600 tracking-widest uppercase",children:t("hero.badge")})]}),e.jsxs("h1",{className:"text-4xl sm:text-5xl lg:text-[3.5rem] font-bold text-dark-900 leading-[1.08] tracking-tight",children:[t("hero.heading")," ",e.jsx("span",{className:"bg-gradient-to-r from-primary-600 via-blue-600 to-violet-600 bg-clip-text text-transparent",children:t("hero.headingHighlight")})]}),e.jsx("p",{className:"mt-6 text-lg text-dark-500 max-w-2xl mx-auto leading-relaxed",children:t("hero.description")}),e.jsxs("div",{className:"mt-10 max-w-md mx-auto relative",children:[e.jsx(P,{className:"absolute left-4 top-1/2 -translate-y-1/2 w-4.5 h-4.5 text-dark-300"}),e.jsx("input",{type:"text",placeholder:t("hero.searchPlaceholder"),value:l,onChange:a=>f(a.target.value),className:"w-full pl-11 pr-4 py-3.5 bg-white border border-dark-200 rounded-xl text-sm text-dark-900 placeholder:text-dark-400 focus:outline-none focus:ring-2 focus:ring-primary-500/20 focus:border-primary-300 transition-all shadow-sm"})]})]})})]}),e.jsx("section",{className:"border-b border-dark-100 bg-white sticky top-[80px] z-20",children:e.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:e.jsx("div",{className:"flex gap-1 overflow-x-auto py-3 scrollbar-hide",children:k.map(a=>{const p=i===a.id;return e.jsxs("button",{onClick:()=>b(a.id),className:`inline-flex items-center gap-2 px-4 py-2 rounded-lg text-sm font-semibold whitespace-nowrap transition-all duration-200 ${p?"bg-dark-900 text-white shadow-sm":"text-dark-500 hover:bg-dark-50 hover:text-dark-700"}`,children:[e.jsx(a.icon,{className:"w-3.5 h-3.5"}),t(`categories.${a.id}`)]},a.id)})})})}),e.jsx("section",{className:"py-16 lg:py-20",children:e.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:r?e.jsx("div",{className:"space-y-8",children:e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8",children:[e.jsxs("div",{className:"bg-white rounded-2xl border border-dark-100 overflow-hidden animate-pulse",children:[e.jsx("div",{className:"aspect-[16/10] bg-dark-100"}),e.jsxs("div",{className:"p-8 space-y-4",children:[e.jsx("div",{className:"h-4 bg-dark-100 rounded w-1/4"}),e.jsx("div",{className:"h-7 bg-dark-100 rounded w-3/4"}),e.jsx("div",{className:"h-4 bg-dark-50 rounded w-full"})]})]}),e.jsx("div",{className:"space-y-6",children:[1,2,3].map(a=>e.jsxs("div",{className:"flex gap-5 animate-pulse",children:[e.jsx("div",{className:"w-32 h-24 bg-dark-100 rounded-xl shrink-0"}),e.jsxs("div",{className:"flex-1 space-y-3 py-1",children:[e.jsx("div",{className:"h-3 bg-dark-100 rounded w-1/3"}),e.jsx("div",{className:"h-5 bg-dark-100 rounded w-3/4"}),e.jsx("div",{className:"h-3 bg-dark-50 rounded w-full"})]})]},a))})]})}):g.length===0?e.jsxs("div",{className:"text-center py-20",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(h,{className:"w-7 h-7 text-dark-300"})}),e.jsx("h3",{className:"text-xl font-bold text-dark-900 mb-2",children:t("emptyState.heading")}),e.jsx("p",{className:"text-dark-500 text-sm",children:t(l?"emptyState.noResults":"emptyState.noCategory")}),(l||i!=="all")&&e.jsx("button",{onClick:()=>{f(""),b("all")},className:"mt-4 text-sm font-semibold text-primary-600 hover:text-primary-700",children:t("emptyState.clearFilters")})]}):e.jsxs("div",{className:"space-y-16",children:[s&&e.jsx(c.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5},children:e.jsxs(m,{to:`/blog/${s.slug}`,className:"group grid grid-cols-1 lg:grid-cols-2 gap-8 bg-white rounded-2xl border border-dark-100 overflow-hidden hover:shadow-xl hover:shadow-dark-900/[0.04] hover:border-dark-200 transition-all duration-300",children:[s.thumbnail_url?e.jsx("div",{className:"aspect-[16/10] lg:aspect-auto bg-dark-100 overflow-hidden",children:e.jsx("img",{src:s.thumbnail_url,alt:s.title,className:"w-full h-full object-cover group-hover:scale-[1.03] transition-transform duration-500"})}):e.jsx("div",{className:"aspect-[16/10] lg:aspect-auto bg-gradient-to-br from-dark-50 to-dark-100 flex items-center justify-center",children:e.jsx(h,{className:"w-16 h-16 text-dark-200"})}),e.jsxs("div",{className:"flex flex-col justify-center p-8 lg:pr-10",children:[e.jsxs("div",{className:"flex items-center gap-3 text-xs text-dark-400 mb-4",children:[e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(v,{className:"w-3 h-3"}),new Date(s.published_at||s.created_at).toLocaleDateString("en-GB",{day:"numeric",month:"short",year:"numeric"})]}),e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(w,{className:"w-3 h-3"}),N(s.content)," ",t("post.minRead")]})]}),e.jsx("h2",{className:"text-2xl lg:text-3xl font-bold text-dark-900 group-hover:text-primary-600 transition-colors leading-tight line-clamp-3",children:s.title}),e.jsx("p",{className:"mt-4 text-dark-500 text-[15px] leading-relaxed line-clamp-3",children:s.excerpt||s.content.replace(/<[^>]*>/g,"").substring(0,200)}),e.jsxs("div",{className:"mt-6 inline-flex items-center gap-2 text-sm font-semibold text-primary-600 group-hover:gap-3 transition-all",children:[t("post.readArticle")," ",e.jsx(u,{className:"w-4 h-4"})]})]})]})}),j.length>0&&e.jsx(c.div,{variants:D,initial:"hidden",whileInView:"visible",viewport:{once:!0},className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:j.map(a=>e.jsx(c.div,{variants:E,children:e.jsxs(m,{to:`/blog/${a.slug}`,className:"group flex flex-col bg-white rounded-2xl border border-dark-100 overflow-hidden hover:shadow-lg hover:shadow-dark-900/[0.04] hover:border-dark-200 transition-all duration-300 h-full",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(h,{className:"w-10 h-10 text-dark-200"})}),e.jsxs("div",{className:"flex flex-col flex-1 p-6",children:[e.jsxs("div",{className:"flex items-center gap-3 text-xs text-dark-400 mb-3",children:[e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(v,{className:"w-3 h-3"}),new Date(a.published_at||a.created_at).toLocaleDateString("en-GB",{day:"numeric",month:"short",year:"numeric"})]}),e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(w,{className:"w-3 h-3"}),N(a.content)," ",t("post.minRead")]})]}),e.jsx("h3",{className:"text-lg font-bold text-dark-900 group-hover:text-primary-600 transition-colors line-clamp-2 leading-snug",children:a.title}),e.jsx("p",{className:"mt-2.5 text-dark-500 text-sm leading-relaxed line-clamp-2 flex-1",children:a.excerpt||a.content.replace(/<[^>]*>/g,"").substring(0,150)}),e.jsxs("div",{className:"mt-5 inline-flex items-center gap-2 text-sm font-semibold text-primary-600",children:[t("post.readMore")," ",e.jsx(u,{className:"w-3.5 h-3.5 group-hover:translate-x-1 transition-transform"})]})]})]})},a.id))})]})})}),e.jsx("section",{className:"py-20 bg-dark-50/40",children:e.jsx("div",{className:"max-w-3xl mx-auto px-4 sm:px-6 lg:px-8 text-center",children:e.jsxs(c.div,{initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},children:[e.jsx("h2",{className:"text-2xl sm:text-3xl font-bold text-dark-900",children:t("cta.heading")}),e.jsx("p",{className:"mt-4 text-dark-500 max-w-xl mx-auto leading-relaxed",children:t("cta.description")}),e.jsxs("div",{className:"mt-8 flex flex-col sm:flex-row items-center justify-center gap-3",children:[e.jsxs(m,{to:"/contact",className:"group inline-flex items-center gap-2.5 px-7 py-3.5 bg-dark-900 text-white font-semibold rounded-xl hover:bg-dark-800 transition-all shadow-lg shadow-dark-900/10",children:[t("cta.startProject"),e.jsx(u,{className:"w-4 h-4 group-hover:translate-x-0.5 transition-transform"})]}),e.jsx(m,{to:"/services",className:"inline-flex items-center gap-2 px-7 py-3.5 bg-white text-dark-700 font-semibold rounded-xl border border-dark-200 hover:border-dark-300 hover:bg-dark-50/80 transition-all",children:t("cta.exploreServices")})]})]})})})]})}export{Q as default};