import{jsx as e,jsxs as i}from"react/jsx-runtime";import{router as v}from"@inertiajs/react";import{AnimatePresence as S,motion as r}from"framer-motion";import{memo as N,useState as p,useRef as w,useCallback as z}from"react";const F=N(function({news:t,featured:n=!1,index:m=0}){const[a,u]=p(!1),[c,b]=p({x:0,y:0}),o=w(null),d=t.image?`/storage/${t.image}`:null,l=new Date(t.created_at),f=l.getDate(),x=l.toLocaleString("en-US",{month:"short"}),h=l.getFullYear(),y=z(s=>{if(s.preventDefault(),!o.current)return;const g=o.current.getBoundingClientRect();b({x:s.clientX-g.left,y:s.clientY-g.top}),u(!0),setTimeout(()=>{v.visit(`/news/${t.slug||t.id}`,{preserveScroll:!1,preserveState:!1})},450)},[t.slug,t.id]);return e(S,{mode:"wait",children:i(r.div,{ref:o,initial:{opacity:0,y:40,scale:.95},animate:a?{opacity:0,scale:1.05,y:-10}:{opacity:1,y:0,scale:1},transition:a?{duration:.4,ease:"easeInOut"}:{duration:.5,delay:m*.1,ease:"easeOut"},whileHover:{y:-5,transition:{duration:.25}},onClick:y,className:"group relative block cursor-pointer overflow-hidden rounded-xl bg-[#0a0705]",style:{minHeight:n?"280px":"240px",boxShadow:a?"0 0 40px rgba(201,168,76,0.4), 0 20px 60px rgba(0,0,0,0.8)":"0 10px 30px rgba(0,0,0,0.5)"},children:[d?e(r.div,{className:"absolute inset-0 bg-cover bg-center",style:{backgroundImage:`url(${d})`},animate:a?{scale:1.15}:{scale:1},transition:{duration:.6,ease:"easeOut"}}):e("div",{className:"absolute inset-0",style:{background:"linear-gradient(135deg, rgba(201,168,76,0.2) 0%, rgba(10,7,5,0.95) 100%)"}}),a&&e(r.div,{className:"pointer-events-none absolute z-30 rounded-full",style:{left:c.x,top:c.y,width:600,height:600,transform:"translate(-50%, -50%)",background:"radial-gradient(circle, rgba(201,168,76,0.3) 0%, rgba(201,168,76,0) 70%)"},initial:{scale:0,opacity:1},animate:{scale:1,opacity:.8},transition:{duration:.6,ease:"easeOut"}}),e(r.div,{className:"pointer-events-none absolute inset-0 z-25",style:{background:"linear-gradient(135deg, rgba(201,168,76,0.15), rgba(139,26,26,0.15))"},initial:{opacity:0},animate:{opacity:a?1:0},transition:{duration:.3}}),e("div",{className:"absolute inset-0",style:{background:"linear-gradient(180deg, rgba(10,7,5,0) 0%, rgba(10,7,5,0.3) 30%, rgba(10,7,5,0.9) 70%, rgba(10,7,5,1) 100%)"}}),i("div",{className:"absolute top-0 right-4 z-10 flex min-w-[60px] flex-col items-center justify-center rounded-b-xl px-3 shadow-[0_4px_15px_rgba(0,0,0,0.4)] transition-transform duration-300 group-hover:translate-y-1",style:{background:"linear-gradient(135deg, #7a5c1e, #c9a84c)",color:"#0a0705",height:"60px",border:"1px solid rgba(240,208,128,0.3)",borderTop:"none"},children:[i("span",{style:{fontFamily:"Cinzel, serif",fontWeight:800,fontSize:"0.85rem",lineHeight:"1",textShadow:"0 1px 2px rgba(255,255,255,0.3)"},children:[f,", ",x]}),e("span",{style:{fontFamily:"Cinzel, serif",fontWeight:800,fontSize:"0.75rem",marginTop:"4px",textShadow:"0 1px 2px rgba(255,255,255,0.3)"},children:h})]}),e("div",{className:"pointer-events-none absolute inset-0 rounded-xl opacity-0 transition-opacity duration-500 group-hover:opacity-100",style:{border:"1px solid rgba(201, 168, 76, 0.5)",boxShadow:"inset 0 0 20px rgba(201,168,76,0.1)"}}),i("div",{className:"relative z-10 flex h-full flex-col p-5",style:{minHeight:n?"280px":"240px"},children:[e("div",{className:"flex-grow"}),e("h3",{className:"mb-2 line-clamp-1 font-bold uppercase transition-colors duration-300 group-hover:text-[#fff]",style:{color:"#f0d080",fontFamily:"Cinzel Decorative, serif",fontSize:n?"1.25rem":"1.1rem",lineHeight:"1.2",letterSpacing:"0.1em",textShadow:"0 2px 10px rgba(0,0,0,0.9), 2px 2px 0 rgba(0,0,0,0.7)"},children:t.title}),e("p",{className:"mb-4 line-clamp-2 text-sm",style:{color:"#c8b89a",fontFamily:"'Rajdhani', sans-serif",fontSize:"0.9rem",lineHeight:"1.5",fontWeight:500,textShadow:"0 2px 4px rgba(0,0,0,0.8)"},children:t.description}),e("div",{className:"inline-flex items-center justify-center rounded transition-all duration-300 group-hover:shadow-[0_0_15px_rgba(192,57,43,0.4)] group-hover:brightness-110",style:{background:"linear-gradient(135deg, #8b1a1a, #c0392b)",color:"#ffffff",fontFamily:"'Rajdhani', sans-serif",fontWeight:700,fontSize:"0.85rem",letterSpacing:"0.15em",width:"fit-content",padding:"0.4rem 1.8rem",border:"1px solid rgba(192,57,43,0.5)",boxShadow:"0 4px 15px rgba(0,0,0,0.4)"},children:"READ MORE"})]})]})})});export{F as NewsCard};
