1import{r as x,j as e,P as k,l as C,H as u,L as c,B as g,F as j,y as p,J as M,A as b}from"./index-CZ_Jv48R.js";import{M as A}from"./minus-CXG4E4rh.js";import{g as $,a as z}from"./index-B_IHsW2-.js";import{A as S}from"./arrow-left-DrYUWwkH.js";import{C as q}from"./clock-B-YlH1xh.js";function B(s,t,a){return!Number.isFinite(s)||s<=0?t:Math.max(t,a?Math.floor(s):Math.round(s*2)/2)}function I(s){return s===0?"â":s<=20?"a quarter-sheet":s<=40?"a half-sheet":s<=80?"a full sheet":`${Math.ceil(s/70)} full sheets`}function h({label:s,value:t,onChange:a,min:l=0,step:i=1,integer:m=!0}){const n=d=>a(B(d,l,m));return e.jsxs("label",{className:"flex flex-col gap-1",children:[e.jsx("span",{className:"text-sm font-medium text-midnight/70",children:s}),e.jsxs("span",{className:"inline-flex items-center rounded-xl border border-midnight/15 bg-white",children:[e.jsx("button",{type:"button","aria-label":`Decrease ${s}`,onClick:()=>n(t-i),className:"p-2 text-midnight/60 hover:text-teal-700",children:e.jsx(A,{className:"h-4 w-4"})}),e.jsx("input",{type:"number",inputMode:m?"numeric":"decimal",value:t,min:l,step:i,onChange:d=>n(Number(d.target.value)),className:"w-14 border-0 bg-transparent text-center text-lg font-semibold text-midnight focus:outline-none"}),e.jsx("button",{type:"button","aria-label":`Increase ${s}`,onClick:()=>n(t+i),className:"p-2 text-midnight/60 hover:text-teal-700",children:e.jsx(k,{className:"h-4 w-4"})})]})]})}function r({value:s,label:t}){return e.jsxs("div",{className:"rounded-xl bg-cream px-4 py-3 text-center",children:[e.jsx("div",{className:"text-xl font-bold text-teal-700",children:s}),e.jsx("div",{className:"mt-0.5 text-sm text-midnight/60 leading-snug",children:t})]})}function P(){const[s,t]=x.useState(15),[a,l]=x.useState(15),[i,m]=x.useState(3),[n,d]=x.useState(!0),o=s+a,f=s*(i+1),N=Math.round(o*1.25),v=Math.ceil((s*3+a*2)/8),w=a*2;return e.jsxs("section",{className:"rounded-2xl border border-midnight/10 bg-white p-6 shadow-sm not-prose",children:[e.jsx("h3",{className:"text-lg font-semibold text-midnight",children:"Party quantity calculator"}),e.jsx("p",{className:"mt-1 mb-5 text-sm text-midnight/60",children:"Enter your crowd and we'll size the shopping list â using the same rules of thumb below."}),e.jsxs("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-4",children:[e.jsx(h,{label:"Adults",value:s,onChange:t}),e.jsx(h,{label:"Kids",value:a,onChange:l}),e.jsx(h,{label:"Hours",value:i,onChange:m,min:1,step:.5,integer:!1}),e.jsxs("label",{className:"flex flex-col gap-1",children:[e.jsx("span",{className:"text-sm font-medium text-midnight/70",children:"Serving alcohol?"}),e.jsx("button",{type:"button",onClick:()=>d(y=>!y),"aria-pressed":n,className:`h-[42px] rounded-xl border text-sm font-medium transition ${n?"border-teal-300 bg-teal-50 text-teal-800":"border-midnight/15 bg-white text-midnight/60"}`,children:n?"Yes":"No"})]})]}),e.jsxs("div",{className:"mt-6 grid grid-cols-2 gap-3 sm:grid-cols-3",children:[n&&e.jsx(r,{value:`~${Math.round(f)}`,label:"drinks"}),e.jsx(r,{value:`~${v}`,label:"large pizzas"}),e.jsx(r,{value:I(o),label:`cake (${o} slices)`}),e.jsx(r,{value:`~${N} lb`,label:"ice"}),a>0&&e.jsx(r,{value:`~${w}`,label:"juice boxes"}),e.jsx(r,{value:"lots",label:"water â more than you think"})]}),e.jsx("p",{className:"mt-4 text-xs text-midnight/50",children:"Starting points, not laws â adjust for your crowd. Buy non-perishables to the high number, perishables to the real one."})]})}function R({blocks:s}){return e.jsx("div",{className:"space-y-5",children:s.map((t,a)=>{switch(t.type){case"h2":return e.jsx("h2",{className:"text-2xl font-semibold text-midnight mt-10 mb-1",children:t.text},a);case"p":return e.jsx("p",{className:"text-lg text-midnight/80 leading-relaxed",children:t.text},a);case"ul":return e.jsx("ul",{className:"list-disc pl-6 space-y-2 text-lg text-midnight/80 leading-relaxed",children:t.items.map((l,i)=>e.jsx("li",{children:l},i))},a);case"ol":return e.jsx("ol",{className:"list-decimal pl-6 space-y-2 text-lg text-midnight/80 leading-relaxed",children:t.items.map((l,i)=>e.jsx("li",{children:l},i))},a);case"note":return e.jsx("p",{className:"border-l-4 border-teal-500 bg-teal-50 text-midnight/80 text-lg italic rounded-r-lg px-5 py-4",children:t.text},a);case"image":return e.jsxs("figure",{className:"my-2",children:[e.jsx("img",{src:t.src,alt:t.alt,loading:"lazy",className:"w-full rounded-2xl object-cover"}),t.caption&&e.jsx("figcaption",{className:"mt-2 text-center text-sm text-midnight/50",children:t.caption})]},a);case"stats":return e.jsx("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-4",children:t.items.map((l,i)=>e.jsxs("div",{className:"rounded-2xl border border-midnight/10 bg-white px-4 py-5 text-center shadow-sm",children:[e.jsx("div",{className:"text-2xl font-bold text-teal-700",children:l.value}),e.jsx("div",{className:"mt-1 text-sm text-midnight/60 leading-snug",children:l.label})]},i))},a);case"calculator":return e.jsx(P,{},a);default:return null}})})}function L(){const{slug:s}=C(),t=s?$(s):void 0;return t?e.jsxs("div",{className:"min-h-screen flex flex-col bg-cream",children:[e.jsx(u,{}),e.jsx("main",{className:"flex-1",children:e.jsxs("article",{className:"max-w-2xl mx-auto px-4 py-12 md:py-16",children:[e.jsxs(c,{href:"/guides",className:"inline-flex items-center gap-1 text-sm text-midnight/60 hover:text-teal-700 mb-8",children:[e.jsx(S,{className:"h-4 w-4"}),"All guides"]}),t.heroImage&&e.jsx("img",{src:t.heroImage.src,alt:t.heroImage.alt,className:"mb-8 aspect-[16/9] w-full rounded-2xl object-cover shadow-sm"}),e.jsx("h1",{className:"text-3xl md:text-4xl font-bold text-midnight leading-tight mb-4",children:t.title}),e.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 text-sm text-midnight/50 mb-8",children:[e.jsxs("span",{children:["By"," ",e.jsx(c,{href:"/about",className:"font-medium text-midnight/70 hover:text-teal-700",children:p.name}),", a ",p.credential]}),e.jsx("span",{"aria-hidden":"true",children:"·"}),e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(q,{className:"h-4 w-4"}),t.readingMinutes," min read"]})]}),e.jsx("p",{className:"text-xl text-midnight/80 leading-relaxed mb-8",children:t.intro}),t.keyTakeaways&&t.keyTakeaways.length>0&&e.jsxs("aside",{className:"mb-10 rounded-2xl border border-teal-100 bg-teal-50/60 p-6",children:[e.jsx("h2",{className:"mb-3 text-sm font-semibold uppercase tracking-wide text-teal-800",children:"At a glance"}),e.jsx("ul",{className:"space-y-2",children:t.keyTakeaways.map((a,l)=>e.jsxs("li",{className:"flex gap-2 leading-relaxed text-midnight/80",children:[e.jsx(M,{className:"mt-1 h-4 w-4 shrink-0 text-teal-600"}),e.jsx("span",{children:a})]},l))})]}),e.jsx(R,{blocks:t.body}),t.faq&&t.faq.length>0&&e.jsxs("section",{className:"mt-12",children:[e.jsx("h2",{className:"text-2xl font-semibold text-midnight mb-4",children:"Common questions"}),e.jsx("div",{className:"space-y-5",children:t.faq.map((a,l)=>e.jsxs("div",{children:[e.jsx("h3",{className:"font-semibold text-midnight mb-1",children:a.q}),e.jsx("p",{className:"text-midnight/80 leading-relaxed",children:a.a})]},l))})]}),e.jsxs("div",{className:"mt-12 rounded-2xl bg-white border border-midnight/10 p-6 md:p-8 text-center shadow-sm",children:[t.cta.note&&e.jsx("p",{className:"text-midnight/70 mb-4",children:t.cta.note}),e.jsx(c,{href:t.cta.href,children:e.jsxs(g,{size:"lg",className:"inline-flex items-center gap-2",children:[t.cta.label,e.jsx(b,{className:"h-4 w-4"})]})})]}),(()=>{const a=z(t.slug);return a.length===0?null:e.jsxs("section",{className:"mt-12",children:[e.jsx("h2",{className:"text-2xl font-semibold text-midnight mb-4",children:"Keep reading"}),e.jsx("ul",{className:"grid gap-3 sm:grid-cols-2",children:a.map(l
1=>e.jsx("li",{children:e.jsxs(c,{href:`/guides/${l.slug}`,className:"flex h-full items-start gap-2 rounded-xl border border-midnight/10 bg-white p-4 text-midnight/80 shadow-sm transition hover:border-teal-200 hover:text-teal-800",children:[e.jsx(b,{className:"mt-1 h-4 w-4 shrink-0 text-teal-600"}),e.jsx("span",{className:"font-medium leading-snug",children:l.title})]})},l.slug))})]})})()]})}),e.jsx(j,{})]}):e.jsxs("div",{className:"min-h-screen flex flex-col bg-cream",children:[e.jsx(u,{}),e.jsx("main",{className:"flex-1",children:e.jsxs("div",{className:"max-w-2xl mx-auto px-4 py-20 text-center",children:[e.jsx("h1",{className:"text-3xl font-bold text-midnight mb-3",children:"We couldn't find that guide"}),e.jsx("p",{className:"text-midnight/70 mb-8",children:"It may have moved or been renamed."}),e.jsx(c,{href:"/guides",children:e.jsx(g,{children:"Browse all guides"})})]})}),e.jsx(j,{})]})}export{L 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.