1import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{r as t,t as n}from"./jsx-runtime-CHjTGAoW.js";import{t as r}from"./useQuery-CwsLVCKJ.js";import{n as i,t as a}from"./arrow-up-narrow-wide-b6EJs3dX.js";import{t as o}from"./arrow-left-l9qVhSKF.js";import{t as s}from"./arrow-right-Csuo1scT.js";import{t as c}from"./book-open-JbChC78V.js";import{t as l}from"./calendar-DfxbVeA4.js";import{t as u}from"./clock-v3Q7aJ7Q.js";import{O as d,a as f,ct as p,f as m,g as h,p as g,s as _,y as v}from"./index-DXaDAQ0l.js";import{t as y}from"./format-Do9hbD5N.js";import{t as b}from"./skeleton-CIfjZeCq.js";var x=e(t(),1),S=n();function C(e,t=120){if(!e)return``;let n=e.replace(/<[^>]*>/g,``).trim();return n.length>t?n.slice(0,t)+`â¦`:n}function w(e){if(!e)return 1;let t=e.replace(/<[^>]*>/g,``).trim().split(/\s+/).length;return Math.max(1,Math.ceil(t/200))}function T(){let e=h(),[t,n]=(0,x.useState)(!0),{data:_=[],isLoading:T}=r({queryKey:[`public-blog-posts`],queryFn:async()=>{let{data:e,error:t}=await d.from(`blog_posts`).select(`id,title,slug,cover_image_url,is_public,created_at`).eq(`is_public`,!0).order(`created_at`,{ascending:!1});if(t)throw t;return e.map(e=>({...e,content:``}))}}),E=(0,x.useMemo)(()=>t?_:[..._].reverse(),[_,t]),D=E[0],O=E.slice(1);return(0,S.jsxs)(`div`,{className:`min-h-screen bg-gradient-to-b from-[hsl(var(--wedding-cream))] via-background to-[hsl(var(--wedding-blush)/0.3)]`,children:[(0,S.jsxs)(p,{children:[(0,S.jsx)(`title`,{children:`Wedding Planning Blog - Indivites`}),(0,S.jsx)(`meta`,{name:`description`,content:`Guides, ideas, and real stories for Indian wedding planning - digital invitations, RSVPs, Shagun, registries, vendors, and multi-day ceremony tips.`}),(0,S.jsx)(`link`,{rel:`canonical`,href:m(`/blog`)})]}),(0,S.jsxs)(`div`,{className:`relative overflow-hidden bg-[hsl(var(--wedding-dark))] text-[hsl(var(--primary-foreground))]`,children:[(0,S.jsx)(`div`,{className:`absolute inset-0 opacity-20 bg-[radial-gradient(circle_at_30%_50%,hsl(var(--wedding-burgundy)/0.4),transparent_70%),radial-gradient(circle_at_70%_80%,hsl(var(--wedding-rose-gold)/0.3),transparent_60%)]`}),(0,S.jsxs)(`div`,{className:`relative max-w-6xl mx-auto px-4 sm:px-6 lg:px-8 py-8 pb-14`,children:[(0,S.jsxs)(`div`,{className:`flex items-center justify-between mb-6`,children:[(0,S.jsxs)(`div`,{className:`flex items-center gap-2 cursor-pointer`,onClick:()=>e(`/`),children:[(0,S.jsx)(`img`,{src:`/favicon.png`,alt:`Indivites`,className:`w-10 h-10 rounded-xl object-contain drop-shadow-lg`,loading:`lazy`,decoding:`async`}),(0,S.jsx)(`span`,{className:`font-display text-xl font-bold text-[hsl(var(--primary-foreground))] drop-shadow-lg`,children:`Indivites`})]}),(0,S.jsxs)(v,{variant:`ghost`,size:`sm`,onClick:()=>e(`/`),className:`text-[hsl(var(--wedding-rose-gold))] hover:text-[hsl(var(--primary-foreground))] hover:bg-[hsl(var(--primary-foreground)/0.1)]`,children:[(0,S.jsx)(o,{className:`h-4 w-4 mr-1`}),` Home`]})]}),(0,S.jsxs)(`div`,{className:`flex items-center gap-3 mb-4`,children:[(0,S.jsx)(`div`,{className:`p-2.5 rounded-xl bg-[hsl(var(--wedding-burgundy)/0.3)] backdrop-blur-xs`,children:(0,S.jsx)(c,{className:`h-6 w-6 text-[hsl(var(--wedding-rose-gold))]`})}),(0,S.jsx)(`span`,{className:`text-sm font-medium tracking-widest uppercase text-[hsl(var(--wedding-rose-gold))]`,children:`Our Blog`})]}),(0,S.jsx)(`h1`,{className:`text-4xl sm:text-5xl font-display font-bold mb-3 tracking-tight`,children:`Stories & Inspiration`}),(0,S.jsx)(`p`,{className:`text-lg text-[hsl(var(--wedding-rose-gold)/0.8)] max-w-xl font-light`,children:`Tips, ideas, and heartfelt stories to help you plan the celebration of your dreams.`})]})]}),(0,S.jsxs)(`div`,{className:`max-w-6xl mx-auto px-4 sm:px-6 lg:px-8 mt-2 pb-20`,children:[(0,S.jsxs)(`div`,{className:`flex items-center justify-between mb-8 pt-4`,children:[(0,S.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:T?``:`${_.length} article${_.length===1?``:`s`}`}),(0,S.jsx)(v,{variant:`outline`,size:`sm`,onClick:()=>n(e=>!e),className:`gap-2 text-xs font-medium border-border`,children:t?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(i,{className:`h-3.5 w-3.5`}),` Latest First`]}):(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(a,{className:`h-3.5 w-3.5`}),` Oldest First`]})})]}),T?(0,S.jsxs)(`div`,{className:`space-y-8`,children:[(0,S.jsx)(`div`,{className:`rounded-2xl overflow-hidden border border-border bg-card`,children:(0,S.jsxs)(`div`,{className:`grid md:grid-cols-2`,children:[(0,S.jsx)(b,{className:`h-64 md:h-80`}),(0,S.jsxs)(`div`,{className:`p-8 space-y-4`,children:[(0,S.jsx)(b,{className:`h-4 w-24`}),(0,S.jsx)(b,{className:`h-8 w-3/4`}),(0,S.jsx)(b,{className:`h-4 w-full`}),(0,S.jsx)(b,{className:`h-4 w-2/3`})]})]})}),(0,S.jsx)(`div`,{className:`grid gap-6 sm:grid-cols-2 lg:grid-cols-3`,children:[1,2,3].map(e=>(0,S.jsxs)(`div`,{className:`rounded-xl overflow-hidden border border-border bg-card`,children:[(0,S.jsx)(b,{className:`h-48`}),(0,S.jsxs)(`div`,{className:`p-5 space-y-3`,children:[(0,S.jsx)(b,{className:`h-3 w-20`}),(0,S.jsx)(b,{className:`h-5 w-3/4`}),(0,S.jsx)(b,{className:`h-3 w-full`})]})]},e))})]}):_.length===0?(0,S.jsxs)(`div`,{className:`text-center py-24`,children:[(0,S.jsx)(`div`,{className:`inline-flex p-4 rounded-full bg-muted mb-4`,children:(0,S.jsx)(c,{className:`h-8 w-8 text-muted-foreground`})}),(0,S.jsx)(`h2`,{className:`text-xl font-semibold text-foreground mb-2`,children:`No blog posts yet`}),(0,S.jsx)(`p`,{className:`text-muted-foreground`,children:`Check back soon for stories and inspiration!`})]}):(0,S.jsxs)(`div`,{className:`space-y-10`,children:[D&&(0,S.jsx)(g,{to:`/blog/${D.slug}`,className:`group block rounded-2xl overflow-hidden border border-border bg-card shadow-[var(--shadow-card)] hover:shadow-[var(--shadow-card-hover)] transition-all duration-500`,children:(0,S.jsxs)(`div`,{className:`grid md:grid-cols-2`,children:[(0,S.jsxs)(`div`,{className:`relative overflow-hidden bg-muted aspect-[16/10] md:aspect-auto md:h-full`,children:[D.cover_image_url?(0,S.jsx)(`img`,{src:f(D.cover_image_url,{width:900,quality:75,resize:`contain`}),alt:D.title,loading:`eager`,decoding:`async`,className:`w-full h-full object-contain group-hover:scale-105 transition-transform duration-700`}):(0,S.jsx)(`div`,{className:`w-full h-full bg-gradient-to-br from-[hsl(var(--wedding-blush))] to-[hsl(var(--wedding-champagne))] flex items-center justify-center`,children:(0,S.jsx)(c,{className:`h-12 w-12 text-muted-foreground
1/40`})}),(0,S.jsx)(`div`,{className:`absolute top-4 left-4`,children:(0,S.jsx)(`span`,{className:`px-3 py-1 text-xs font-semibold tracking-wider uppercase rounded-full bg-primary text-primary-foreground shadow-xs`,children:`Featured`})})]}),(0,S.jsxs)(`div`,{className:`p-6 sm:p-8 flex flex-col justify-center`,children:[(0,S.jsxs)(`div`,{className:`flex items-center gap-4 text-xs text-muted-foreground mb-4`,children:[(0,S.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,S.jsx)(l,{className:`h-3.5 w-3.5`}),y(new Date(D.created_at),`MMMM d, yyyy`)]}),(0,S.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,S.jsx)(u,{className:`h-3.5 w-3.5`}),w(D.content),` min read`]})]}),(0,S.jsx)(`h2`,{className:`text-2xl sm:text-3xl font-display font-bold text-foreground group-hover:text-primary transition-colors duration-300 mb-3 leading-tight`,children:D.title}),(0,S.jsx)(`p`,{className:`text-muted-foreground leading-relaxed mb-6`,children:C(D.content,200)}),(0,S.jsxs)(`span`,{className:`inline-flex items-center gap-2 text-sm font-semibold text-primary group-hover:gap-3 transition-all duration-300`,children:[`Read Article `,(0,S.jsx)(s,{className:`h-4 w-4`})]})]})]})}),O.length>0&&(0,S.jsx)(`div`,{className:`grid gap-6 sm:grid-cols-2 lg:grid-cols-3`,children:O.map(e=>(0,S.jsxs)(g,{to:`/blog/${e.slug}`,className:`group flex flex-col rounded-xl overflow-hidden border border-border bg-card shadow-[var(--shadow-card)] hover:shadow-[var(--shadow-card-hover)] transition-all duration-500`,children:[(0,S.jsx)(`div`,{className:`relative overflow-hidden bg-muted aspect-[16/10]`,children:e.cover_image_url?(0,S.jsx)(`img`,{src:f(e.cover_image_url,{width:600,quality:70,resize:`contain`}),alt:e.title,loading:`lazy`,decoding:`async`,className:`w-full h-full object-contain group-hover:scale-105 transition-transform duration-700`}):(0,S.jsx)(`div`,{className:`w-full h-full bg-gradient-to-br from-[hsl(var(--wedding-blush))] to-[hsl(var(--wedding-champagne))] flex items-center justify-center`,children:(0,S.jsx)(c,{className:`h-10 w-10 text-muted-foreground/30`})})}),(0,S.jsxs)(`div`,{className:`p-5 flex flex-col flex-1`,children:[(0,S.jsxs)(`div`,{className:`flex items-center gap-3 text-xs text-muted-foreground mb-3`,children:[(0,S.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,S.jsx)(l,{className:`h-3 w-3`}),y(new Date(e.created_at),`MMM d, yyyy`)]}),(0,S.jsx)(`span`,{className:`w-1 h-1 rounded-full bg-muted-foreground/30`}),(0,S.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,S.jsx)(u,{className:`h-3 w-3`}),w(e.content),` min`]})]}),(0,S.jsx)(`h2`,{className:`text-lg font-semibold text-foreground group-hover:text-primary transition-colors duration-300 mb-2 leading-snug line-clamp-2`,children:e.title}),(0,S.jsx)(`p`,{className:`text-sm text-muted-foreground leading-relaxed mb-4 line-clamp-3 flex-1`,children:C(e.content)}),(0,S.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-xs font-semibold text-primary group-hover:gap-2.5 transition-all duration-300 mt-auto`,children:[`Read Full Story `,(0,S.jsx)(s,{className:`h-3.5 w-3.5`})]})]})]},e.id))})]})]})]})}var E=()=>(0,S.jsx)(_,{children:(0,S.jsx)(T,{})});export{E as component};
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.