import{b as f,r as m,j as e,H as l,a as x,B as c,L as i,A as y}from"./index-03O7FlLK.js";import{F as g}from"./Footer-CpKEhY2n.js";import{d as N,b as v}from"./useBlogArticles-DH-rjr3t.js";import{s as p}from"./prerender-ready-BtFGQ0-H.js";import{L as B,E as w}from"./loader-circle-C6aPZEby.js";import{A as C}from"./arrow-left-B4NjmvYK.js";import{C as L}from"./calendar-Ce1WMB0w.js";import{C as $}from"./clock-CzYVv4ox.js";import"./map-pin-C7uVMHt5.js";import"./useQuery-BPBYh37X.js";import"./client-DO0WN1kq.js";const A=a=>new Date(a).toLocaleDateString("pt-BR",{day:"numeric",month:"long",year:"numeric"}),D=a=>a>=1e3?`${(a/1e3).toFixed(1)}k`:a.toString(),E=({article:a})=>e.jsxs("article",{className:"bg-card rounded-xl shadow-lg overflow-hidden hover:shadow-xl transition-all duration-300 transform hover:-translate-y-1",children:[e.jsx("div",{className:"relative h-48 bg-gradient-to-br from-primary/20 to-primary/5",children:a.image_url?e.jsx("img",{src:a.image_url,alt:a.title,className:"w-full h-full object-cover",loading:"lazy"}):e.jsx("div",{className:"w-full h-full flex items-center justify-center",children:e.jsx("span",{className:"text-4xl font-bold text-primary/30",children:a.title.charAt(0)})})}),e.jsxs("div",{className:"p-6",children:[e.jsxs("div",{className:"flex items-center space-x-3 text-xs text-muted-foreground mb-3",children:[e.jsxs("div",{className:"flex items-center space-x-1",children:[e.jsx(L,{className:"w-3 h-3"}),e.jsx("span",{children:A(a.published_at)})]}),e.jsxs("div",{className:"flex items-center space-x-1",children:[e.jsx($,{className:"w-3 h-3"}),e.jsxs("span",{children:[a.read_time_minutes," min"]})]}),e.jsxs("div",{className:"flex items-center space-x-1",children:[e.jsx(w,{className:"w-3 h-3"}),e.jsx("span",{children:D(a.views)})]})]}),e.jsx("h3",{className:"text-lg font-bold text-card-foreground mb-3 line-clamp-2",children:a.title}),e.jsx("p",{className:"text-muted-foreground text-sm mb-4 line-clamp-3",children:a.excerpt}),e.jsx(c,{asChild:!0,variant:"outline",size:"sm",className:"w-full border-primary text-primary hover:bg-primary hover:text-primary-foreground",children:e.jsxs(i,{to:`/blog/${a.slug}`,children:["Ler Mais",e.jsx(y,{className:"w-3 h-3 ml-2"})]})})]})]}),V=()=>{const{categorySlug:a}=f(),{data:h,isLoading:o}=N(a||""),{data:n}=v(),{category:t,articles:r}=h||{category:null,articles:[]};m.useEffect(()=>{p(!1)},[]),m.useEffect(()=>{o||p(!0)},[o]);const d=`https://nathaliabrito.adv.br/blog/categoria/${a||""}`;if(o)return e.jsxs(e.Fragment,{children:[e.jsxs(l,{children:[e.jsx("title",{children:"Carregando categoria... | Blog Jurídico | Dra. Nathalia Brito"}),e.jsx("meta",{name:"robots",content:"noindex"}),e.jsx("link",{rel:"canonical",href:d})]}),e.jsx("div",{className:"min-h-screen bg-muted flex items-center justify-center",children:e.jsx(B,{className:"w-8 h-8 animate-spin text-primary"})})]});if(!t)return e.jsxs(e.Fragment,{children:[e.jsxs(l,{children:[e.jsx("title",{children:"Categoria não encontrada | Blog Jurídico | Dra. Nathalia Brito"}),e.jsx("meta",{name:"description",content:"A categoria solicitada não existe. Veja todos os artigos no blog."}),e.jsx("meta",{name:"robots",content:"noindex, nofollow"}),e.jsx("link",{rel:"canonical",href:d})]}),e.jsxs("div",{className:"min-h-screen bg-muted",children:[e.jsx(x,{}),e.jsxs("div",{className:"max-w-4xl mx-auto px-4 py-20 text-center",children:[e.jsx("h1",{className:"text-2xl font-bold text-foreground mb-4",children:"Categoria não encontrada"}),e.jsx("p",{className:"text-muted-foreground mb-8",children:"A categoria que você procura não existe."}),e.jsx(c,{asChild:!0,children:e.jsx(i,{to:"/blog",children:"Voltar ao Blog"})})]}),e.jsx(g,{})]})]});const u={"@context":"https://schema.org","@type":"CollectionPage",name:`${t.name} - Blog Jurídico`,description:t.description||`Artigos sobre ${t.name}. Tire suas dúvidas com a especialista Dra. Nathalia Brito.`,url:`https://nathaliabrito.adv.br/blog/categoria/${t.slug}`,inLanguage:"pt-BR",isPartOf:{"@type":"Blog",name:"Blog Jurídico - Dra. Nathalia Brito",url:"https://nathaliabrito.adv.br/blog"},mainEntity:{"@type":"ItemList",numberOfItems:r.length,itemListElement:r.map((s,b)=>({"@type":"ListItem",position:b+1,url:`https://nathaliabrito.adv.br/blog/${s.slug}`,name:s.title}))}},j={"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:[{"@type":"ListItem",position:1,name:"Home",item:"https://nathaliabrito.adv.br"},{"@type":"ListItem",position:2,name:"Blog",item:"https://nathaliabrito.adv.br/blog"},{"@type":"ListItem",position:3,name:t.name,item:`https://nathaliabrito.adv.br/blog/categoria/${t.slug}`}]};return e.jsxs(e.Fragment,{children:[e.jsxs(l,{children:[e.jsxs("title",{children:[t.name," | Blog Jurídico | Dra. Nathalia Brito"]}),e.jsx("meta",{name:"description",content:t.description||`Artigos sobre ${t.name}. Tire suas dúvidas com a especialista Dra. Nathalia Brito.`}),e.jsx("link",{rel:"canonical",href:`https://nathaliabrito.adv.br/blog/categoria/${t.slug}`}),e.jsx("meta",{property:"og:title",content:`${t.name} | Blog Jurídico`}),e.jsx("meta",{property:"og:description",content:t.description||`Artigos sobre ${t.name}. Tire suas dúvidas com a especialista Dra. Nathalia Brito.`}),e.jsx("meta",{property:"og:type",content:"website"}),e.jsx("meta",{property:"og:url",content:`https://nathaliabrito.adv.br/blog/categoria/${t.slug}`}),e.jsx("meta",{property:"og:image",content:"https://nathaliabrito.adv.br/lovable-uploads/24fb34b9-953e-4d4f-ad12-600d39278a4d.png"}),e.jsx("meta",{property:"og:locale",content:"pt_BR"}),e.jsx("meta",{name:"twitter:card",content:"summary_large_image"}),e.jsx("meta",{name:"twitter:title",content:`${t.name} | Blog Jurídico`}),e.jsx("meta",{name:"twitter:description",content:t.description||`Artigos sobre ${t.name}. Tire suas dúvidas.`}),e.jsx("meta",{name:"twitter:image",content:"https://nathaliabrito.adv.br/lovable-uploads/24fb34b9-953e-4d4f-ad12-600d39278a4d.png"}),e.jsx("script",{type:"application/ld+json",children:JSON.stringify(u)}),e.jsx("script",{type:"application/ld+json",children:JSON.stringify(j)})]}),e.jsxs("div",{className:"min-h-screen bg-muted",children:[e.jsx(x,{}),e.jsx("section",{className:"bg-gradient-to-br from-primary via-primary/90 to-primary text-primary-foreground py-12",children:e.jsxs("div",{className:"max-w-4xl mx-auto px-4 sm:px-6 lg:px-8",children:[e.jsxs(i,{to:"/blog",className:"inline-flex items-center text-primary-foreground/80 hover:text-primary-foreground mb-6 transition-colors",children:[e.jsx(C,{className:"w-4 h-4 mr-2"}),"Voltar ao Blog"]}),e.jsx("h1",{className:"text-3xl lg:text-4xl font-bold mb-4",children:t.name}),t.description&&e.jsx("p",{className:"text-xl text-primary-foreground/80",children:t.description})]})}),e.jsx("section",{className:"py-16",children:e.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:e.jsxs("div",{className:"grid lg:grid-cols-4 gap-8",children:[e.jsxs("div",{className:"lg:col-span-3",children:[e.jsxs("p",{className:"text-muted-foreground mb-8",children:[r.length," ",r.length===1?"artigo encontrado":"artigos encontrados"]}),r.length>0?e.jsx("div",{className:"grid md:grid-cols-2 gap-8",children:r.map(s=>e.jsx(E,{article:s},s.id))}):e.jsx("div",{className:"text-center py-12 bg-card rounded-xl",children:e.jsx("p",{className:"text-muted-foreground",children:"Ainda não há artigos nesta categoria."})})]}),e.jsxs("div",{className:"space-y-8",children:[n&&n.length>0&&e.jsxs("div",{className:"bg-card rounded-xl shadow-lg p-6",children:[e.jsx("h3",{className:"text-lg font-bold text-card-foreground mb-4",children:"Todas as Categorias"}),e.jsx("div",{className:"space-y-2",children:n.map(s=>e.jsx(i,{to:`/blog/categoria/${s.slug}`,className:`block py-2 px-3 rounded-lg transition-colors duration-200 ${s.slug===a?"bg-primary text-primary-foreground font-medium":"text-muted-foreground hover:text-primary hover:bg-primary/5"}`,children:s.name},s.id))})]}),e.jsxs("div",{className:"bg-gradient-to-br from-primary to-primary/80 rounded-xl p-6 text-primary-foreground",children:[e.jsx("h3",{className:"text-lg font-bold mb-4",children:"Precisa de Ajuda?"}),e.jsx("p",{className:"text-primary-foreground/80 text-sm mb-4",children:"Agende uma consulta gratuita e esclareça suas dúvidas com nossa especialista."}),e.jsx(c,{asChild:!0,className:"w-full bg-accent hover:bg-accent/90 text-accent-foreground",children:e.jsx(i,{to:"/consulta",children:"Consulta Gratuita"})})]})]})]})})}),e.jsx(g,{})]})]})};export{V as default};