// Sections.jsx — Maison Gifts
// About · Product Categories · Why Choose · Corporate & Event band.

// ── About ────────────────────────────────────────────────────
const About = () => {
  const c = useContent();
  return (
    <section id="about" style={{ background: 'var(--cream)', padding: 'var(--space-32) var(--space-8)' }}>
      <div style={{ maxWidth: 1180, margin: '0 auto' }}>
        {/* Header — centered */}
        <Reveal style={{ textAlign: 'center', maxWidth: 760, margin: '0 auto var(--space-12)' }}>
          <div style={{ display: 'flex', justifyContent: 'center' }}><Overline center>{c.about.overline}</Overline></div>
          <h2 style={{
            fontFamily: 'var(--font-display)', fontWeight: 500, color: 'var(--navy-ink)',
            fontSize: 'clamp(34px,4vw,54px)', lineHeight: 1.08, letterSpacing: '-0.01em', margin: '20px 0 0',
          }}>{c.about.title}</h2>
        </Reveal>

        {/* Banner image — centered */}
        <Reveal delay={80} style={{ position: 'relative' }}>
          <Img src={IMG.about} label={c.about.photo} ratio="8 / 3" radius="var(--radius-2xl)" objectPosition="center" />
          <div style={{
            position: 'absolute', top: -18, right: -18, width: 92, height: 92,
            borderRadius: 'var(--radius-full)', background: 'var(--burgundy)', color: '#F6F1E6',
            display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center',
            boxShadow: 'rgba(0,0,0,0.15) 0px 12px 30px', textAlign: 'center',
          }}>
            <span style={{ fontFamily: 'var(--font-display)', fontWeight: 600, fontSize: 26, lineHeight: 1 }}>15+</span>
            <span style={{ fontFamily: 'var(--font-sans)', fontSize: 9, letterSpacing: '0.12em', textTransform: 'uppercase', marginTop: 4, opacity: 0.85 }}>Years</span>
          </div>
        </Reveal>

        {/* Sentences — below image, centered */}
        <div style={{ maxWidth: 780, margin: 'var(--space-12) auto 0', textAlign: 'center' }}>
          {c.about.body.map((p, i) => (
            <Reveal key={i} delay={130 + i * 70}>
              <p style={{
                fontFamily: 'var(--font-sans)', fontWeight: 300, fontSize: 18, lineHeight: 1.72,
                color: 'var(--text-2)', margin: i === 0 ? 0 : '18px 0 0',
              }}>{p}</p>
            </Reveal>
          ))}
          <Reveal delay={300}>
            <div style={{ display: 'flex', flexWrap: 'wrap', justifyContent: 'center', gap: '14px 30px', marginTop: 32 }}>
              {c.about.points.map((pt, i) => (
                <div key={i} style={{ display: 'flex', alignItems: 'center', gap: 11 }}>
                  <span style={{
                    width: 26, height: 26, borderRadius: 'var(--radius-full)', flexShrink: 0,
                    background: 'rgba(122,42,56,0.1)', color: 'var(--burgundy)',
                    display: 'flex', alignItems: 'center', justifyContent: 'center',
                  }}>
                    <i data-lucide="check" style={{ width: 14, height: 14, strokeWidth: 2.4 }}></i>
                  </span>
                  <span style={{ fontFamily: 'var(--font-sans)', fontSize: 16, color: 'var(--navy-ink)', fontWeight: 400 }}>{pt}</span>
                </div>
              ))}
            </div>
          </Reveal>
        </div>
      </div>
    </section>
  );
};

