/* closing.jsx — final CTA + footer → window */
(function(){
  const { StoreBadges } = window;

  function FinalCTA(){
    return (
      <section className="section final" id="download">
        <div className="wrap">
          <div className="final-card reveal">
            <h2>Know what's on.<br/>Before it piles up.</h2>
            <p>Download What's On, connect your accounts, and wake up to a sorted inbox — with replies already drafted. Run it Connected, or go Private and keep it all on your device.</p>
            <StoreBadges/>
          </div>
        </div>
      </section>
    );
  }

  function Footer(){
    const cols = [
      ['Product',[['How it works','#how'],['Two ways to run it','#ways'],['Privacy','#privacy'],['Pricing','#pricing']]],
      ['Company',[['About','#'],['Press','mailto:press@chappleproperty.co.uk?subject=Press'],['Contact','mailto:whatson-support@chappleproperty.co.uk']]],
      ['Legal',[['Privacy policy','/privacy'],['Security','/security'],['Terms','/terms']]],
    ];
    return (
      <footer className="site-foot">
        <div className="wrap">
          <div className="foot-grid">
            <div className="foot-brand">
              <a className="brand" href="#top" aria-label="What’s On 2 — home"><span className="whatson-wordmark">What’s On 2</span></a>
              <p>A privacy-first AI that reads your email — surfacing what matters, drafting your replies, and planning your day. Connected, or entirely on your device with Private.</p>
            </div>
            {cols.map(([h,links],i)=>(
              <div className="foot-col" key={i}>
                <h5>{h}</h5>
                {links.map(([l,href],k)=><a key={k} href={href} onClick={e=>{if(href==='#')e.preventDefault();}}>{l}</a>)}
              </div>
            ))}
          </div>
          <div className="foot-bottom">
            <span>© 2026 What's On · Connected & Private · Runs only on your device in Private mode.</span>
            <span>Built by Oliver Chapple</span>
          </div>
        </div>
      </footer>
    );
  }

  Object.assign(window, { FinalCTA, Footer });
})();
