/* ============================================================
   WEINBERG — Shared shell: i18n context, icons, placeholders,
   TopBar, MainNav, Footer, Reveal
   ============================================================ */

const LangContext = React.createContext('de');
function L(node, lang){ if(!node) return ''; return node[lang] != null ? node[lang] : node.de; }
function useLang(){ return React.useContext(LangContext); }
/* ---------- REAL-PATH ROUTING BASE ----------
   Captured ONCE at load. On Netlify the site is served from the domain root, so
   BASE is "/" and routes are language-prefixed clean paths: /en/services,
   /de/leistungen. When the file is opened directly (dev preview, local file,
   offline export) the document lives at .../something.html, so BASE becomes that
   directory and links keep working without a server rewrite. */
const BASE = (function(){
  try{
    if(window.__WB_ROOT) return window.__WB_ROOT;
    const p = window.location.pathname || '/';
    if(/\.html?$/i.test(p)) return p.replace(/[^/]*$/, '');
    return '/';
  }catch(e){ return '/'; }
})();
/* ---------- LANGUAGE-PREFIXED URL SLUGS ----------
   Every page exists under both language prefixes: /en/<english-slug> and
   /de/<german-slug>. English is the default for the broader European market,
   German serves the DACH market. "home" has an empty slug — /en/ and /de/. */
const LANGS = ['en','de'];
const DEFAULT_LANG = 'en';
const CANONICAL_ORIGIN = 'https://weinberg93.eu';
const SLUGS = {
  home:           {en:'',                de:''},
  leistungen:     {en:'services',        de:'leistungen'},
  fabrik:         {en:'factory',         de:'fabrik'},
  nachhaltigkeit: {en:'sustainability',  de:'nachhaltigkeit'},
  warum:          {en:'why-weinberg',    de:'warum-weinberg'},
  referenzen:     {en:'references',      de:'referenzen'},
  zertifikate:    {en:'certifications',  de:'zertifikate'},
  kontakt:        {en:'contact',         de:'kontakt'},
  impressum:      {en:'imprint',         de:'impressum'},
  datenschutz:    {en:'privacy',         de:'datenschutz'},
};
/* Reverse lookup "<lang>/<slug>" -> route key, plus a legacy map of bare
   (un-prefixed) German slugs so old links like /leistungen still resolve. */
const SLUG_TO_ROUTE = {};
const LEGACY_SLUG_TO_ROUTE = {};
Object.keys(SLUGS).forEach(function(r){
  LANGS.forEach(function(l){
    const s = SLUGS[r][l];
    if(s) SLUG_TO_ROUTE[l+'/'+s] = r;
  });
  if(SLUGS[r].de) LEGACY_SLUG_TO_ROUTE[SLUGS[r].de] = r;
  if(SLUGS[r].en) LEGACY_SLUG_TO_ROUTE[SLUGS[r].en] = r;
});
LEGACY_SLUG_TO_ROUTE['warum'] = 'warum';
/* The language the UI is currently rendering in — kept in sync by app.jsx so
   HREF() builds correct links without every call site having to pass it. */
let CURRENT_LANG = DEFAULT_LANG;
function setCurrentLang(l){ if(LANGS.indexOf(l) !== -1) CURRENT_LANG = l; }
/* Build the in-app href for a route in a language: /en/services, /de/leistungen. */
function HREF(r, lang){
  const l = LANGS.indexOf(lang) !== -1 ? lang : CURRENT_LANG;
  const entry = SLUGS[r] || SLUGS.home;
  return BASE + l + '/' + (entry[l] != null ? entry[l] : '');
}
/* Fully-qualified canonical URL for a route + language (used for canonical/hreflang). */
function CANONICAL(r, lang){
  const entry = SLUGS[r] || SLUGS.home;
  return CANONICAL_ORIGIN + '/' + lang + '/' + (entry[lang] != null ? entry[lang] : '');
}
/* Resolve an asset path through an optional inlined data-URI map (used by the standalone export). */
function ASSET(path){
  if(typeof window!=='undefined' && window.A && window.A[path]) return window.A[path];
  return BASE + String(path||'').replace(/^\/+/, '');
}