// ── Product Categories ───────────────────────────────────────
const Categories = () => {
  const c = useContent();
  return (
    <section id="products" style={{ background: 'var(--cream-deep)', padding: 'var(--space-32) var(--space-8)' }}>
      <div style={{ maxWidth: 1280, margin: '0 auto' }}>
        <Reveal style={{ maxWidth: 720, marginBottom: 'var(--space-16)' }}>
          <Overline>{c.categories.overline}</Overline>
          <h2 style={{
            fontFamily: 'var(--font-display)', fontWeight: 500, color: 'var(--navy-ink)',
            fontSize: 'clamp(34px,4vw,54px)', lineHeight: 1.08, letterSpacing: '-0.01em', margin: '20px 0 0',
          }}>{c.categories.title}</h2>
          <p style={{ fontFamily: 'var(--font-sans)', fontWeight: 300, fontSize: 18, lineHeight: 1.7, color: 'var(--text-2)', margin: '18px 0 0' }}>{c.categories.sub}</p>
        </Reveal>

        <div className="mg-cat-grid" style={{ display: 'grid', gridTemplateColumns: 'repeat(3, 1fr)', gap: 'var(--space-5)' }}>
          {c.categories.items.map((it, i) => (
            <Reveal key={i} delay={i * 60}>
              <article tabIndex={0} className="mg-cat-card" style={{
                background: 'var(--ivory)', border: '1px solid var(--grey-line)', borderRadius: 'var(--radius-lg)',
                padding: 'var(--space-6)', height: '100%', cursor: 'default',
                transition: 'transform 220ms cubic-bezier(0.16,1,0.3,1), box-shadow 220ms ease, border-color 220ms ease',
              }}
              onMouseEnter={e => { e.currentTarget.style.transform = 'translateY(-5px)'; e.currentTarget.style.boxShadow = 'var(--shadow-whisper)'; e.currentTarget.style.borderColor = 'var(--burgundy)'; }}
              onMouseLeave={e => { e.currentTarget.style.transform = 'none'; e.currentTarget.style.boxShadow = 'none'; e.currentTarget.style.borderColor = 'var(--grey-line)'; }}>
                <span style={{
                  width: 52, height: 52, borderRadius: 'var(--radius-md)',
                  background: 'var(--navy)', color: 'var(--burgundy-soft)',
                  display: 'flex', alignItems: 'center', justifyContent: 'center', marginBottom: 22,
                }}>
                  <i data-lucide={it.icon} style={{ width: 24, height: 24, strokeWidth: 1.5, color: '#F6F1E6' }}></i>
                </span>
                <h3 style={{ fontFamily: 'var(--font-display)', fontWeight: 600, fontSize: 23, color: 'var(--navy-ink)', margin: 0, lineHeight: 1.2 }}>{it.name}</h3>
                <p style={{ fontFamily: 'var(--font-sans)', fontWeight: 300, fontSize: 15, lineHeight: 1.65, color: 'var(--text-2)', margin: '12px 0 0' }}>{it.desc}</p>
              </article>
            </Reveal>
          ))}
        </div>
      </div>
    </section>
  );
};

// ── Why Choose ───────────────────────────────────────────────
const WhyChoose = () => {
  const c = useContent();
  return (
    <section id="why" style={{ background: 'var(--cream)', padding: 'var(--space-32) var(--space-8)' }}>
      <div style={{ maxWidth: 1280, margin: '0 auto' }}>
        <Reveal style={{ textAlign: 'center', maxWidth: 700, margin: '0 auto var(--space-16)' }}>
          <div style={{ display: 'flex', justifyContent: 'center' }}><Overline center>{c.why.overline}</Overline></div>
          <h2 style={{
            fontFamily: 'var(--font-display)', fontWeight: 500, color: 'var(--navy-ink)',
            fontSize: 'clamp(34px,4vw,54px)', lineHeight: 1.08, letterSpacing: '-0.01em', margin: '20px 0 0',
          }}>{c.why.title}</h2>
          <p style={{ fontFamily: 'var(--font-sans)', fontWeight: 300, fontSize: 18, lineHeight: 1.7, color: 'var(--text-2)', margin: '16px auto 0' }}>{c.why.sub}</p>
        </Reveal>

        <div className="mg-why-grid" style={{ display: 'grid', gridTemplateColumns: 'repeat(4, 1fr)', gap: 'var(--space-5)' }}>
          {c.why.items.map((it, i) => (
            <Reveal key={i} delay={i * 70}>
              <div style={{ textAlign: 'left', padding: 'var(--space-2)', height: '100%' }}>
                <span style={{
                  width: 56, height: 56, borderRadius: 'var(--radius-full)',
                  border: '1px solid var(--burgundy)', color: 'var(--burgundy)',
                  display: 'flex', alignItems: 'center', justifyContent: 'center', marginBottom: 20,
                }}>
                  <i data-lucide={it.icon} style={{ width: 24, height: 24, strokeWidth: 1.5 }}></i>
                </span>
                <h3 style={{ fontFamily: 'var(--font-display)', fontWeight: 600, fontSize: 21, color: 'var(--navy-ink)', margin: 0, lineHeight: 1.25 }}>{it.name}</h3>
                <p style={{ fontFamily: 'var(--font-sans)', fontWeight: 300, fontSize: 15, lineHeight: 1.65, color: 'var(--text-2)', margin: '12px 0 0' }}>{it.desc}</p>
              </div>
            </Reveal>
          ))}
        </div>
      </div>
    </section>
  );
};

