# Add the "Collage Hero" block to this P1 project

Add a Puck component from P1 Blocks (https://p1-blocks.prolificdigital.io/blocks/hero-collage) to this Pantheon Content Publisher (P1) Next.js project. Copy beside an asymmetric, overlapping three-photo mosaic with an optional round stamp badge.

## Steps

1. Create `components/puck/hero-collage-block.tsx` with the exact file contents below. If `components/puck/` doesn't exist, find the folder where this project keeps its Puck components (look at the imports in `puck.config.tsx`) and put it there.
2. In `puck.config.tsx`, import it: `import { heroCollageBlock } from "./components/puck/hero-collage-block";`
3. Register it under `components` as `HeroCollageBlock: heroCollageBlock`.
4. Add `"HeroCollageBlock"` to the best-fitting entry in `categories` (this block's library category is "Heroes"). Create a category only if none fits.
5. Run the project's type check (usually `pnpm typecheck`) and resolve anything project-specific.
6. If `package.json` has a `sync:registry` script, tell the user it must run (or that CI will run it) before the new component appears in the P1 editor.

## Rules

- Do not add dependencies. The block is self-contained by design: one type-only import from `@puckeditor/core`, Tailwind v4 classes, no client JavaScript.
- Keep the files as-is unless the user asks for changes. The accent color is `indigo-*`; if the project has brand colors, offer to swap them with a find-and-replace on `indigo-`.
- Images are plain `imageUrl` + `imageAlt` text fields. If this project defines a P1 media-library field (search for `"p1-media"`), offer to switch to it.
- Don't change prop names in `defaultProps`. Content editors' saved pages depend on them.

## File: `components/puck/hero-collage-block.tsx`

```tsx
import type { ComponentConfig } from "@puckeditor/core";

/**
 * Hero (Collage) — copy beside an asymmetric, overlapping mosaic of three photos with an
 * optional stamp badge. Good for programs with many faces and places.
 * Register: `HeroCollageBlock: heroCollageBlock` in puck.config.tsx.
 */

type Heading = "h1" | "h2" | "h3" | "h4";

export type HeroCollageProps = {
  eyebrow: string;
  heading: string;
  headingLevel: Heading;
  body: string;
  primaryLabel: string;
  primaryHref: string;
  secondaryLabel: string;
  secondaryHref: string;
  images: { imageUrl: string; imageAlt: string }[];
  badgeValue: string;
  badgeLabel: string;
};

// Placement on a 12×12 grid: a tall anchor photo, a smaller one riding high on the right,
// and a third overlapping the anchor's lower edge so the set reads as hand-arranged.
const TILES = [
  { cell: "col-start-1 col-end-9 row-start-1 row-end-10 z-0", img: "rounded-2xl" },
  { cell: "col-start-9 col-end-13 row-start-3 row-end-8 z-10", img: "rounded-xl" },
  { cell: "col-start-6 col-end-12 row-start-8 row-end-13 z-20", img: "rounded-xl ring-4 ring-white sm:ring-8" },
];

const ARROW = "M3 10a.75.75 0 0 1 .75-.75h10.64l-3.22-3.22a.75.75 0 1 1 1.06-1.06l4.5 4.5a.75.75 0 0 1 0 1.06l-4.5 4.5a.75.75 0 1 1-1.06-1.06l3.22-3.22H3.75A.75.75 0 0 1 3 10Z";

export const heroCollageBlock: ComponentConfig<HeroCollageProps> = {
  label: "Hero (Collage)",
  fields: {
    eyebrow: { type: "text", label: "Eyebrow", metadata: { help: "Small line above the heading. Leave blank to hide it." } },
    heading: { type: "textarea", label: "Heading" },
    headingLevel: {
      type: "select",
      label: "Heading level",
      options: [
        { label: "H1 (page title)", value: "h1" },
        { label: "H2", value: "h2" },
        { label: "H3", value: "h3" },
        { label: "H4", value: "h4" },
      ],
      metadata: { help: "Use H1 when this hero is the top of the page. The look doesn't change." },
    },
    body: { type: "textarea", label: "Body" },
    primaryLabel: { type: "text", label: "Primary button text" },
    primaryHref: { type: "text", label: "Primary button link", metadata: { help: "A path (/donate), full URL, #anchor, mailto: or tel:." } },
    secondaryLabel: { type: "text", label: "Secondary link text", metadata: { help: "Leave blank to hide it." } },
    secondaryHref: { type: "text", label: "Secondary link" },
    images: {
      type: "array",
      label: "Photos",
      min: 1,
      max: 3,
      getItemSummary: (item, i) => item?.imageAlt?.slice(0, 40) || `Photo ${(i ?? 0) + 1}`,
      defaultItemProps: { imageUrl: "https://picsum.photos/seed/gathering/900/900", imageAlt: "" },
      arrayFields: {
        imageUrl: { type: "text", label: "Image URL" },
        imageAlt: { type: "text", label: "Alt text", metadata: { help: "Describe the photo for screen reader users. Leave blank only if it's purely decorative." } },
      },
      metadata: { help: "Three photos fill the mosaic: a large one, a small one top right, and one overlapping the bottom. Square-ish photos crop best." },
    },
    badgeValue: { type: "text", label: "Badge value", metadata: { help: "A short figure or year on a round stamp, like 1962 or 40K. Leave blank to hide the badge." } },
    badgeLabel: { type: "text", label: "Badge label", metadata: { help: "Two or three words under the badge value." } },
  },
  defaultProps: {
    eyebrow: "Eastside Youth Arts",
    heading: "Studios, stages and mentors for every young artist",
    headingLevel: "h1",
    body: "Free after-school classes in painting, music, film and dance, taught by working artists in three neighborhood studios. No experience or audition needed.",
    primaryLabel: "Enroll a student",
    primaryHref: "/enroll",
    secondaryLabel: "Visit an open studio",
    secondaryHref: "/open-studio",
    images: [
      { imageUrl: "https://picsum.photos/seed/artstudio/900/1000", imageAlt: "Teenagers painting at easels in a sunlit studio" },
      { imageUrl: "https://picsum.photos/seed/drumline/600/700", imageAlt: "A student practicing on a drum kit" },
      { imageUrl: "https://picsum.photos/seed/dancefloor/800/700", imageAlt: "Young dancers rehearsing on a wooden stage" },
    ],
    badgeValue: "Since 1994",
    badgeLabel: "Free for every student",
  },
  render: ({ eyebrow, heading, headingLevel, body, primaryLabel, primaryHref, secondaryLabel, secondaryHref, images, badgeValue, badgeLabel }) => {
    const H = headingLevel || "h1";
    const photos = (images ?? []).filter((img) => img?.imageUrl).slice(0, 3);
    return (
      <section className="overflow-hidden bg-white px-4 py-16 sm:px-6 sm:py-20 lg:px-8 lg:py-24">
        <div className="mx-auto grid max-w-7xl grid-cols-1 items-center gap-12 lg:grid-cols-12 lg:gap-16">
          <div className="lg:col-span-5">
            {eyebrow ? <p className="text-sm font-semibold tracking-widest text-indigo-700 uppercase">{eyebrow}</p> : null}
            {heading ? (
              <H className={`${eyebrow ? "mt-4" : ""} text-4xl font-semibold tracking-tight text-balance text-neutral-950 sm:text-5xl lg:text-6xl`}>{heading}</H>
            ) : null}
            {body ? <p className="mt-6 max-w-xl text-lg leading-8 text-pretty text-neutral-600">{body}</p> : null}
            {primaryLabel || secondaryLabel ? (
              <div className="mt-8 flex flex-col gap-3 sm:flex-row sm:items-center sm:gap-6">
                {primaryLabel ? (
                  <a
                    href={primaryHref || "#"}
                    className="inline-flex min-h-11 items-center justify-center rounded-lg bg-indigo-600 px-5 py-3 text-base font-semibold text-white shadow-sm transition hover:bg-indigo-500 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600"
                  >
                    {primaryLabel}
                  </a>
                ) : null}
                {secondaryLabel ? (
                  <a
                    href={secondaryHref || "#"}
                    className="group inline-flex min-h-11 items-center justify-center gap-1.5 rounded-lg px-1 text-base font-semibold text-neutral-900 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600"
                  >
                    {secondaryLabel}
                    <svg aria-hidden="true" viewBox="0 0 20 20" fill="currentColor" className="size-5 transition group-hover:translate-x-0.5">
                      <path fillRule="evenodd" d={ARROW} clipRule="evenodd" />
                    </svg>
                  </a>
                ) : null}
              </div>
            ) : null}
          </div>

          {photos.length ? (
            <div className="relative lg:col-span-7">
              <div className="grid aspect-square grid-cols-12 grid-rows-12 gap-3 sm:gap-4">
                {photos.map((photo, i) => (
                  <div key={`${photo.imageUrl}-${i}`} className={`relative ${photos.length === 1 ? "col-span-12 row-span-12" : TILES[i].cell}`}>
                    <img src={photo.imageUrl} alt={photo.imageAlt || ""} className={`size-full bg-neutral-100 object-cover shadow-lg ${TILES[i].img}`} />
                  </div>
                ))}
              </div>
              {badgeValue ? (
                <div className="absolute bottom-2 left-2 z-30 grid size-28 -rotate-6 place-content-center rounded-full bg-indigo-600 p-3 text-center text-white shadow-xl ring-4 ring-white sm:size-36">
                  <p className="text-lg leading-tight font-semibold sm:text-xl">{badgeValue}</p>
                  {badgeLabel ? <p className="mt-1 text-xs leading-tight text-indigo-50">{badgeLabel}</p> : null}
                </div>
              ) : null}
            </div>
          ) : null}
        </div>
      </section>
    );
  },
};
```