/* ---------- ICONS ---------- */
const STROKE_ICONS = {
  arrow:'M5 12h14M13 6l6 6-6 6',
  caret:'M6 9l6 6 6-6',
  check:'M5 13l4 4L19 7',
  phone:'M3 5a2 2 0 012-2h2l2 5-2 1a12 12 0 006 6l1-2 5 2v2a2 2 0 01-2 2A16 16 0 013 5z',
  mail:'M3 6h18v12H3zM3 7l9 6 9-6',
  globe:'M12 3a9 9 0 100 18 9 9 0 000-18zM3 12h18M12 3c2.5 2.6 2.5 15.4 0 18M12 3c-2.5 2.6-2.5 15.4 0 18',
  clock:'M12 7v5l3 2M21 12a9 9 0 11-18 0 9 9 0 0118 0z',
  pin:'M12 21s7-6 7-11a7 7 0 10-14 0c0 5 7 11 7 11zM12 10a1 1 0 100-2 1 1 0 000 2z',
  recycle:'M7 19H4l3-5 3 2M17 5l2 4-5 1M9 5l3-2 3 5M5 9l-1 4 5 1M19 15l1-4-5-1M15 19l-3 2-3-5',
  doc:'M7 3h7l5 5v13H7zM14 3v5h5M9 13h6M9 17h6',
  leaf:'M5 19c0-8 6-14 14-14 0 8-6 14-14 14zM5 19c4-4 7-6 11-7',
  bolt:'M13 3L5 13h5l-1 8 8-10h-5z',
  sun:'M12 4V2M12 22v-2M4 12H2M22 12h-2M5.6 5.6L4.2 4.2M19.8 19.8l-1.4-1.4M18.4 5.6l1.4-1.4M4.2 19.8l1.4-1.4M12 8a4 4 0 100 8 4 4 0 000-8z',
  plug:'M9 2v6M15 2v6M6 8h12v2a6 6 0 01-12 0zM12 16v6',
  shield:'M12 3l7 3v5c0 5-3.5 8-7 10-3.5-2-7-5-7-10V6z',
  gear:'M12 9a3 3 0 100 6 3 3 0 000-6zM19 12l2-1-1-3-2 .5a6 6 0 00-1.5-1.5L17 4l-3-1-1 2a6 6 0 00-2 0L10 3 7 4l.5 2.5A6 6 0 006 8l-2-.5-1 3 2 1a6 6 0 000 2l-2 1 1 3 2-.5A6 6 0 007.5 18L7 20l3 1 1-2a6 6 0 002 0l1 2 3-1-.5-2.5a6 6 0 001.5-1.5l2 .5 1-3z',
  people:'M9 11a3 3 0 100-6 3 3 0 000 6zM3 20a6 6 0 0112 0M17 11a3 3 0 10-1-5.8M15.5 14.5A6 6 0 0121 20',
  building:'M4 21V5l8-2v18M12 21V9l8 3v9M4 21h16M7 8h2M7 12h2M7 16h2M15 14h2M15 17h2',
  box:'M3 7l9-4 9 4-9 4zM3 7v10l9 4M21 7v10l-9 4M3 7l9 4 9-4',
  road:'M6 21L9 3M18 21l-3-18M12 5v2M12 11v2M12 17v2',
  bridge:'M3 10v7M21 10v7M3 14c0-3.9 4-7 9-7s9 3.1 9 7M8 14v3M12 13v4M16 14v3',
  chip:'M7 7h10v10H7zM9 3v4M15 3v4M9 17v4M15 17v4M3 9h4M3 15h4M17 9h4M17 15h4',
  trophy:'M7 4h10v4a5 5 0 01-10 0zM7 6H4v1a3 3 0 003 3M17 6h3v1a3 3 0 01-3 3M9 19h6M12 14v5',
  star:'M12 4l2.4 5 5.6.5-4.2 3.6 1.3 5.4L12 20l-5.1 2.5L8.2 17 4 13.5 9.6 13z',
  grid:'M4 4h7v7H4zM13 4h7v7h-7zM4 13h7v7H4zM13 13h7v7h-7z',
  truck:'M3 6h11v9H3zM14 9h4l3 3v3h-7zM7 18a2 2 0 100-4 2 2 0 000 4zM18 18a2 2 0 100-4 2 2 0 000 4z',
  upload:'M12 16V4M8 8l4-4 4 4M5 16v3a1 1 0 001 1h12a1 1 0 001-1v-3',
};
const FILL_ICONS = {
  facebook:'M13 22v-8h2.5l.5-3H13V9c0-.9.3-1.5 1.6-1.5H16V4.9c-.3 0-1.3-.1-2.4-.1-2.4 0-4 1.4-4 4.1V11H7v3h2.6v8z',
  linkedin:'M6.5 8h-3v11h3zM5 6.5A1.7 1.7 0 105 3a1.7 1.7 0 000 3.5zM20.5 19h-3v-5.8c0-1.5-.6-2.2-1.7-2.2-1.2 0-1.8.8-1.8 2.2V19h-3V8h2.9v1.3c.6-.9 1.6-1.5 3-1.5 2.2 0 3.6 1.4 3.6 4.3z',
  instagram:'M12 9a3 3 0 100 6 3 3 0 000-6zm0-2a5 5 0 110 10 5 5 0 010-10zm5.5-.5a1 1 0 110 2 1 1 0 010-2zM7 3h10a4 4 0 014 4v10a4 4 0 01-4 4H7a4 4 0 01-4-4V7a4 4 0 014-4zm0 2a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2z',
  youtube:'M21.6 7.2a2.5 2.5 0 00-1.8-1.8C18.2 5 12 5 12 5s-6.2 0-7.8.4A2.5 2.5 0 002.4 7.2 26 26 0 002 12a26 26 0 00.4 4.8 2.5 2.5 0 001.8 1.8C5.8 19 12 19 12 19s6.2 0 7.8-.4a2.5 2.5 0 001.8-1.8A26 26 0 0022 12a26 26 0 00-.4-4.8zM10 15V9l5 3z',
  play:'M8 5v14l11-7z',
  expand:'M4 9V4h5M20 9V4h-5M4 15v5h5M20 15v5h-5',
};
function Icon({name, className, style}){
  if(FILL_ICONS[name]){
    return (<svg className={className} style={style} viewBox="0 0 24 24" aria-hidden="true"><path d={FILL_ICONS[name]}></path></svg>);
  }
  return (<svg className={className} style={style} viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.7" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true"><path d={STROKE_ICONS[name]||''}></path></svg>);
}

