Object.assign(window, { Article });

const Img = ({ src, alt, style }) => (
  <img src={src} alt={alt || ''}
    style={{ width: '100%', height: 'auto', display: 'block', ...style }} />
);

const H2 = ({ children }) => (
  <h2 style={{
    fontSize: 'clamp(20px, 2.5vw, 24px)', fontWeight: 700,
    color: '#CC0000', fontFamily: 'Arial, sans-serif',
    lineHeight: '1.3', margin: '28px 0 14px',
    textTransform: 'uppercase',
  }}>{children}</h2>
);

const Quote = ({ name, children }) => (
  <p style={{ fontSize: '19px', lineHeight: '1.75', marginBottom: '16px', fontFamily: 'Georgia, serif', color: '#1a1a1a' }}>
    <strong style={{ fontFamily: 'Arial, sans-serif' }}>{name}:</strong>&nbsp;{children}
  </p>
);

const Step = ({ n, children }) => (
  <div style={{
    display: 'flex', alignItems: 'flex-start',
    background: '#fff5f5', padding: '12px 16px',
    borderRadius: '8px', borderLeft: '3px solid #E30A17',
    marginBottom: '12px',
  }}>
    <span style={{
      display: 'flex', justifyContent: 'center', alignItems: 'center',
      minWidth: '30px', height: '30px',
      border: '2px solid #E30A17', borderRadius: '50%',
      marginRight: '14px', fontWeight: 700, color: '#E30A17',
      fontSize: '14px', flexShrink: 0, marginTop: '2px',
      fontFamily: 'Arial, sans-serif',
    }}>{n}</span>
    <p style={{ margin: 0, fontSize: '18px', lineHeight: '1.65', fontFamily: 'Arial, sans-serif', color: '#333' }}>{children}</p>
  </div>
);


