// The 100 Club: monthly members' draw run by the club Treasurer.
// Copy supplied by the club (Nov 2026). £10 per number per month.
// HundredClubPage is the full page (#100-club); HundredClubPromo is the
// compact band on the home page.
// ---------------------------------------------------------------------------

const HUNDRED_CLUB = {
  price: '£10',
  per: 'per number, per month',
  prizes: 'Over £300 in prizes',
  contactName: 'Lisa Dentith',
  contactRole: 'Treasurer, Blackpool Wren Rovers FC',
  email: 'treasurer@blackpoolwrenrovers.co.uk',
};

const hundredClubMailto = () =>
  `mailto:${HUNDRED_CLUB.email}?subject=${encodeURIComponent('100 Club membership')}`;

const goHundredClub = () =>
  window.dispatchEvent(new CustomEvent('wren:navigate', { detail: { page: 'hundred' } }));

const HC_STEPS = [
  ['Choose your number', 'Pick your 100 Club number, or as many numbers as you like.'],
  ['Pay your contribution', `${HUNDRED_CLUB.price} per number, every month.`],
  ['Get entered in the draw', 'Every number you hold goes into our monthly prize draw.'],
  ['Win cash prizes', 'Have the chance to win cash prizes every single month.'],
];

const HC_USES = [
  'Improve and maintain our club facilities',
  "Support our men's and junior teams",
  'Invest in equipment and essential resources',
  'Develop our clubhouse and matchday facilities',
  'Support the long-term ambitions and growth of the football club',
];

const HundredClubPage = () => (
  <>
    {/* Headline band */}
    <section className="hc">
      <div className="container hc__grid">
        <div>
          <div className="mono hc__kicker">▸ {HUNDRED_CLUB.prizes.toUpperCase()}</div>
          <h2 className="display hc__title">Support your club.<br /><span>Be part of something special.</span></h2>
          <p className="hc__lede">
            Our 100 Club is a fantastic way to support the continued growth and development of Blackpool Wren Rovers FC,
            whilst giving members the opportunity to win cash prizes every month!
          </p>
          <p className="hc__lede hc__lede--soft">
            By becoming a member, you'll be making a regular contribution towards the running of our football club,
            helping us invest in our facilities, support our teams and provide opportunities for players of all ages
            across our senior and junior sections.
          </p>
          <div className="hc__actions">
            <Btn variant="primary" size="lg" as="a" href={hundredClubMailto()}>Join the 100 Club</Btn>
          </div>
        </div>
        <div className="hc__price" aria-label={`${HUNDRED_CLUB.price} ${HUNDRED_CLUB.per}`}>
          <div className="mono hc__priceTag">MEMBERSHIP</div>
          <div className="display hc__priceNum">{HUNDRED_CLUB.price}</div>
          <div className="mono hc__pricePer">{HUNDRED_CLUB.per.toUpperCase()}</div>
          <div className="hc__priceRule" />
          <div className="display hc__pricePrize">{HUNDRED_CLUB.prizes}</div>
          <div className="mono hc__pricePer">MONTHLY CASH DRAW</div>
        </div>
      </div>
      <StripeRule height={5} />
    </section>

    {/* How it works + where the money goes */}
    <section style={{ background: 'var(--paper)', padding: '80px 0 40px' }}>
      <div className="container">
        <SectionHead kicker="The 100 Club" title="How does it work?"
          right={<p style={{ maxWidth: 380, margin: 0, color: 'var(--muted)', fontSize: 14, lineHeight: 1.55 }}>
            The 100 Club is a monthly membership scheme where members purchase a number, or numbers, in our monthly draw.
          </p>} />
        <ol className="hc__steps">
          {HC_STEPS.map(([t, b], i) => (
            <li key={i}>
              <span className="display hc__stepNo">{String(i + 1).padStart(2, '0')}</span>
              <div className="display hc__stepTitle">{t}</div>
              <p>{b}</p>
            </li>
          ))}
        </ol>
      </div>
    </section>

    <section style={{ background: 'var(--paper)', padding: '40px 0 96px' }}>
      <div className="container hc__split">
        <div>
          <SectionHead kicker="Where does the money go?" title="Every penny stays at Brews Park." />
          <p style={{ fontSize: 15, lineHeight: 1.6, color: 'var(--ink)', maxWidth: 560, margin: '0 0 18px' }}>
            All money raised through the 100 Club goes towards supporting Blackpool Wren Rovers FC and our ongoing ambitions.
            Your contribution helps us:
          </p>
          <ul className="hc__uses">
            {HC_USES.map(u => <li key={u}>{u}</li>)}
          </ul>
          <p style={{ fontSize: 15, lineHeight: 1.6, color: 'var(--muted)', maxWidth: 560, margin: '22px 0 0' }}>
            Every membership makes a difference, helping us build a stronger future for Wren Rovers both on and off the pitch.
          </p>
        </div>

        <aside className="hc__contact">
          <div className="mono hc__kicker">▸ WANT TO GET INVOLVED?</div>
          <p style={{ margin: '12px 0 0', lineHeight: 1.6 }}>
            Becoming a member is a simple but meaningful way to support your local football club. Whether you're a player,
            parent, supporter, former player or local resident, we'd love to have you involved.
          </p>
          <p style={{ margin: '14px 0 0', lineHeight: 1.6, color: 'rgba(255,255,255,0.7)' }}>
            For further information, to enquire about availability or to become a member of the 100 Club, please contact:
          </p>
          <div className="hc__person">
            <div className="display" style={{ fontSize: 30, lineHeight: 1 }}>{HUNDRED_CLUB.contactName}</div>
            <div className="mono" style={{ fontSize: 10.5, letterSpacing: '0.16em', color: 'var(--red)', marginTop: 6, fontWeight: 700 }}>
              {HUNDRED_CLUB.contactRole.toUpperCase()}
            </div>
            <a href={hundredClubMailto()} className="hc__email">{HUNDRED_CLUB.email}</a>
          </div>
          <Btn variant="primary" size="md" as="a" href={hundredClubMailto()}>Email Lisa</Btn>
        </aside>
      </div>

      <div className="container">
        <p className="display hc__signoff">
          Every number counts. Every contribution matters. <span>Together, we can keep Wren Rovers moving forward.</span>
        </p>
      </div>
    </section>
  </>
);

// Compact band for the home page.
const HundredClubPromo = () => (
  <section className="hcPromo" aria-label="The 100 Club">
    <div className="container hcPromo__inner">
      <div className="hcPromo__copy">
        <div className="mono hc__kicker">▸ THE 100 CLUB · {HUNDRED_CLUB.prizes.toUpperCase()}</div>
        <div className="display hcPromo__title">Support your club. Win cash every month.</div>
        <p className="hcPromo__body">
          Pick a number for {HUNDRED_CLUB.price} a month. Every penny goes back into Wren Rovers, and every number is in the monthly draw.
        </p>
      </div>
      <div className="hcPromo__side">
        <div className="hcPromo__price">
          <span className="display">{HUNDRED_CLUB.price}</span>
          <span className="mono">PER NUMBER<br />PER MONTH</span>
        </div>
        <Btn variant="primary" size="md" as="a" href="#100-club"
          onClick={(e) => { e.preventDefault(); goHundredClub(); }}>Find out more</Btn>
      </div>
    </div>
  </section>
);

Object.assign(window, { HundredClubPage, HundredClubPromo });
