function Header({ onSearch, onToggleDark, dark, favCount }) { const [scrolled, setScrolled] = useState(false); const [hover, setHover] = useState(null); const [searchOpen, setSearchOpen] = useState(false); const [menuOpen, setMenuOpen] = useState(false); const mobile = useMobile(); useEffect(() => { const on = () => setScrolled(window.scrollY > 30); window.addEventListener("scroll", on); return () => window.removeEventListener("scroll", on); }, []); return (
{/* Top strip — hidden on mobile */} {!mobile && ( <>
Lunedì 19 aprile 2026 · Numero CDVII
Reggio 21° Cosenza 18° Catanzaro 20°
)} {/* Masthead */}
{/* Left */}
{!mobile && Accedi}
{/* Logo */}
Calabria
Svelata
{/* Right */}
{mobile ? ( ) : ( <> Abbonati )}
{/* Nav — desktop: centrata, mobile: menu a tendina */} {mobile ? ( menuOpen && ( ) ) : ( )} {searchOpen && setSearchOpen(false)} />}
); } function SearchOverlay({ onClose }) { const [q, setQ] = useState(""); const inputRef = useRef(); useEffect(() => { inputRef.current?.focus(); }, []); const all = useMemo(() => [ ...STORIES.map(s => ({ type: s.cat, title: s.title, dek: s.dek })), ...EVENTS.map(e => ({ type: "Evento", title: e.title, dek: `${e.place} · ${e.day} ${e.month}` })), ...MAP_POINTS.map(p => ({ type: "Luogo", title: p.name, dek: p.province })), ], []); const results = q.length > 1 ? all.filter(x => (x.title + x.dek).toLowerCase().includes(q.toLowerCase())).slice(0, 8) : []; return (
Cerca in Calabria Svelata
setQ(e.target.value)} placeholder="Cerca luoghi, eventi, storie..." style={{ flex: 1, border: "none", background: "transparent", outline: "none", fontFamily: "'Fraunces', Georgia, serif", fontSize: "clamp(22px, 4vw, 48px)", color: "var(--ink)", }} />
{q.length > 1 ? (
{results.length === 0 &&
Nessun risultato
} {results.map((r, i) => ( {r.type}
{r.title}
{r.dek}
))}
) : (
Ricerche suggerite
{["Tropea", "Sila", "Bronzi di Riace", "Bergamotto", "Aspromonte", "Borghi arbëresh"].map(s => ( ))}
)}
); } window.Header = Header;