function Article() {
  const body = { fontSize: '19px', lineHeight: '1.8', marginBottom: '18px', fontFamily: 'Georgia, serif', color: '#1a1a1a' };

  return (
    <article style={{ paddingTop: '12px' }}>

      {/* Breadcrumb + Google News */}
      <div style={{ display: 'flex', alignItems: 'flex-start', justifyContent: 'space-between', marginBottom: '12px', flexWrap: 'wrap', gap: '6px' }}>
        <div style={{ fontFamily: 'Arial, sans-serif' }}>
          <div style={{ fontSize: '13px', marginBottom: '3px' }}>
            <span style={{ color: '#888' }}>Haberler</span>
            <span style={{ color: '#888' }}> - </span>
            <span style={{ color: '#E30A17', fontWeight: 700 }}>Ekonomi</span>
          </div>
          <div style={{ fontSize: '12px', color: '#888' }}>26 Mayıs 2026 · 11:55</div>
        </div>
        <a href="#" onClick={e => e.preventDefault()} style={{
          display: 'inline-flex', alignItems: 'center', gap: '5px',
          border: '1px solid #e0e0e0', borderRadius: '4px',
          padding: '4px 10px', textDecoration: 'none', color: '#444',
          fontSize: '12px', fontFamily: 'Arial, sans-serif', flexShrink: 0,
        }}>
          <svg viewBox="0 0 24 24" width="14" height="14" fill="none">
            <path d="M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z" fill="#4285F4"/>
            <path d="M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z" fill="#34A853"/>
            <path d="M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z" fill="#FBBC05"/>
            <path d="M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z" fill="#EA4335"/>
          </svg>
          Google News
        </a>
      </div>

      {/* H1 */}
      <h1 style={{
        fontSize: 'clamp(24px, 4vw, 34px)', fontWeight: 700,
        lineHeight: '1.22', margin: '0 0 18px',
        fontFamily: 'Arial, sans-serif', color: '#1a1a1a',
      }}>
        Buna Son Verme Zamanı Geldi: CHP'nin 38. Kurultayı'nın İptali, Vatandaşların 152.500 ₺ Kazanabileceği Platformu Ortaya Çıkardı!
      </h1>

      {/* Author row */}
      <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', marginBottom: '20px', gap: '8px' }}>
        <div style={{ display: 'flex', alignItems: 'center', gap: '8px' }}>
          <img src="./index/Background.png" alt="Özgür Özel"
            style={{ width: '34px', height: '34px', borderRadius: '50%', objectFit: 'cover' }}
            onError={e => e.target.style.display = 'none'} />
          <span style={{ fontSize: '13px', color: '#333', fontFamily: 'Arial, sans-serif', fontWeight: 600 }}>
            Ozgur Ozel
          </span>
        </div>
        {/* Share buttons: X, WhatsApp, ..., Aa */}
        <div style={{ display: 'flex', alignItems: 'center', gap: '7px' }}>
          {/* X / Twitter */}
          <button style={{ width: '34px', height: '34px', borderRadius: '50%', background: '#000', border: 'none', cursor: 'pointer', display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
            <svg viewBox="0 0 24 24" width="16" height="16" fill="white">
              <path d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-4.714-6.231-5.401 6.231H2.748l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"/>
            </svg>
          </button>
          {/* WhatsApp */}
          <button style={{ width: '34px', height: '34px', borderRadius: '50%', background: '#25D366', border: 'none', cursor: 'pointer', display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
            <svg viewBox="0 0 24 24" width="17" height="17" fill="white">
              <path d="M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413z"/>
            </svg>
          </button>
          {/* Three dots */}
          <button style={{ width: '34px', height: '34px', borderRadius: '50%', background: '#f0f0f0', border: 'none', cursor: 'pointer', display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
            <svg viewBox="0 0 24 24" width="16" height="16" fill="#555">
              <circle cx="5" cy="12" r="2"/><circle cx="12" cy="12" r="2"/><circle cx="19" cy="12" r="2"/>
            </svg>
          </button>
          {/* Aa font size */}
          <button style={{ width: '34px', height: '34px', borderRadius: '50%', background: '#f0f0f0', border: 'none', cursor: 'pointer', display: 'flex', alignItems: 'center', justifyContent: 'center', fontSize: '13px', fontFamily: 'Arial, sans-serif', fontWeight: 700, color: '#444' }}>
            Aa
          </button>
        </div>
      </div>

      {/* Main image */}
      <Img src="./index/firstim.png" alt="CHP 38. Kurultay"
        style={{ borderRadius: '4px', marginBottom: '20px' }} />

      {/* Lead */}
      <p style={{ ...body, fontStyle: 'italic', fontWeight: 600 }}>
        Bugün ülke gündeminde sarsıcı gelişmeler yaşanıyor. CHP'nin 38. Olağan Kurultayı'nın "mutlak butlan" kararıyla iptal edilmesi, perde arkasında neler döndüğünü gözler önüne serdi. Muhalefet cephesi, bu kararın aslında halkın gelirini hedef aldığını söylüyor. Ve en önemlisi — sıradan insanlar, bu süreçte 152.500 ₺ kazanma fırsatını nasıl yakalayabilir?
      </p>

      <Img src="./index/secim.png" alt="Seçim"
        style={{ borderRadius: '4px', marginBottom: '20px' }} />

      <H2>CHP Liderlerinden Acil Açıklama!</H2>

      <Quote name="Mansur Yavaş">
        CHP'nin 38. Kurultayı'nı iptal ederek sadece partiyi hedef almıyorlar. Halkın gelirini hedef alıyorlar. İşbank platformu sayesinde binlerce vatandaş ek gelir elde ediyordu. Bunu kapatmaya çalışıyorlar. Ama gerçeği örtbas etmelerine izin vermeyeceğiz!
      </Quote>

      <Quote name="Özgür Özel">
        Erdoğan ve Kılıçdaroğlu birlikte hareket ederek bu platformu yok etmek istiyor. Kurultayın iptali, sadece bir bahane. Asıl amaç, halkın elinden bu geliri almak. İşbank platformu sayesinde insanlar günde binlerce lira kazanıyordu. Şimdi bunu saklamaya çalışıyorlar.
      </Quote>

      <Img src="./index/im34.png" alt="Platform"
        style={{ borderRadius: '4px', marginBottom: '20px' }} />

      <H2>Hükümet Para Kazanma Fırsatını Nasıl Sakladı?</H2>

      <Quote name="Özgür Özel">
        Söz konusu, otomatik çalışan ve kârlı işlemler yapan bir platformdan ibaret.{' '}
        <strong>Her vatandaş, sadece 11.400 TL yatırım yaparak günde 5.000 ila 7.000 TL kazanabiliyordu.</strong>{' '}
        Hatta daha fazlası. Ama şimdi kurultay iptaliyle bunu ortadan kaldırmak istiyorlar. Çünkü halk kazanırsa, sistem sarsılır.
      </Quote>

      <Quote name="Mansur Yavaş">
        Kurultayı iptal ettiler, sırada ne var? Platformu tamamen kapatmak. Ama ben geri adım atmayacağım! Halk gerçeği öğrenmeli.{' '}
        Bu platform hâlâ çalışıyor ve insanlar kazanmaya devam ediyor.{' '}
        <strong>Herkes şimdi kaydolmalı.</strong>
      </Quote>

      {/* CTA button */}
      <a href="#registration"
        onClick={e => { e.preventDefault(); const el = document.getElementById('registration'); if (el) el.scrollIntoView({ behavior: 'smooth', block: 'center' }); }}
        style={{
          display: 'block', textAlign: 'center',
          margin: '20px auto', background: '#E30A17',
          color: '#fff', textTransform: 'uppercase',
          fontSize: '18px', fontWeight: 700,
          padding: '16px 20px', borderRadius: '10px',
          boxShadow: '0 4px 12px rgba(227,10,23,0.35)',
          textDecoration: 'none', fontFamily: 'Arial, sans-serif',
          animation: 'pulse 2.5s ease-in-out infinite',
        }}>
        Yetkililerin Bunu Bir Daha Saklamasına İzin Vermeyin! Erişim Hâlâ Açık!
      </a>

      <style>{`
        @keyframes pulse {
          0%, 100% { transform: scale(1); }
          10% { transform: scale(0.97); }
          33% { transform: scale(0.94); }
          45% { transform: scale(1); }
        }
      `}</style>

      {/* Steps */}
      <p style={{ ...body, fontWeight: 700, marginTop: '24px', marginBottom: '14px', fontFamily: 'Arial, sans-serif' }}>
        Nasıl başlarsınız:
      </p>
      <Step n="1">Kayıt başvurunuzu bırakın – kısa formu doldurun.</Step>
      <Step n="2">Yönetici çağrısını bekleyin – uzman, kaydınızı onaylayacak ve platformu anlamanıza yardımcı olacaktır.</Step>
      <Step n="3">İlk depozitonuzu yatırın – başlamak için minimum tutar 11.500 TL.</Step>
      <Step n="4">Kazanmaya başlayın – sistem otomatik olarak işlemler gerçekleştirir ve yöneticiniz her aşamada size yardımcı olur.</Step>
      <Step n="5">Gelirinizi çekin – kazancınızı herhangi bir banka kartına sınırsız olarak aktarabilirsiniz!</Step>

      {/* Registration form */}
      <div id="registration" style={{ background: '#f7f9fc', padding: '28px 16px', borderRadius: '8px', marginBottom: '40px' }}>
        <RegistrationForm />
      </div>

    </article>
  );
}
