// Componentes UI compartilhados const FLAGS = { us: { stripes: ['#bf0a30', '#ffffff'], canton: '#002868' }, br: { bg: '#009c3b', diamond: '#ffdf00', circle: '#002776' }, pt: { left: '#046a38', right: '#da291c' } }; function Flag({ country, className }) { const f = FLAGS[country]; if (country === 'us') { return ( USA ); } if (country === 'br') { return ( Brasil ); } if (country === 'pt') { return ( Portugal ); } return null; } function MiniFlag({ country }) { return ; } function Nav({ lang, setLang, onDonate }) { const [scrolled, setScrolled] = React.useState(false); const [projOpen, setProjOpen] = React.useState(false); const [menuOpen, setMenuOpen] = React.useState(false); const [active, setActive] = React.useState('sobre'); const projRef = React.useRef(null); React.useEffect(() => { const onScroll = () => setScrolled(window.scrollY > 8); window.addEventListener('scroll', onScroll); return () => window.removeEventListener('scroll', onScroll); }, []); React.useEffect(() => { const onClick = (e) => {if (projRef.current && !projRef.current.contains(e.target)) setProjOpen(false);}; document.addEventListener('mousedown', onClick); return () => document.removeEventListener('mousedown', onClick); }, []); // Scroll-spy: track active section React.useEffect(() => { const sectionIds = ['sobre', 'projetos', 'equipe']; const els = sectionIds.map((id) => document.getElementById(id)).filter(Boolean); if (!els.length) return; const io = new IntersectionObserver( (entries) => { entries.forEach((e) => { if (e.isIntersecting) setActive(e.target.id); }); }, { rootMargin: '-40% 0px -55% 0px', threshold: 0 } ); els.forEach((el) => io.observe(el)); return () => io.disconnect(); }, []); const clickNav = (id) => () => setActive(id); const t = lang === 'pt' ? { about: 'Início', projects: 'Projetos', team: 'Equipe', transp: 'Transparência', partner: 'Seja parceiro', all: 'Ver todos os projetos' } : { about: 'Home', projects: 'Programs', team: 'Team', transp: 'Transparency', partner: 'Partner with us', all: 'See all programs' }; const { PROJECTS } = window.SC_DATA; return ( {menuOpen &&
setMenuOpen(false)}>
e.stopPropagation()}> { clickNav('sobre')(); setMenuOpen(false); }}>{t.about}
{t.projects}
{PROJECTS.map((p) => setMenuOpen(false)}> {p.num} {p.label} {typeof p.tag === 'object' ? (p.tag[lang] || p.tag.pt) : p.tag} )}
{ clickNav('equipe')(); setMenuOpen(false); }}>{t.team} setMenuOpen(false)}>{t.transp}
}
); } const LOCATIONS = [ { c: 'br', city: 'Minas Gerais', region: 'Brasil' }, { c: 'br', city: 'Amapá', region: 'Brasil' }, { c: 'br', city: 'São Paulo', region: 'Brasil' }, { c: 'br', city: 'Paraíba', region: 'Brasil' }, { c: 'pt', city: 'Albufeira', region: 'Algarve, Portugal' }, { c: 'pt', city: 'Quarteira', region: 'Algarve, Portugal' }, { c: 'us', city: 'Orlando', region: 'Flórida, USA' }, { c: 'us', city: 'Deerfield Beach', region: 'Flórida, USA' }]; function LocationCarousel({ lang }) { const [idx, setIdx] = React.useState(0); const [paused, setPaused] = React.useState(false); React.useEffect(() => { if (paused) return; const id = setInterval(() => setIdx((i) => (i + 1) % LOCATIONS.length), 2400); return () => clearInterval(id); }, [paused]); const cur = LOCATIONS[idx]; return (
setPaused(true)} onMouseLeave={() => setPaused(false)}>
{lang === 'pt' ? 'Onde estamos' : 'Where we are'}
{cur.city}
{cur.region}
{cur.c === 'br' ? (lang === 'pt' ? 'Núcleo brasileiro' : 'Brazilian hub') : cur.c === 'pt' ? (lang === 'pt' ? 'Núcleo europeu' : 'Portuguese hub') : (lang === 'pt' ? 'Núcleo americano' : 'American hub')}
{LOCATIONS.map((_, i) =>
); } const HERO_PORTRAITS = [ { tone: '#8E3544', x: '8%', y: '12%', size: 220, delay: 0, label: 'Macapá' }, { tone: '#a85567', x: '72%', y: '6%', size: 180, delay: 0.5, label: 'Albufeira' }, { tone: '#6b2433', x: '85%', y: '52%', size: 240, delay: 1.0, label: 'Florida' }, { tone: '#c27e8a', x: '2%', y: '58%', size: 170, delay: 1.5, label: 'São Paulo' }, { tone: '#5a3a40', x: '40%', y: '78%', size: 150, delay: 2.0, label: 'Quarteira' }]; function HeroPortraits() { const [idx, setIdx] = React.useState(0); const slides = [ window.__r('hero1', 'hero-1.jpg'), window.__r('hero2', 'hero-2.jpg'), window.__r('hero3', 'hero-3.jpg'), window.__r('hero4', 'hero-4.jpg'), window.__r('hero5', 'hero-5.jpg'), ]; React.useEffect(() => { const id = setInterval(() => setIdx((i) => (i + 1) % slides.length), 5500); return () => clearInterval(id); }, []); return (