/* ---------- COOKIE CONSENT ---------- */
const ConsentContext = React.createContext({ok:false, setOk:()=>{}, openPanel:()=>{}});
function useConsent(){ return React.useContext(ConsentContext); }
function ConsentProvider({children}){
  const [ok, setOkState] = React.useState(()=>{ try{ return localStorage.getItem('wb_consent_v2')==='all'; }catch(e){ return false; } });
  const [decided, setDecided] = React.useState(()=>{ try{ return !!localStorage.getItem('wb_consent_v2'); }catch(e){ return false; } });
  const setOk = (v)=>{ try{ localStorage.setItem('wb_consent_v2', v?'all':'necessary'); }catch(e){} setOkState(v); setDecided(true); };
  const openPanel = ()=>setDecided(false);
  /* Google Fonts are only fetched after consent (Art. 6(1)(a) GDPR) */
  React.useEffect(()=>{
    if(!ok || document.getElementById('wb-gfonts')) return;
    const l = document.createElement('link');
    l.id = 'wb-gfonts'; l.rel = 'stylesheet';
    l.href = 'https://fonts.googleapis.com/css2?family=Archivo:wght@400;500;600;700;800;900&family=IBM+Plex+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap';
    document.head.appendChild(l);
  },[ok]);
  return (
    <ConsentContext.Provider value={{ok, setOk, openPanel, decided}}>
      {children}
    </ConsentContext.Provider>
  );
}
function CookieBanner({lang, go}){
  const {setOk, decided} = useConsent();
  const c = CONTENT.ui.consent;
  if(decided) return null;
  return (
    <div className="cookiebar" role="dialog" aria-live="polite" aria-label={L(c.title,lang)}>
      <div className="cb-inner">
        <div className="cb-text">
          <strong>{L(c.title,lang)}</strong>
          <p>{L(c.text,lang)}</p>
          <a className="cb-link" href={HREF('datenschutz')} onClick={(e)=>{e.preventDefault();go&&go('datenschutz');}}>{L(c.more,lang)}</a>
        </div>
        <div className="cb-actions">
          <button className="btn btn-outline btn-sm" onClick={()=>setOk(false)}>{L(c.reject,lang)}</button>
          <button className="btn btn-primary btn-sm" onClick={()=>setOk(true)}>{L(c.accept,lang)}</button>
        </div>
      </div>
    </div>
  );
}
/* Consent-gated YouTube iframe: shows a poster + load button until accepted */
function YtEmbed({videoId, params, title, className, poster, lang, allow, ariaHidden, tabIndex}){
  const {ok, setOk} = useConsent();
  const [local, setLocal] = React.useState(false);
  const c = CONTENT.ui.consent;
  if(ok || local){
    return (
      <iframe className={className}
        src={'https://www.youtube-nocookie.com/embed/'+videoId+'?'+(params||'rel=0&modestbranding=1')}
        title={title} frameBorder="0"
        tabIndex={tabIndex} aria-hidden={ariaHidden}
        allow={allow||'accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share'}
        allowFullScreen></iframe>
    );
  }
  return (
    <div className={'ytblock'+(className?' '+className:'')} style={poster?{backgroundImage:'url("'+poster+'")'}:undefined}>
      <div className="ytblock-in">
        <strong>{L(c.blockedTitle,lang)}</strong>
        <p>{L(c.blockedText,lang)}</p>
        <button className="btn btn-white btn-sm" onClick={()=>{setLocal(true);}}>{L(c.blockedBtn,lang)}</button>
      </div>
    </div>
  );
}

