import type { Metadata } from "next";
import Link from "next/link";
import { ResponsiveImage } from "@/components/responsive-image";
import { assets } from "@/lib/site";
import { PostCard } from "@/components/post-card";
import { getPosts } from "@/lib/blog/repository";
import { Arrow } from "@/components/ui";
export const metadata: Metadata = {
  title: "A stronger democracy starts with us",
  alternates: { canonical: "/" },
};
export const dynamic = "force-dynamic";
export default async function HomePage() {
  const posts = await getPosts();
  return (
    <>
      <section className="hero">
        <div className="wrap hero-grid">
          <div className="hero-copy">
            <div className="eyebrow">An independent voice for Australia</div>
            <h1>
              The people <em>come first.</em>
            </h1>
            <p>
              Independent voices. Honest representation. A Parliament that
              answers to you.
            </p>
            <div className="hero-actions">
              <Link className="button" href="/our-plan/">
                Read our plan <Arrow />
              </Link>
              <Link className="text-link" href="/about-us/">
                About the movement <Arrow />
              </Link>
            </div>
            <div className="hero-note">
              Independent. Grassroots. Open to every Australian.
            </div>
          </div>
          <figure className="hero-visual">
            <div className="photo-heading">
              <span>A better way forward</span>
              <span>Australia / MBG</span>
            </div>
            <div className="photo-frame">
              <a
                className="image-link"
                href={assets.parliament}
                target="_blank"
                rel="noopener noreferrer"
                aria-label="View the full Parliament House photograph (opens in a new tab)"
              >
                <ResponsiveImage
                  image="parliament"
                  alt="Australian flag above Parliament House in Canberra"
                  sizes="(max-width: 380px) calc(100vw - 32px), (max-width: 620px) calc(100vw - 40px), (max-width: 1100px) 40vw, 420px"
                  priority
                />
                <span className="image-hint">
                  View full photo <Arrow />
                </span>
              </a>
            </div>
            <figcaption className="photo-caption">
              <span>Parliament House, Canberra</span>
              <span>Our Parliament. Our future.</span>
            </figcaption>
          </figure>
        </div>
      </section>

      <section className="values-bar" aria-label="Our guiding principles">
        <div className="wrap values-inner">
          <div className="value">
            <span className="value-number">01</span>
            <svg
              viewBox="0 0 24 24"
              fill="none"
              stroke="currentColor"
              aria-hidden="true"
            >
              <path d="M12 3 4 6v5c0 5 8 10 8 10s8-5 8-10V6l-8-3Z"></path>
              <path d="m8 12 3 3 5-6"></path>
            </svg>
            <div>
              <strong>Honesty &amp; integrity</strong>
              <small>Principles that come first</small>
            </div>
          </div>
          <div className="value">
            <span className="value-number">02</span>
            <svg
              viewBox="0 0 24 24"
              fill="none"
              stroke="currentColor"
              aria-hidden="true"
            >
              <circle cx="12" cy="8" r="3"></circle>
              <path d="M6 21v-3a6 6 0 0 1 12 0v3M4 7a3 3 0 0 0 0 6M20 7a3 3 0 0 1 0 6M2 20v-2a5 5 0 0 1 2-4M22 20v-2a5 5 0 0 0-2-4"></path>
            </svg>
            <div>
              <strong>People before parties</strong>
              <small>Independent representation</small>
            </div>
          </div>
          <div className="value">
            <span className="value-number">03</span>
            <svg
              viewBox="0 0 24 24"
              fill="none"
              stroke="currentColor"
              aria-hidden="true"
            >
              <path d="m12 3 9 5H3l9-5ZM5 10v8M10 10v8M15 10v8M20 10v8M3 21h18"></path>
            </svg>
            <div>
              <strong>True democracy</strong>
              <small>A voice for every Australian</small>
            </div>
          </div>
        </div>
      </section>

      <section className="section movement-intro">
        <div className="wrap intro-grid">
          <div className="intro-copy">
            <div className="eyebrow">A different way forward</div>
            <h2>
              Better government starts with <em>the people.</em>
            </h2>
            <p>
              We seek a Parliament of independent members who put their
              communities first and uphold the highest standards of integrity.
            </p>
            <p>
              This is an invitation to concerned citizens to help shape a better
              way forward — together.
            </p>
            <Link className="text-link" href="/about-us/">
              Meet the movement
              <span className="arrow" aria-hidden="true">
                ↗
              </span>
            </Link>
          </div>
          <figure className="campaign-image">
            <a
              className="campaign-frame"
              href={assets.campaign}
              target="_blank"
              rel="noopener noreferrer"
              aria-label="View the full campaign artwork (opens in a new tab)"
            >
              <ResponsiveImage
                image="campaign"
                alt="Australia’s undemocratic democracy: the original MBG campaign graphic"
                sizes="(max-width: 380px) calc(100vw - 64px), (max-width: 620px) calc(100vw - 72px), (max-width: 1100px) 42vw, 532px"
              />
            </a>
            <figcaption>
              <span>A conversation worth having.</span>
              <span>MBG / Australia</span>
            </figcaption>
          </figure>
        </div>
      </section>

      <section className="section pillars">
        <div className="wrap">
          <div className="section-head">
            <div>
              <div className="eyebrow">The principles behind the movement</div>
              <h2>
                Representation. <em>With principle.</em>
              </h2>
            </div>
            <p>
              Representatives who answer to their communities and act in the
              national interest.
            </p>
          </div>
          <div className="pillar-grid">
            <article className="pillar">
              <span className="number">01 /</span>
              <h3>Integrity first.</h3>
              <p>
                A Parliament of independent members sworn to honesty, integrity
                and incorruptibility.
              </p>
              <Link className="text-link" href="/about-us/">
                Our vision
                <span className="arrow" aria-hidden="true">
                  ↗
                </span>
              </Link>
            </article>
            <article className="pillar">
              <span className="number">02 /</span>
              <h3>Your voice matters.</h3>
              <p>
                Replacing political parties with independent parliamentarians
                who represent their constituents.
              </p>
              <Link className="text-link" href="/our-plan/">
                Explore our plan
                <span className="arrow" aria-hidden="true">
                  ↗
                </span>
              </Link>
            </article>
            <article className="pillar">
              <span className="number">03 /</span>
              <h3>Change starts locally.</h3>
              <p>
                Bringing Australians together to build a national movement for
                true democracy.
              </p>
              <Link className="text-link" href="/constitution/">
                Our constitution
                <span className="arrow" aria-hidden="true">
                  ↗
                </span>
              </Link>
            </article>
          </div>
        </div>
      </section>

      <section className="quote-band">
        <div className="wrap quote-inner">
          <div>
            <div className="quote-mark" aria-hidden="true">
              “
            </div>
            <h2>
              Government of the people, for the people,{" "}
              <span>by the people.</span>
            </h2>
          </div>
          <p>
            The principle at the heart of the Movement for Better Government.
          </p>
        </div>
      </section>

      <section className="section">
        <div className="wrap">
          <div className="section-head">
            <div>
              <div className="eyebrow">Ideas, opinions &amp; perspectives</div>
              <h2>From the movement.</h2>
            </div>
            <Link className="text-link" href="/blog/">
              Visit the blog
              <span className="arrow" aria-hidden="true">
                ↗
              </span>
            </Link>
          </div>
          <div className="posts">
            {posts.slice(0, 3).map((post) => (
              <PostCard key={post.slug} post={post} />
            ))}
          </div>
        </div>
      </section>

      <section className="section participation">
        <div className="wrap intro-grid">
          <div>
            <div className="eyebrow">Participation, not donations</div>
            <h2>
              Bring your voice. <em>That’s what matters.</em>
            </h2>
          </div>
          <div className="intro-copy">
            <p>
              “Donations will never be required as there will be no need for an
              advertising budget!”
            </p>
            <p>
              Read our constitution for the movement’s approach to membership
              and electoral expenses.
            </p>
            <Link className="text-link" href="/constitution/">
              Read our constitution
              <span className="arrow" aria-hidden="true">
                ↗
              </span>
            </Link>
          </div>
        </div>
      </section>
    </>
  );
}
