/* global React, IK */
// Real-wedding components: filterable grid + case-study deep-dive
const { useState, useMemo } = React;
function ConsentRibbon({ lang }) {
const c = window.__ikLang === "ar" ? IK.t.ar.consent : IK.t.en.consent;
return (
{c}
);
}
function WeddingCard({ w, lang, onOpen, size = "md" }) {
const ratio = size === "tall" ? "3 / 4" : size === "wide" ? "5 / 3" : "4 / 5";
return (
onOpen(w.slug)}
className="cardlift imghover"
data-screen-label={`wedding-card-${w.slug}`}
style={{
appearance: "none", background: "transparent", border: 0,
textAlign: "left", padding: 0, cursor: "pointer", color: "inherit",
display: "flex", flexDirection: "column", gap: 18,
}}
>
{w.destinationLabel[lang]} · {w.year}
{w.title[lang]}
{w.venue} · {w.functions.slice(0,3).join(" · ")}
);
}
function RealWeddingsSection({ lang, onOpen }) {
const [filter, setFilter] = useState("all");
const T = IK.t[lang];
const dests = [{ slug: "all", label: { en: "All", ar: "الكل" } }, ...IK.destinations];
const filtered = useMemo(
() => filter === "all" ? IK.weddings : IK.weddings.filter(w => w.destination === filter),
[filter]
);
return (
{T.realEyebrow}
{T.realTitle}
{T.realSub}
{/* Filter chips */}
{dests.map(d => (
setFilter(d.slug)}>
{d.label[lang]}
))}
{/* Editorial grid: irregular spans */}
{filtered.map((w, i) => {
const span = (i % 5 === 0) ? 7 : (i % 5 === 1) ? 5 : (i % 5 === 2) ? 4 : (i % 5 === 3) ? 4 : 4;
const size = span === 7 ? "wide" : span === 5 ? "tall" : "md";
return (
);
})}
);
}
// Case-study deep dive
function CaseStudy({ slug, onClose, lang }) {
const w = IK.weddings.find(x => x.slug === slug);
const [lightbox, setLightbox] = useState(null);
if (!w) return null;
const T = IK.t[lang];
return (
{/* top bar */}
{/* Hero */}
A wedding story
{w.title[lang]}
{w.destinationLabel[lang]} · {w.venue} · {w.year}
{/* Meta row */}
{[
["Destination", w.destinationLabel[lang]],
["Venue", w.venue],
["Functions", w.functions.join(" · ")],
["Guest count", w.guestBand],
].map(([k, v]) => (
{k}
{v}
))}
{/* Narrative */}
{w.excerpt[lang]} A celebration is rarely about one evening — it's about the small kindnesses
that make a week feel like one long, slow exhale. We held the calendar, the budget, the difficult
conversation about cousins; the couple held everything else.
{w.functions.map(f => (
{f}
))}
{/* Gallery */}
{w.gallery.map((src, i) => {
const span = i === 0 ? 6 : (i % 3 === 1) ? 4 : 2;
const ratio = span === 6 ? "16 / 9" : span === 4 ? "5 / 4" : "3 / 4";
return (
setLightbox(src)}
className="imghover"
style={{
gridColumn: `span ${span}`, padding: 0, border: 0, background: "var(--blush)",
aspectRatio: ratio, overflow: "hidden", cursor: "zoom-in",
}}>
);
})}
{/* Photographer credit + consent */}
Photography credit · {w.photographer}
{/* CTA band */}
Plan a wedding like this — quietly, over many evenings.
{/* Lightbox */}
{lightbox && (
setLightbox(null)} role="dialog" aria-modal="true">
setLightbox(null)} className="btn btn-ghost-paper"
style={{ position: "fixed", top: 24, right: 24 }}>Close ✕
)}
);
}
Object.assign(window, { RealWeddingsSection, CaseStudy, ConsentRibbon });