// /news — the newsroom index. Renders the live entries of NEWS_RELEASES
// (news/releases.jsx), newest first, each linking to its release page.

function Newsroom() {
  const published = (window.NEWS_RELEASES || []).filter(r => r.live);
  return (
    <>
      <section className="flat" style={{ padding: '112px 0 40px' }}>
        <div className="container" style={{ maxWidth: 820 }}>
          <span className="eyebrow" style={{ color: 'var(--accent)', alignSelf: 'flex-start' }}>Newsroom</span>
          <h1 style={{
            fontSize: 'clamp(34px, 4vw, 56px)', lineHeight: 1.07, fontWeight: 700,
            letterSpacing: '-0.025em', color: 'var(--fg-1)', margin: '18px 0 0',
          }}>News from EightbyZero</h1>
          <p style={{ fontSize: 17, lineHeight: 1.6, color: 'var(--fg-2)', margin: '18px 0 0', maxWidth: 680 }}>
            Announcements, partnerships and releases. Press inquiries: <a href="mailto:connect@eightbyzero.com" style={{ color: 'var(--accent)' }}>connect@eightbyzero.com</a>.
          </p>
        </div>
      </section>
      <section className="flat" style={{ padding: '0 0 112px' }}>
        <div className="container" style={{ maxWidth: 820, display: 'flex', flexDirection: 'column', gap: 16 }}>
          {published.map(r => (
            <a key={r.href} href={r.href} style={{
              display: 'flex', flexDirection: 'column', gap: 10, padding: '26px 28px',
              border: '1px solid var(--border-1)', borderRadius: 6, textDecoration: 'none',
              background: 'var(--bg-raised, transparent)',
            }}>
              <span style={{ display: 'flex', gap: 14, alignItems: 'baseline' }}>
                <span style={{ fontFamily: 'var(--font-mono)', fontSize: 12.5, color: 'var(--accent)', letterSpacing: '0.1em', textTransform: 'uppercase' }}>{r.tag}</span>
                <span style={{ fontFamily: 'var(--font-mono)', fontSize: 12.5, color: 'var(--fg-3)', letterSpacing: '0.06em', textTransform: 'uppercase' }}>{r.date}</span>
              </span>
              <span style={{ fontSize: 21, fontWeight: 600, color: 'var(--fg-1)', letterSpacing: '-0.015em', lineHeight: 1.3 }}>{r.title}</span>
              {r.dek && <span style={{ fontSize: 15, lineHeight: 1.6, color: 'var(--fg-2)' }}>{r.dek}</span>}
              <span style={{ fontSize: 13.5, color: 'var(--accent)', fontWeight: 500 }}>Read the release →</span>
            </a>
          ))}
        </div>
      </section>
    </>
  );
}

Object.assign(window, { Newsroom });
