/* artsol-solution-app.jsx — orquestrador das páginas de solução Re-usa Nav, Footer, WhatsAppFloat e o sistema de Tweaks da home. Tema persistido em localStorage entre páginas. */ const SOL_TWEAKS = /*EDITMODE-BEGIN*/{ "theme": "athena", "accent": "#E94A2E", "showWhatsApp": true }/*EDITMODE-END*/; const SOL_THEME_ACCENTS = { athena: "#E94A2E", editorial: "#C9381F", nocturnal: "#F9B922" }; const THEME_STORAGE_KEY = "artsol-theme"; const ACCENT_STORAGE_KEY = "artsol-accent"; function SolutionApp() { // hydrate from localStorage so theme follows user across pages const initial = (() => { try { const storedTheme = localStorage.getItem(THEME_STORAGE_KEY); const storedAccent = localStorage.getItem(ACCENT_STORAGE_KEY); return { ...SOL_TWEAKS, ...(storedTheme ? { theme: storedTheme } : {}), ...(storedAccent ? { accent: storedAccent, _accentTouched: true } : {}) }; } catch { return SOL_TWEAKS; } })(); const [t, setTweak] = useTweaks(initial); // sync theme class on React.useEffect(() => { const html = document.documentElement; html.classList.remove("theme-athena", "theme-editorial", "theme-nocturnal"); html.classList.add("theme-" + t.theme); try { localStorage.setItem(THEME_STORAGE_KEY, t.theme); } catch {} if (!t._accentTouched) { const newAccent = SOL_THEME_ACCENTS[t.theme] || "#E94A2E"; if (newAccent !== t.accent) setTweak("accent", newAccent); } }, [t.theme]); // apply accent React.useEffect(() => { document.documentElement.style.setProperty("--accent", t.accent); try { localStorage.setItem(ACCENT_STORAGE_KEY, t.accent); } catch {} }, [t.accent]); React.useEffect(() => { const io = new IntersectionObserver((entries) => { entries.forEach((e) => { if (e.isIntersecting) { e.target.classList.add("is-visible"); io.unobserve(e.target); } }); }, { threshold: 0.12 }); document.querySelectorAll(".reveal").forEach((el) => io.observe(el)); return () => io.disconnect(); }, []); const slug = window.ARTSOL_SLUG || "fotovoltaica"; return ( <>