// ── Corporate & Event band ───────────────────────────────────
const Corporate = () => {
  const c = useContent();
  return (
    <section id="corporate" style={{
      background: '#0D1526',
      color: '#F6F1E6', padding: 'var(--space-32) var(--space-8)', position: 'relative', overflow: 'hidden'
    }}>
      {/* batik umbrella photography — full bleed */}
      <div aria-hidden="true" style={{
        position: 'absolute', inset: 0,
        backgroundImage: 'url(maison/img/corporate-bg.png)',
        backgroundSize: 'cover', backgroundPosition: 'center right',
        pointerEvents: 'none'
      }}></div>
      {/* navy gradient — darker on the left so copy reads, batik shows on the right */}
      <div aria-hidden="true" style={{
        position: 'absolute', inset: 0, pointerEvents: 'none',
        background: 'linear-gradient(100deg, rgba(13,21,38,0.96) 0%, rgba(15,23,42,0.9) 34%, rgba(18,28,48,0.66) 60%, rgba(18,28,48,0.42) 100%)'
      }}></div>
      {/* faint vertical rule texture */}
      <div aria-hidden="true" style={{
        position: 'absolute', inset: 0,
        backgroundImage: 'linear-gradient(90deg, rgba(246,241,230,0.04) 1px, transparent 1px)',
        backgroundSize: '88px 100%', pointerEvents: 'none',
      }}></div>
      <div style={{ maxWidth: 1280, margin: '0 auto', position: 'relative', zIndex: 1 }}>
        <div className="mg-corp-grid" style={{ display: 'grid', gridTemplateColumns: '1fr', gap: 'var(--space-20)', alignItems: 'center' }}>
          <div style={{ maxWidth: 600 }}>
            <Reveal><Overline tone="cream">{c.corporate.overline}</Overline></Reveal>
            <Reveal delay={70}>
              <h2 style={{
                fontFamily: 'var(--font-display)', fontWeight: 500, color: '#F6F1E6',
                fontSize: 'clamp(32px,3.6vw,50px)', lineHeight: 1.1, letterSpacing: '-0.01em', margin: '22px 0 0',
              }}>{c.corporate.title}</h2>
            </Reveal>
            <Reveal delay={140}>
              <p style={{ fontFamily: 'var(--font-sans)', fontWeight: 300, fontSize: 18, lineHeight: 1.72, color: 'rgba(246,241,230,0.74)', margin: '22px 0 0', maxWidth: 520 }}>{c.corporate.body}</p>
            </Reveal>
            <Reveal delay={210}>
              <button onClick={() => scrollToId('contact')} style={{
                fontFamily: 'var(--font-sans)', fontSize: 15, fontWeight: 500, marginTop: 34,
                background: 'var(--burgundy)', color: '#F6F1E6', border: 'none', cursor: 'pointer',
                padding: '14px 26px', borderRadius: 'var(--radius-full)',
                display: 'inline-flex', alignItems: 'center', gap: 9, transition: 'background 160ms ease',
              }}
              onMouseEnter={e => e.currentTarget.style.background = 'var(--burgundy-deep)'}
              onMouseLeave={e => e.currentTarget.style.background = 'var(--burgundy)'}>
                {c.corporate.cta}
                <i data-lucide="arrow-right" style={{ width: 16, height: 16, strokeWidth: 2 }}></i>
              </button>
            </Reveal>
          </div>
        </div>

        <Reveal delay={80}>
          <div style={{ display: 'flex', flexWrap: 'wrap', gap: 12, marginTop: 'var(--space-12)' }}>
            {c.corporate.audiences.map((a, i) => (
              <div key={i} style={{
                background: 'var(--navy-900)', border: '1px solid rgba(246,241,230,0.1)',
                borderRadius: 'var(--radius-full)', padding: '12px 20px',
                display: 'flex', alignItems: 'center', gap: 11,
                transition: 'border-color 200ms ease',
              }}
              onMouseEnter={e => e.currentTarget.style.borderColor = 'var(--burgundy-soft)'}
              onMouseLeave={e => e.currentTarget.style.borderColor = 'rgba(246,241,230,0.1)'}>
                <span style={{ width: 7, height: 7, borderRadius: '50%', background: 'var(--burgundy-soft)', flexShrink: 0 }}></span>
                <span style={{ fontFamily: 'var(--font-sans)', fontSize: 14.5, fontWeight: 400, color: 'rgba(246,241,230,0.9)' }}>{a}</span>
              </div>
            ))}
          </div>
        </Reveal>
      </div>
    </section>
  );
};

Object.assign(window, { About, Categories, WhyChoose, Corporate });
