import type { Metadata } from "next";
import Link from "next/link";
import { PageHero } from "@/components/patterns/PageHero";
import { SectionHeading } from "@/components/patterns/SectionHeading";
import { NewsletterBlock } from "@/components/patterns/NewsletterBlock";
import { Card, CardContent, CardTitle, CardDescription } from "@/components/ui/Card";
import { formatDocumentDate } from "@/lib/utils";

export const metadata: Metadata = {
  title: "Insights",
  description:
    "Reporting on how funding actually moves — sector explainers and dated reports on CSR matchmaking, MSME growth capital, and government funding programs.",
  alternates: { canonical: "/insights" },
  openGraph: {
    title: "Insights — ROPTS Venture Capital",
    description:
      "Reporting on how funding actually moves — sector explainers and dated reports from ROPTS Venture Capital.",
    type: "website",
    url: "/insights",
  },
};

/** Same real, dated editorial set as components/sections/FeaturedInsights.tsx — no fabricated additional articles. */
const articles = [
  {
    title: "How CSR Matchmaking Actually Works",
    href: "/insights/how-csr-matchmaking-works",
    date: "2026-06-02",
    summary:
      "A walkthrough of how Schedule VII mandates get matched to verified NGOs and Trusts — and why most CSR budgets go unspent.",
  },
  {
    title: "What Investors Look for in an MSME Growth Round",
    href: "/insights/msme-growth-capital-readiness",
    date: "2026-05-18",
    summary: "The financial governance and documentation gaps that most often stall an MSME growth-capital raise.",
  },
  {
    title: "2026 Funding Landscape: Grants & Government Programs",
    href: "/insights/reports/2026-grants-and-government-funding",
    date: "2026-04-30",
    summary: "A dated review of active government funding programs and how NGOs and social enterprises typically qualify.",
  },
];

export default function InsightsPage() {
  return (
    <>
      <PageHero
        breadcrumb={[{ label: "Home", href: "/" }, { label: "Insights" }]}
        eyebrow="Insights"
        title="Insights"
        description="Reporting on how funding actually moves — sector explainers and dated reports, not generic fundraising advice."
      />

      <div className="container py-16">
        <h2 className="sr-only">Articles</h2>
        <div className="grid gap-6 md:grid-cols-3">
          {articles.map((article) => (
            <Link key={article.href} href={article.href}>
              <Card className="h-full">
                <CardContent>
                  <time dateTime={article.date} className="font-mono text-[11px] uppercase tracking-wider text-slate">
                    {formatDocumentDate(article.date)}
                  </time>
                  <CardTitle className="mt-3 text-h4">{article.title}</CardTitle>
                  <CardDescription className="mt-2">{article.summary}</CardDescription>
                </CardContent>
              </Card>
            </Link>
          ))}
        </div>

        <div className="mt-20 max-w-xl rounded-md border border-line bg-paper p-8">
          <SectionHeading eyebrow="Stay Informed" title="Get dated funding-landscape reports" />
          <div className="mt-6">
            <NewsletterBlock />
          </div>
        </div>
      </div>
    </>
  );
}
