/* Federica Gori — card condivise (Diario + Home). */ /* Immagine card: coverImage dal CMS → foto del tema (assets/diario/.jpg) → segnaposto Photo. Lazy + aspect-ratio fisso: zero CLS. alt vuoto: decorativa, il titolo adiacente è già il testo del link. */ function PostImage({ post = {}, tone = "sand", ratio = "16 / 10", style = {} }) { const [broken, setBroken] = React.useState(false); const src = post.image || (post.theme ? `assets/diario/${post.theme}.jpg` : null); if (!src || broken) { return ; } return ( setBroken(true)} style={{ display: "block", width: "100%", height: ratio ? "auto" : "100%", aspectRatio: ratio || "auto", objectFit: "cover", background: "#F1E9DA", ...style }} /> ); } /* Titolo del post: vero quando l'articolo ha la sua pagina (CMS), testo semplice per gli esempi fallback. Link reali = SEO/GEO e accessibilità. */ function TitoloPost({ post, children }) { if (!post.url) return children; return {children}; } /* Link visibile «Leggi l'articolo →» — vero, solo per gli articoli dal CMS. */ function LeggiArticolo({ post, size = 14 }) { if (!post.url) return null; return ( Leggi l'articolo ); } /* Card articolo — anteprima editoriale (il tema fa da categoria). */ function PostCard({ post }) { const { Card, Badge } = window.FedericaGoriDesignSystem_549960; // Tutta la card è cliccabile (onClick + manina); dentro restano i link VERI // (titolo + «Leggi l'articolo») per SEO, accessibilità e middle-click. const cliccabile = post.url ? { onClick: (e) => { if (!e.target.closest("a")) window.location.href = post.url; }, style: { cursor: "pointer" } } : {}; return (
{window.fgThemeLabel(post.theme)}

{post.title}

{post.excerpt}

{post.date}{post.read} di lettura
); } /* Riga-intestazione di un tema del Diario. */ function ThemeHeader({ theme, count }) { return (

{theme.label}

{theme.blurb}

); } Object.assign(window, { PostImage, PostCard, TitoloPost, LeggiArticolo, ThemeHeader });