// Shared chrome for the SBACEM360 institutional site — header, footer, section wrapper
const { Button, Icon, Logo, Eyebrow, SectionTitle } = window.SBACEM360DesignSystem_c54015;
const B = './';
const NAV = [['home','Início'],['quem-somos','Quem somos'],['servicos','Serviços'],['documentos','Documentos']];
const navLink = (active) => ({display:'inline-flex',alignItems:'center',whiteSpace:'nowrap',font:'500 14px/1.35 var(--font-text)',letterSpacing:'var(--ls-nav)',textTransform:'uppercase',color:active?'var(--s360-magenta-link)':'var(--s360-ink-44)',textDecoration:'none',transition:'color .2s'});
const portalLink = {display:'inline-flex',alignItems:'center',justifyContent:'center',whiteSpace:'nowrap',font:'500 14px/1.35 var(--font-text)',letterSpacing:'var(--ls-nav)',textTransform:'uppercase',color:'#fff',textDecoration:'none',padding:'10px 18px',border:'1px solid var(--s360-magenta)',borderRadius:999,transition:'background .2s'};
// Portal do Associado — abre o sistema de contratos (acesso do associado SBACEM 360)
function PortalLink({ style }) {
const [hv, setHv] = React.useState(false);
return
setHv(true)} onMouseLeave={()=>setHv(false)} style={{...portalLink,...style,marginTop:0,background:hv?'var(--s360-magenta)':'transparent'}}>Portal do Associado
;
}
function SiteHeader({ route, go }) {
const [open, setOpen] = React.useState(false);
const nav = k => { setOpen(false); go(k); };
return
{e.preventDefault();nav('home');}} style={{display:'block',flexShrink:0}}>
{open && }
;
}
const GlowBand = () =>
;
window.GlowBand = GlowBand;
function Section({ id, children, cream, style, hairline = true, backdrop }) {
return ;
}
function SiteFooter({ go }) {
return ;
}
function Reveal({ children, style }) {
const ref = React.useRef(null); const [on, setOn] = React.useState(false);
React.useEffect(()=>{ const el=ref.current; if(!el) return; const io=new IntersectionObserver(es=>{es.forEach(e=>{if(e.isIntersecting){setOn(true);io.disconnect();}})},{threshold:.08}); io.observe(el); return()=>io.disconnect(); },[]);
return {children}
;
}
// Brand Book — abre /brandbook num pop-up (iframe) sobre o site. Fecha no ×, no Esc ou clicando fora.
function abrirBrandBook() {
if (document.getElementById('s360-bb')) return;
const origem = document.activeElement;
const ov = document.createElement('div');
ov.id = 's360-bb'; ov.setAttribute('role', 'dialog'); ov.setAttribute('aria-modal', 'true'); ov.setAttribute('aria-label', 'Brand Book SBACEM360');
ov.style.cssText = 'position:fixed;inset:0;z-index:1000;background:rgba(7,6,15,.84);backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);display:flex;align-items:center;justify-content:center;padding:clamp(0px,3vw,40px);opacity:0;transition:opacity 220ms cubic-bezier(.2,.7,.2,1)';
const painel = document.createElement('div');
painel.style.cssText = 'position:relative;width:100%;max-width:1400px;height:100%;background:#090812;border:1px solid var(--s360-line-dark);border-radius:clamp(0px,1.5vw,20px);overflow:hidden;box-shadow:0 30px 80px rgba(0,0,0,.6);transform:translateY(12px);transition:transform 320ms cubic-bezier(.2,.7,.2,1)';
const fechar = document.createElement('button');
fechar.type = 'button'; fechar.setAttribute('aria-label', 'Fechar Brand Book'); fechar.textContent = '×';
fechar.style.cssText = 'position:absolute;top:14px;right:14px;z-index:2;width:44px;height:44px;border-radius:50%;border:1px solid var(--s360-magenta);background:rgba(9,8,18,.8);color:#fff;font:300 26px/1 sans-serif;cursor:pointer;display:grid;place-items:center';
const fr = document.createElement('iframe');
fr.src = '/brandbook'; fr.title = 'Brand Book SBACEM360';
fr.style.cssText = 'display:block;width:100%;height:100%;border:0;background:#fff';
painel.append(fechar, fr); ov.append(painel); document.body.append(ov);
const rolagem = document.documentElement.style.overflow; document.documentElement.style.overflow = 'hidden';
const tecla = e => { if (e.key === 'Escape') sair(); };
const sair = () => { document.removeEventListener('keydown', tecla); ov.style.opacity = '0'; setTimeout(() => { ov.remove(); document.documentElement.style.overflow = rolagem; if (origem && origem.focus) origem.focus(); }, 220); };
fechar.addEventListener('click', sair);
ov.addEventListener('click', e => { if (e.target === ov) sair(); });
document.addEventListener('keydown', tecla);
requestAnimationFrame(() => { ov.style.opacity = '1'; painel.style.transform = 'none'; fechar.focus(); });
}
Object.assign(window, { SiteHeader, SiteFooter, Section, Reveal, S360_BASE: B, abrirBrandBook });