# Add the "CTA Split Image" block to this P1 project

Add a Puck component from P1 Blocks (https://p1-blocks.prolificdigital.io/blocks/cta-split-image) to this Pantheon Content Publisher (P1) Next.js project. Full-bleed call to action with copy and two buttons beside a photo that runs the full section height.

## Steps

1. Create `components/puck/cta-split-image-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 { ctaSplitImageBlock } from "./components/puck/cta-split-image-block";`
3. Register it under `components` as `CtaSplitImageBlock: ctaSplitImageBlock`.
4. Add `"CtaSplitImageBlock"` to the best-fitting entry in `categories` (this block's library category is "Conversion"). 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/cta-split-image-block.tsx`

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

/**
 * CTA Split Image — a full-bleed call to action: copy and two buttons on one half, a photo
 * running the full height of the section on the other. Image stacks on top on phones.
 * Register: `CtaSplitImageBlock: ctaSplitImageBlock` in puck.config.tsx.
 */

type Heading = "h1" | "h2" | "h3" | "h4";
type Tone = "light" | "tint" | "dark";

export type CtaSplitImageProps = {
  eyebrow: string;
  heading: string;
  headingLevel: Heading;
  body: string;
  primaryLabel: string;
  primaryHref: string;
  secondaryLabel: string;
  secondaryHref: string;
  footnote: string;
  imageUrl: string;
  imageAlt: string;
  imageSide: "left" | "right";
  tone: Tone;
};

const tones: Record<Tone, { section: string; eyebrow: string; heading: string; body: string; foot: string; primary: string; secondary: string; ring: string }> = {
  light: {
    section: "bg-white",
    eyebrow: "text-indigo-700",
    heading: "text-neutral-950",
    body: "text-neutral-600",
    foot: "text-neutral-600 border-neutral-200",
    primary: "bg-indigo-600 text-white hover:bg-indigo-700",
    secondary: "text-neutral-950 ring-1 ring-neutral-300 ring-inset hover:bg-neutral-50",
    ring: "focus-visible:outline-indigo-600",
  },
  tint: {
    section: "bg-indigo-50",
    eyebrow: "text-indigo-700",
    heading: "text-neutral-950",
    body: "text-neutral-700",
    foot: "text-neutral-700 border-indigo-200",
    primary: "bg-indigo-600 text-white hover:bg-indigo-700",
    secondary: "bg-white text-indigo-800 ring-1 ring-indigo-200 ring-inset hover:bg-indigo-100",
    ring: "focus-visible:outline-indigo-600",
  },
  dark: {
    section: "bg-neutral-950",
    eyebrow: "text-indigo-300",
    heading: "text-white",
    body: "text-neutral-300",
    foot: "text-neutral-400 border-white/10",
    primary: "bg-white text-neutral-950 hover:bg-indigo-50",
    secondary: "text-white ring-1 ring-white/25 ring-inset hover:bg-white/10",
    ring: "focus-visible:outline-white",
  },
};

export const ctaSplitImageBlock: ComponentConfig<CtaSplitImageProps> = {
  label: "CTA Split Image",
  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", value: "h1" },
        { label: "H2", value: "h2" },
        { label: "H3", value: "h3" },
        { label: "H4", value: "h4" },
      ],
      metadata: { help: "Sets the page outline for screen readers and search. 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 (/volunteer), full URL, #anchor, mailto: or tel:." } },
    secondaryLabel: { type: "text", label: "Secondary button text", metadata: { help: "Leave blank to hide it." } },
    secondaryHref: { type: "text", label: "Secondary button link" },
    footnote: { type: "text", label: "Footnote", metadata: { help: "A reassuring detail under the buttons, such as time commitment. Leave blank to hide it." } },
    imageUrl: { type: "text", label: "Image URL", metadata: { help: "Cropped to fill its half of the section, so keep the subject near the center." } },
    imageAlt: { type: "text", label: "Image alt text", metadata: { help: "Describe what the photo shows. Leave blank only if it's purely decorative." } },
    imageSide: {
      type: "radio",
      label: "Image side",
      options: [
        { label: "Left", value: "left" },
        { label: "Right", value: "right" },
      ],
      metadata: { help: "On wide screens. On phones the image always sits above the copy." },
    },
    tone: {
      type: "select",
      label: "Background",
      options: [
        { label: "White", value: "light" },
        { label: "Indigo tint", value: "tint" },
        { label: "Dark", value: "dark" },
      ],
    },
  },
  defaultProps: {
    eyebrow: "Saturday crews",
    heading: "Three hours, one riverbank, a lot less trash",
    headingLevel: "h2",
    body: "Join a cleanup crew on the second Saturday of each month. We bring gloves, grabbers and coffee; you bring a friend. Last season, 600 volunteers cleared 14 tons from the Ohio's edge.",
    primaryLabel: "Join a crew",
    primaryHref: "/volunteer/cleanups",
    secondaryLabel: "See this month's site",
    secondaryHref: "/volunteer/cleanups#next",
    footnote: "Ages 12 and up · No experience needed · Figures are sample data",
    imageUrl: "https://picsum.photos/seed/riverbank/1200/1400",
    imageAlt: "Volunteers in work gloves carrying full bags along a muddy riverbank in morning light",
    imageSide: "right",
    tone: "tint",
  },
  render: ({ eyebrow, heading, headingLevel, body, primaryLabel, primaryHref, secondaryLabel, secondaryHref, footnote, imageUrl, imageAlt, imageSide, tone }) => {
    const H = headingLevel || "h2";
    const t = tones[tone] ?? tones.light;
    const left = imageSide === "left";
    const btn = `inline-flex min-h-11 items-center justify-center gap-2 rounded-lg px-6 py-3 text-base font-semibold transition focus-visible:outline-2 focus-visible:outline-offset-2 ${t.ring}`;
    if (!heading && !body && !primaryLabel && !imageUrl) return <></>;

    return (
      <section className={`relative isolate overflow-hidden ${t.section}`}>
        {imageUrl ? (
          <div className={`relative h-64 sm:h-80 lg:absolute lg:inset-y-0 lg:h-full lg:w-1/2 ${left ? "lg:left-0" : "lg:right-0"}`}>
            <img src={imageUrl} alt={imageAlt || ""} className="absolute inset-0 size-full object-cover" />
          </div>
        ) : null}
        <div className="mx-auto max-w-7xl px-4 py-16 sm:px-6 sm:py-20 lg:px-8 lg:py-28">
          <div className={imageUrl ? (left ? "lg:ml-auto lg:w-1/2 lg:pl-16 xl:pl-20" : "lg:w-1/2 lg:pr-16 xl:pr-20") : "mx-auto max-w-2xl text-center"}>
            {eyebrow ? <p className={`text-sm font-semibold ${t.eyebrow}`}>{eyebrow}</p> : null}
            {heading ? (
              <H className={`text-3xl font-semibold tracking-tight text-balance sm:text-4xl lg:text-5xl ${t.heading} ${eyebrow ? "mt-3" : ""}`}>{heading}</H>
            ) : null}
            {body ? <p className={`mt-6 text-lg leading-8 text-pretty ${t.body}`}>{body}</p> : null}
            {primaryLabel || secondaryLabel ? (
              <div className={`mt-10 flex flex-col gap-3 sm:flex-row sm:flex-wrap ${imageUrl ? "" : "sm:justify-center"}`}>
                {primaryLabel ? (
                  <a href={primaryHref || "#"} className={`${btn} shadow-xs ${t.primary}`}>
                    {primaryLabel}
                    <svg aria-hidden="true" viewBox="0 0 20 20" fill="currentColor" className="size-5">
                      <path fillRule="evenodd" d="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" clipRule="evenodd" />
                    </svg>
                  </a>
                ) : null}
                {secondaryLabel ? (
                  <a href={secondaryHref || "#"} className={`${btn} ${t.secondary}`}>
                    {secondaryLabel}
                  </a>
                ) : null}
              </div>
            ) : null}
            {footnote ? <p className={`mt-10 border-t pt-6 text-sm leading-6 ${t.foot}`}>{footnote}</p> : null}
          </div>
        </div>
      </section>
    );
  },
};
```