/* ---------- VIDEO LIGHTBOX ---------- */
function VideoLightbox({videoId, open, onClose}){
  React.useEffect(()=>{
    const onKey = (e)=>{ if(e.key==='Escape') onClose(); };
    if(open){ document.addEventListener('keydown', onKey); document.body.style.overflow='hidden'; }
    return ()=>{ document.removeEventListener('keydown', onKey); document.body.style.overflow=''; };
  },[open, onClose]);
  if(!open) return null;
  return (
    <div className="vlb" onClick={onClose}>
      <button className="vlb-close" aria-label="Schließen" onClick={onClose}>
        <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round"><path d="M6 6l12 12M18 6L6 18"></path></svg>
      </button>
      <div className="vlb-frame" onClick={(e)=>e.stopPropagation()}>
        <iframe
          src={'https://www.youtube-nocookie.com/embed/'+videoId+'?autoplay=1&rel=0&modestbranding=1'}
          title="Weinberg Image Film"
          frameBorder="0"
          allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
          allowFullScreen></iframe>
      </div>
    </div>
  );
}

/* ---------- IMAGE PLACEHOLDER / REAL IMAGE ---------- */
function Ph({label, light, green, className, style, src, pos}){
  if(src){
    const st = Object.assign({backgroundImage:'url("'+src+'")', backgroundSize:'cover', backgroundPosition:pos||'center'}, style);
    return (<div className={'ph ph-real'+(className?' '+className:'')} style={st}></div>);
  }
  const cls = 'ph' + (light?' light':'') + (className?' '+className:'');
  const st = green ? Object.assign({background:'repeating-linear-gradient(135deg,#1f5a22 0 2px,transparent 2px 13px),linear-gradient(135deg,#256528,#1c4a1f)'}, style) : style;
  return (<div className={cls} style={st}>{label ? <span className="ph-lab mono">[ {label} ]</span> : null}</div>);
}

/* ---------- SCROLL REVEAL ---------- */
function Reveal({children, className, as, delay, style, ...rest}){
  const ref = React.useRef(null);
  const [shown, setShown] = React.useState(false);
  React.useEffect(()=>{
    const el = ref.current; if(!el) return;
    const io = new IntersectionObserver((es)=>{
      es.forEach(e=>{ if(e.isIntersecting){ setShown(true); io.disconnect(); } });
    },{threshold:0.12, rootMargin:'0px 0px -8% 0px'});
    io.observe(el);
    return ()=>io.disconnect();
  },[]);
  const Tag = as || 'div';
  return (<Tag ref={ref} {...rest} className={(className?className+' ':'')+'reveal'+(shown?' in':'')} style={{...(style||{}), ...(delay?{transitionDelay:delay+'ms'}:{})}}>{children}</Tag>);
}

/* ---------- TOP BAR ---------- */
function TopBar(){
  const lang = useLang();
  const u = CONTENT.ui.topbar;
  return (
    <div className="topbar">
      <div className="wrap">
        <div className="tb-l">
          <a href={'mailto:'+L(u.email,lang)}><Icon name="mail"/>{L(u.email,lang)}</a>
          <span><Icon name="clock"/>{L(u.hours,lang)}</span>
        </div>
        <div className="tb-r">
          <a href="https://www.facebook.com/weinberg93" target="_blank" rel="noopener" aria-label="Facebook"><Icon name="facebook"/></a>
          <a href="https://hu.linkedin.com/company/weinberghungary" target="_blank" rel="noopener" aria-label="LinkedIn"><Icon name="linkedin"/></a>
          <a href="https://www.instagram.com/weinberghungary/" target="_blank" rel="noopener" aria-label="Instagram"><Icon name="instagram"/></a>
          <a href="https://www.youtube.com/@weinberg-93" target="_blank" rel="noopener" aria-label="YouTube"><Icon name="youtube"/></a>
        </div>
      </div>
    </div>
  );
}

