1import{r as l,y as L,j as e,S as T,N as D,B as H,k as M,X as N,L as w,a4 as $,d as F,h as O,F as I}from"./index-CzMEFmtw.js";import{T as R}from"./trending-up-BfxTzfPQ.js";const A=r=>r.split(" ").map(m=>m[0]).join("").slice(0,2),S=r=>`${Math.max(3,Math.ceil(((r==null?void 0:r.length)??400)/200))} min read`,u=["linear-gradient(135deg, #FDE68A 0%, #F9A01B 100%)","linear-gradient(135deg, #C7F5FF 0%, #2CC5F4 100%)","linear-gradient(135deg, #FFE1E1 0%, #FF9A9E 100%)","linear-gradient(135deg, #D1FAE5 0%, #10B981 100%)","linear-gradient(135deg, #E0E7FF 0%, #6366F1 100%)"],P=()=>{const[r,m]=l.useState([]),[k,_]=l.useState(!0),[i,f]=l.useState("All"),[c,b]=l.useState([]),[o,h]=l.useState("");l.useEffect(()=>{(async()=>{const{data:t}=await L.from("blog_posts").select("id,title,slug,excerpt,cover_image_url,published_at,tags,category:blog_categories(name,slug),author:blog_authors(name,avatar_url)").eq("status","published").lte("published_at",new Date().toISOString()).order("published_at",{ascending:!1});m(t??[]),_(!1)})()},[]);const C=l.useMemo(()=>{const t=new Set;return r.forEach(a=>{var n;return((n=a.category)==null?void 0:n.name)&&t.add(a.category.name)}),["All",...Array.from(t)]},[r]),y=l.useMemo(()=>Array.from(new Set(r.flatMap(t=>t.tags??[]))).sort(),[r]),B=t=>b(a=>a.includes(t)?a.filter(n=>n!==t):[...a,t]),z=()=>{f("All"),b([]),h("")},x=l.useMemo(()=>{const t=o.trim().toLowerCase();return r.filter(a=>{var d,j,v;if(i!=="All"&&((d=a.category)==null?void 0:d.name)!==i||c.length&&!c.every(p=>(a.tags??[]).includes(p)))return!1;if(!t)return!0;const n=[a.title,a.excerpt,(j=a.author)==null?void 0:j.name,(v=a.category)==null?void 0:v.name,...a.tags??[]].filter(Boolean).join(" ").toLowerCase();return t.split(/\s+/).every(p=>n.includes(p))})},[r,i,c,o]),E=i!=="All"||c.length>0||o.trim().length>0,s=x[0],g=x.slice(1);return e.jsxs(e.Fragment,{children:[e.jsx(T,{title:"Healthcare Career Blog â Licensing, Training & Insights",description:"Editorial guides on DHA, MOH, DOH licensing, Prometric exams, BLS/ACLS training, German nursing, and healthcare careers in the UAE.",path:"/blog",type:"article"}),e.jsxs("div",{children:[e.jsx(D,{}),e.jsxs("main",{className:"pt-[72px] bg-white",children:[e.jsxs("section",{className:"relative overflow-hidden border-b border-gray-100",children:[e.jsx("div",{className:"absolute -top-32 -right-32 w-[520px] h-[520px] rounded-full opacity-40 blur-[120px]",style:{background:"#F9A01B"}}),e.jsx("div",{className:"absolute -bottom-40 -left-32 w-[520px] h-[520px] rounded-full opacity-30 blur-[120px]",style:{background:"#2CC5F4"}}),e.jsxs("div",{className:"relative max-w-[1320px] mx-auto px-6 md:px-10 pt-16 md:pt-24 pb-14",children:[e.jsx("div",{className:"flex items-center gap-3 mb-6",children:e.jsx("span",{className:"badge-hs",children:"The Journal"})}),e.jsxs("div",{className:"grid lg:grid-cols-12 gap-10 items-end",children:[e.jsx("div",{className:"lg:col-span-8",children:e.jsxs("h1",{className:"font-display font-extrabold text-gray-900",style:{fontSize:"clamp(40px, 6.5vw, 84px)",letterSpacing:"-2.5px",lineHeight:.98},children:["Field notes for the ",e.jsx("br",{}),e.jsx("span",{className:"text-gradient-orange italic font-serif",children:"healthcare"})," professional."]})}),e.jsxs("div",{className:"lg:col-span-4 lg:pl-8 lg:border-l lg:border-gray-200",children:[e.jsx("p",{className:"text-gray-600 text-base md:text-lg leading-relaxed",children:"Long-form guides, honest career advice, and the operational detail behind every license, exam, and relocation."}),e.jsxs("div",{className:"mt-6 flex items-center gap-6 text-xs uppercase tracking-widest font-semibold text-gray-500",children:[e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(H,{size:13})," ",r.length," Articles"]}),e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(R,{size:13})," Updated Weekly"]})]})]})]})]})]}),r.length>0&&e.jsx("section",{className:"sticky top-[100px] z-40 bg-white/95 backdrop-blur-xl border-y border-gray-100",children:e.jsxs("div",{className:"max-w-[1320px] mx-auto px-6 md:px-10 py-3 space-y-3",children:[e.jsxs("div",{className:"flex flex-col md:flex-row md:items-center gap-4 justify-between",children:[e.jsx("div",{className:"flex items-center gap-1.5 overflow-x-auto scrollbar-hide",children:C.map(t=>{const a=t==="All"?r.length:r.filter(n=>{var d;return((d=n.category)==null?void 0:d.name)===t}).length;return e.jsxs("button",{onClick:()=>f(t),className:`px-4 py-2 rounded-full text-xs font-semibold whitespace-nowrap transition-all flex items-center gap-1.5 ${i===t?"bg-gray-900 text-white":"text-gray-600 hover:bg-gray-50 border border-transparent hover:border-gray-100"}`,children:[t,e.jsx("span",{className:`text-[10px] font-mono ${i===t?"text-white/60":"text-gray-400"}`,children:a})]},t)})}),e.jsxs("div",{className:"relative max-w-xs w-full",children:[e.jsx(M,{size:15,className:"absolute left-3.5 to
1p-1/2 -translate-y-1/2 text-gray-400"}),e.jsx("input",{type:"text",value:o,onChange:t=>h(t.target.value),placeholder:"Search by title, tag, authorâ¦",className:"w-full pl-10 pr-9 py-2.5 rounded-full border border-gray-200 text-sm focus:outline-none focus:border-[#F9A01B]/60 focus:ring-2 focus:ring-[#F9A01B]/10 bg-gray-50/50 text-gray-900 placeholder:text-gray-400"}),o&&e.jsx("button",{onClick:()=>h(""),"aria-label":"Clear search",className:"absolute right-2.5 top-1/2 -translate-y-1/2 p-1 rounded-full hover:bg-gray-100 text-gray-400 hover:text-gray-700",children:e.jsx(N,{size:13})})]})]}),y.length>0&&e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("span",{className:"text-[10px] uppercase tracking-[0.2em] font-bold text-gray-400",children:"Tags"}),y.map(t=>{const a=c.includes(t);return e.jsxs("button",{onClick:()=>B(t),className:`px-2.5 py-1 rounded-md text-[11px] font-semibold transition-all ${a?"bg-[#F9A01B] text-white border border-[#F9A01B]":"bg-white text-gray-600 border border-gray-200 hover:border-[#F9A01B]/50 hover:text-gray-900"}`,children:["#",t]},t)}),E&&e.jsxs("div",{className:"ml-auto flex items-center gap-3",children:[e.jsxs("span",{className:"text-xs text-gray-500",children:[e.jsx("span",{className:"font-bold text-gray-900",children:x.length})," ",x.length===1?"result":"results"]}),e.jsxs("button",{onClick:z,className:"text-[11px] font-semibold text-gray-500 hover:text-[#F9A01B] flex items-center gap-1",children:[e.jsx(N,{size:12})," Clear"]})]})]})]})}),!k&&r.length===0&&e.jsx("section",{className:"py-24 text-center",children:e.jsx("p",{className:"text-sm text-gray-500",children:"New stories are on the way. Check back soon."})}),s&&e.jsx("section",{className:"py-16 md:py-20",children:e.jsx("div",{className:"max-w-[1320px] mx-auto px-6 md:px-10",children:e.jsxs(w,{to:`/blog/${s.slug}`,className:"group grid lg:grid-cols-2 gap-10 items-center",children:[e.jsxs("div",{className:"relative rounded-[28px] overflow-hidden aspect-[16/10] transition-transform duration-500 group-hover:scale-[1.005]",style:{background:s.cover_image_url?void 0:u[0]},children:[s.cover_image_url&&e.jsx("img",{src:s.cover_image_url,alt:s.title,className:"w-full h-full object-cover"}),e.jsx("div",{className:"absolute top-6 left-6",children:e.jsxs("span",{className:"inline-flex items-center gap-2 px-3.5 py-1.5 rounded-full bg-white/90 backdrop-blur text-[10px] font-bold uppercase tracking-[0.15em] text-gray-900",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-[#F9A01B]"})," Featured"]})})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-3 text-xs text-gray-500 mb-3",children:[s.category&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"font-semibold text-[#F9A01B] uppercase tracking-wider",children:s.category.name}),e.jsx("span",{children:"·"})]}),s.published_at&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx($,{size:12})," ",new Date(s.published_at).toLocaleDateString(void 0,{dateStyle:"medium"})]}),e.jsx("span",{children:"·"}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(F,{size:12})," ",S(s.excerpt)]})]}),e.jsx("h2",{className:"font-display font-bold text-gray-900 group-hover:text-[#F9A01B] transition-colors",style:{fontSize:"clamp(28px, 3.2vw, 44px)",letterSpacing:"-1.2px",lineHeight:1.08},children:s.title}),s.excerpt&&e.jsx("p",{className:"text-gray-600 mt-4 text-lg leading-relaxed",children:s.excerpt}),e.jsxs("div",{className:"mt-6 flex items-center justify-between",children:[s.author&&e.jsxs("div",{className:"flex items-center gap-3",children:[s.author.avatar_url?e.jsx("img",{src:s.author.avatar_url,className:"w-10 h-10 rounded-full object-cover",alt:`${s.author.name} avatar`,loading:"lazy",decoding:"async"}):e.jsx("div",{className:"w-10 h-10 rounded-full bg-gradient-to-br from-[#F9A01B] to-[#2CC5F4] text-white text-xs font-bold flex items-center justify-center",children:A(s.author.name)}),e.jsx("div",{className:"text-sm font-semibold text-gray-900",children:s.author.name})]}),e.jsxs("span",{className:"text-[#F9A01B] text-sm font-semibold flex items-center gap-1.5 group-hover:gap-3 transition-all",children:["Read story ",e.jsx(O,{size:14})]})]})]})]})})}),g.length>0&&e.jsx("section",{className:"py-16 md:py-20 bg-gradient-to-b from-white to-[#FAFAF8]",children:e.jsxs("div",{className:"max-w-[1320px] mx-auto px-6 md:px-10",children:[e.jsxs("div",{className:"flex items-end justify-between mb-12 pb-6 border-b-2 border-gray-900",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-[11px] font-bold uppercase tracking-[0.3em] text-gray-500 mb-3",children:"The Archive"}),e.jsx("h2",{className:"font-display font-extrabold text-gray-900",style:{fontSize:"clamp(28px, 3vw, 42px)",letterSpacing:"-1px"},children:"Latest stories"})]}),e.jsxs("div",{className:"text-xs uppercase tracking-widest font-semibold text-gray-500 hidden md:block",children:[g.length," ",g.length===1?"article":"articles"]})]}),e.jsx("div",{className:"grid md:grid-cols-2 lg:grid-cols-3 gap-x-8 gap-y-14",children:g.map((t,a)=>e.jsxs(w,{to:`/blog/${t.slug}`,className:"group cursor-pointer",children:[e.jsxs("div",{className:"relative rounded-2xl overflow-hidden aspect-[4/3] mb-5 transition-transform duration-500 group-hover:-translate-y-1",style:{background:t.cover_image_url?void 0:u[(a+1)%u.length]},children:[t.cover_image_url&&e.jsx("img",{src:t.cover_image_url,alt:t.title,className:"w-full h-full object-cover"}),t.category&&e.jsx("div",{className:"absolute top-4 left-4",children:e.jsx("span",{className:"text-[10px] font-bold uppercase tracking-[0.15em] text-gray-900/80 bg-white/80 backdrop-blur px-2.5 py-1 rounded-full",children:t.category.name})})]}),e.jsxs("div",{className:"flex items-center gap-2 text-[11px] text-gray-500 mb-2",children:[t.published_at&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:new Date(t.published_at).toLocaleDateString(void 0,{dateStyle:"medium"})}),e.jsx("span",{children:"·"})]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(F,{size:11})," ",S(t.excerpt)]})]}),e.jsx("h3",{className:"font-display font-bold text-gray-900 group-hover:text-[#F9A01B] transition-colors mb-2",style:{fontSize:"22px",letterSpacing:"-0.4px",lineHeight:1.2},children:t.title}),t.excerpt&&e.jsx("p",{className:"text-gray-500 text-sm leading-relaxed line-clamp-2",children:t.excerpt}),t.author&&e.jsxs("div",{className:"mt-4 flex items-center gap-2 text-xs text-gray-500",children:[e.jsx("div",{className:"w-6 h-6 rounded-full bg-gradient-to-br from-[#F9A01B] to-[#2CC5F4] text-white text-[10px] font-bold flex items-center justify-center",children:A(t.author.name)}),e.jsxs("span",{children:["By ",e.jsx("span",{className:"font-semibold text-gray-700",children:t.author.name})]})]})]},t.id))})]})})]}),e.jsx(I,{})]})]})};export{P as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.