// ─── SENES MEDIA · Project Detail Overlay ────────────────────────── // Fullscreen modal that opens when a project card is clicked. // Renders the project header + a vertical gallery of all images. function ProjectDetail({ project, onClose }) { const scrollRef = React.useRef(null); const [allProjects] = React.useState(window.SENES_DATA.projects); const [lightbox, setLightbox] = React.useState(-1); // -1 closed, else image index React.useEffect(() => { if (!project) return; document.body.style.overflow = "hidden"; const onKey = (e) => { if (e.key === "Escape") { if (lightbox >= 0) setLightbox(-1); else onClose(); } if (lightbox >= 0 && project) { if (e.key === "ArrowLeft") setLightbox((i) => (i - 1 + project.images.length) % project.images.length); if (e.key === "ArrowRight") setLightbox((i) => (i + 1) % project.images.length); } }; window.addEventListener("keydown", onKey); return () => { document.body.style.overflow = ""; window.removeEventListener("keydown", onKey); }; }, [project, onClose, lightbox]); // Reset scroll + lightbox on project change React.useEffect(() => { if (scrollRef.current) scrollRef.current.scrollTop = 0; setLightbox(-1); }, [project?.id]); if (!project) return null; const idx = allProjects.findIndex((p) => p.id === project.id); const prev = idx > 0 ? allProjects[idx - 1] : null; const next = idx < allProjects.length - 1 ? allProjects[idx + 1] : null; return (
{ if (e.target === e.currentTarget) onClose(); }}>
{/* Close + meta header bar */}
{project.id} / {project.category}
{/* Hero / project title */}
{project.name}
{project.year} · {project.services.join(" · ")}

{project.name}

{project.description}

{/* Brief / meta panel */}
Client
{project.name}
Year
{project.year}
Discipline
{project.category}
Deliverables
{project.services.length}
{project.website && (
Live site
{project.website.replace(/^https?:\/\/(www\.)?/, "")}
)}
The brief

{project.brief}

{/* Image gallery — side-by-side grid, click to open slider */}
Gallery · {project.images.length} item{project.images.length === 1 ? "" : "s"}
Click any tile to view full-size
{project.images.map((img, i) => ( ))}
{/* Footer / next-project */}
); } Object.assign(window, { ProjectDetail });