/* ---------- MAIN NAV ---------- */
function Logo({onClick}){
  const lang = useLang();
  return (
    <a className="logo" href={HREF('home')} onClick={onClick}>
      <img className="mark-img" src={ASSET("assets/logo-w-white.png")} alt="Weinberg" width="52" height="40"/>
      <span className="wm"><b>WEINBERG</b></span>
    </a>
  );
}

function MainNav({route, go, lang, setLang}){
  const [scrolled, setScrolled] = React.useState(false);
  const [mobileOpen, setMobileOpen] = React.useState(false);
  React.useEffect(()=>{
    const onScroll = ()=> setScrolled(window.scrollY > 8);
    window.addEventListener('scroll', onScroll); onScroll();
    return ()=>window.removeEventListener('scroll', onScroll);
  },[]);
  const nav = CONTENT.ui.nav;
  const handle = (r, opts)=> (e)=>{ e.preventDefault(); setMobileOpen(false); go(r, opts); };
  const items = [
    {r:'leistungen', label:nav.leistungen, dd:'leistungen'},
    {r:'fabrik', label:nav.fabrik},
    {r:'nachhaltigkeit', label:nav.nachhaltigkeit},
    {r:'warum', label:nav.warum},
    {r:'zertifikate', label:nav.zertifikate, dd:'zertifikate'},
    {r:'referenzen', label:nav.referenzen},
    {r:'kontakt', label:nav.kontakt, dd:'kontakt'},
  ];
  const leistungenDD = CONTENT.leistungen.caps.slice(0,8);
  const zertDD = CONTENT.zertifikate.groups.reduce((a,g)=>a.concat(g.certs),[]);
  return (
    <React.Fragment>
    <nav className={'nav'+(scrolled?' scrolled':'')}>
      <div className="wrap">
        <Logo onClick={handle('home')}/>
        <ul className="navlinks">
          {items.map(it=>(
            <li key={it.r} className={route===it.r?'active':''}>
              <a href={HREF(it.r)} onClick={handle(it.r)}>
                {L(it.label,lang)}
                {it.dd ? <Icon name="caret" className="caret"/> : null}
              </a>
              {it.dd==='leistungen' && (
                <div className="dropdown">
                  {leistungenDD.map((c,i)=>(
                    <a key={i} href={HREF('leistungen')} onClick={handle('leistungen')}><b>{L(c.t,lang)}</b></a>
                  ))}
                </div>
              )}
              {it.dd==='zertifikate' && (
                <div className="dropdown dropdown-cert">
                  {zertDD.map((c,i)=>(
                    <a key={i} href={ASSET(c.pdf)} target="_blank" rel="noopener"><b>{c.name}</b><small>{L(c.body,lang)}</small></a>
                  ))}
                  <a className="dd-all" href={HREF('zertifikate')} onClick={handle('zertifikate')}><b>{lang==='hu'?'Összes tanúsítvány →':lang==='en'?'All certifications →':'Alle Zertifikate →'}</b></a>
                </div>
              )}
              {it.dd==='kontakt' && (
                <div className="dropdown">
                  <a href={HREF('kontakt')} onClick={handle('kontakt',{tab:'kontakt'})}><b>{L(nav.kontakt,lang)}</b><small>{lang==='hu'?'Általános megkeresés':lang==='en'?'General enquiry':'Allgemeine Anfrage'}</small></a>
                  <a href={HREF('kontakt')} onClick={handle('kontakt',{tab:'angebot'})}><b>{L(nav.angebot,lang)}</b><small>{lang==='hu'?'Rajzokkal és fájlokkal':lang==='en'?'With drawings & files':'Mit Zeichnungen & Dateien'}</small></a>
                </div>
              )}
            </li>
          ))}
        </ul>
        <div className="nav-r">
          <div className="lang">
            <a className={lang==='de'?'on':''} href={HREF(route,'de')} hrefLang="de" onClick={(e)=>{e.preventDefault();setMobileOpen(false);setLang('de');}}>DE</a>
            <a className={lang==='en'?'on':''} href={HREF(route,'en')} hrefLang="en" onClick={(e)=>{e.preventDefault();setMobileOpen(false);setLang('en');}}>EN</a>
          </div>
          <a className="btn btn-white nav-cta" href={HREF('kontakt')} onClick={handle('kontakt',{tab:'angebot'})}>{L(CONTENT.ui.navCta,lang)}</a>
          <button className="burger" aria-label="Menu" onClick={()=>setMobileOpen(o=>!o)}><span></span><span></span><span></span></button>
        </div>
      </div>
    </nav>
    <div className={'mobile-menu'+(mobileOpen?' open':'')}>
      <div className="wrap">
        {items.map(it=>(<a key={it.r} href={HREF(it.r)} onClick={handle(it.r)}>{L(it.label,lang)}</a>))}
        <a className="btn btn-primary ml-cta" href={HREF('kontakt')} onClick={handle('kontakt',{tab:'angebot'})} style={{width:'100%',marginTop:'18px',color:'#fff'}}>{L(CONTENT.ui.navCta,lang)}</a>
      </div>
    </div>
    </React.Fragment>
  );
}

/* ---------- FOOTER ---------- */
function Footer({go, lang}){
  const f = CONTENT.ui.footer; const nav = CONTENT.ui.nav;
  const {openPanel} = useConsent();
  const handle = (r,opts)=>(e)=>{ e.preventDefault(); go(r,opts); };
  const links = [
    ['leistungen',nav.leistungen],['fabrik',nav.fabrik],['nachhaltigkeit',nav.nachhaltigkeit],
    ['warum',nav.warum],['referenzen',nav.referenzen],['kontakt',nav.kontakt],
  ];
  const certs = ['EN 1090-1','EN 1090-2','ISO 9001','ISO 14001','ISO 45001','ISO 3834-2','8/2018 ITM','NATO'];
  return (
    <footer className="footer">
      <div className="wrap top">
        <div>
          <Logo onClick={handle('home')}/>
          <div className="tagline">{L(f.tagline,lang)}</div>
          <p className="desc">{L(f.desc,lang)}</p>
        </div>
        <div>
          <h5>{L(f.navTitle,lang)}</h5>
          <div className="fnav">
            {links.map(([r,lab])=>(<a key={r} href={HREF(r)} onClick={handle(r)}>{L(lab,lang)}</a>))}
          </div>
        </div>
        <div>
          <h5>{L(f.certTitle,lang)}</h5>
          <div className="fcerts">{certs.map(c=>(<span key={c} className={'mono'+(c==='NATO'?' primary':'')}>{c}</span>))}</div>
        </div>
      </div>
      <div className="wrap bottom">
        <span>{L(f.rights,lang)}</span>
        <div className="links">
          <a href={HREF('impressum')} onClick={handle('impressum')}>{L(f.impressum,lang)}</a>
          <a href={HREF('datenschutz')} onClick={handle('datenschutz')}>{L(f.datenschutz,lang)}</a>
          <a href={HREF('zertifikate')} onClick={handle('zertifikate')}>{L(f.zertifikate,lang)}</a>
          <a href="#" onClick={(e)=>{e.preventDefault();openPanel();}}>{L(CONTENT.ui.consent.manage,lang)}</a>
        </div>
        <div className="social">
          <a href="https://www.facebook.com/weinberg93" target="_blank" rel="noopener" aria-label="Facebook"><Icon name="facebook"/></a>
          <a href="https://hu.linkedin.com/company/weinberghungary" target="_blank" rel="noopener" aria-label="LinkedIn"><Icon name="linkedin"/></a>
          <a href="https://www.instagram.com/weinberghungary/" target="_blank" rel="noopener" aria-label="Instagram"><Icon name="instagram"/></a>
          <a href="https://www.youtube.com/@weinberg-93" target="_blank" rel="noopener" aria-label="YouTube"><Icon name="youtube"/></a>
        </div>
      </div>
    </footer>
  );
}

Object.assign(window, { LangContext, L, useLang, ASSET, BASE, HREF, CANONICAL, LANGS, DEFAULT_LANG, CANONICAL_ORIGIN, SLUGS, SLUG_TO_ROUTE, LEGACY_SLUG_TO_ROUTE, setCurrentLang, Icon, Ph, Reveal, TopBar, MainNav, Footer, Logo, VideoLightbox, ConsentContext, ConsentProvider, useConsent, CookieBanner, YtEmbed });
