# Add the "Zigzag Features" block to this P1 project

Add a Puck component from P1 Blocks (https://p1-blocks.prolificdigital.io/blocks/zigzag-features) to this Pantheon Content Publisher (P1) Next.js project. Numbered rows that alternate photo and text sides to walk readers through a program or process.

## Steps

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

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

/**
 * Zigzag Features — numbered rows that alternate photo and text sides, for walking a reader
 * through a program, a process or a set of services one idea at a time. Stacks on phones.
 * Register: `ZigzagFeaturesBlock: zigzagFeaturesBlock` in puck.config.tsx.
 */

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

export type ZigzagFeaturesProps = {
  eyebrow: string;
  heading: string;
  headingLevel: Heading;
  intro: string;
  startSide: "left" | "right";
  showNumbers: boolean;
  rows: {
    kicker: string;
    title: string;
    text: string;
    imageUrl: string;
    imageAlt: string;
    linkLabel: string;
    linkHref: string;
  }[];
};

const childHeading: Record<Heading, "h2" | "h3" | "h4" | "h5"> = { h1: "h2", h2: "h3", h3: "h4", h4: "h5" };

export const zigzagFeaturesBlock: ComponentConfig<ZigzagFeaturesProps> = {
  label: "Zigzag Features",
  fields: {
    eyebrow: { type: "text", label: "Eyebrow", metadata: { help: "Small line above the heading. Leave blank to hide it." } },
    heading: { type: "text", 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. Row titles use the next level down." },
    },
    intro: { type: "textarea", label: "Intro" },
    startSide: {
      type: "radio",
      label: "First photo",
      options: [
        { label: "Left", value: "left" },
        { label: "Right", value: "right" },
      ],
      metadata: { help: "Which side the first row's photo sits on. Rows alternate from there. Phones always show the photo first." },
    },
    showNumbers: {
      type: "radio",
      label: "Numbers",
      options: [
        { label: "Show", value: true },
        { label: "Hide", value: false },
      ],
      metadata: { help: "Shows 01, 02, 03… beside each title. Useful when the order matters." },
    },
    rows: {
      type: "array",
      label: "Rows",
      min: 1,
      max: 8,
      getItemSummary: (item) => item?.title?.slice(0, 48) || "Row",
      defaultItemProps: {
        kicker: "",
        title: "New row",
        text: "A short paragraph explaining this idea.",
        imageUrl: "https://picsum.photos/seed/meadow/1200/900",
        imageAlt: "",
        linkLabel: "",
        linkHref: "",
      },
      arrayFields: {
        kicker: { type: "text", label: "Kicker", metadata: { help: "Short label above the title. Leave blank to hide it." } },
        title: { type: "text", label: "Title" },
        text: { type: "textarea", label: "Text", metadata: { help: "Blank lines start a new paragraph." } },
        imageUrl: { type: "text", label: "Image URL" },
        imageAlt: { type: "text", label: "Image alt text", metadata: { help: "Describe the photo for screen reader users. Leave blank only if it's purely decorative." } },
        linkLabel: { type: "text", label: "Link text", metadata: { help: "Leave blank to hide the link." } },
        linkHref: { type: "text", label: "Link" },
      },
    },
  },
  defaultProps: {
    eyebrow: "How the scholarship works",
    heading: "From application to graduation, we stay beside you",
    headingLevel: "h2",
    intro: "The Bridge Scholarship is more than a check. Every scholar gets a coach, a cohort and emergency support for all four years.",
    startSide: "left",
    showNumbers: true,
    rows: [
      {
        kicker: "January – March",
        title: "Apply with one short form",
        text: "No essays, no recommendation letters. Tell us about your goals in a ten-minute form, and upload your financial aid award letter when you have it.",
        imageUrl: "https://picsum.photos/seed/application/1200/900",
        imageAlt: "A student working on a laptop at a kitchen table with a notebook beside her",
        linkLabel: "Check eligibility",
        linkHref: "/scholarship/eligibility",
      },
      {
        kicker: "Every semester",
        title: "Meet your success coach",
        text: "Coaches are trained alumni who meet with you every two weeks, help you register for classes and know who to call when something goes sideways.",
        imageUrl: "https://picsum.photos/seed/mentor/1200/900",
        imageAlt: "Two people talking across a café table, one taking notes",
        linkLabel: "",
        linkHref: "",
      },
      {
        kicker: "When life happens",
        title: "Emergency grants within 48 hours",
        text: "A car repair or a rent gap shouldn't end a degree. Scholars can request up to $1,500 a year for urgent costs, and most requests are paid in two days.",
        imageUrl: "https://picsum.photos/seed/campuswalk/1200/900",
        imageAlt: "Students walking across a tree-lined campus quad in autumn",
        linkLabel: "How emergency grants work",
        linkHref: "/scholarship/emergency-grants",
      },
    ],
  },
  render: ({ eyebrow, heading, headingLevel, intro, startSide, showNumbers, rows }) => {
    const H = headingLevel || "h2";
    const Item = childHeading[H] ?? "h3";
    const list = (rows ?? []).filter((r) => r?.title || r?.text);
    const hasHeader = Boolean(eyebrow || heading || intro);
    const flipFirst = startSide === "right";
    return (
      <section className="bg-white px-4 py-16 sm:px-6 sm:py-20 lg:px-8 lg:py-24">
        <div className="mx-auto max-w-7xl">
          {hasHeader ? (
            <div className="max-w-2xl">
              {eyebrow ? <p className="text-sm font-semibold tracking-wide text-indigo-700 uppercase">{eyebrow}</p> : null}
              {heading ? (
                <H className={`${eyebrow ? "mt-3" : ""} text-3xl font-semibold tracking-tight text-balance text-neutral-950 sm:text-4xl`}>{heading}</H>
              ) : null}
              {intro ? <p className="mt-4 text-lg leading-8 text-pretty text-neutral-600">{intro}</p> : null}
            </div>
          ) : null}

          {list.length > 0 ? (
            <ol role="list" className={`${hasHeader ? "mt-14 sm:mt-20" : ""} space-y-16 sm:space-y-24`}>
              {list.map((row, i) => {
                const imageRight = (i % 2 === 1) !== flipFirst;
                const paragraphs = (row.text || "").split(/\n\s*\n/).map((p) => p.trim()).filter(Boolean);
                return (
                  <li
                    key={`${row.title}-${i}`}
                    className={`grid grid-cols-1 gap-8 ${row.imageUrl ? "lg:grid-cols-12 lg:items-center lg:gap-16" : "max-w-3xl"}`}
                  >
                    {row.imageUrl ? (
                      <div className={`relative lg:col-span-7 ${imageRight ? "lg:order-last" : ""}`}>
                        <span
                          aria-hidden="true"
                          className={`absolute inset-0 hidden rounded-3xl bg-indigo-50 ring-1 ring-indigo-600/10 sm:block ${imageRight ? "translate-x-4 translate-y-4" : "-translate-x-4 translate-y-4"}`}
                        />
                        <img
                          src={row.imageUrl}
                          alt={row.imageAlt || ""}
                          className="relative aspect-4/3 w-full rounded-3xl bg-neutral-100 object-cover ring-1 ring-neutral-950/5"
                        />
                      </div>
                    ) : null}
                    <div className={row.imageUrl ? "lg:col-span-5" : undefined}>
                      <div className="flex items-baseline gap-4">
                        {showNumbers ? (
                          <span aria-hidden="true" className="text-sm font-semibold text-indigo-700 tabular-nums">
                            {String(i + 1).padStart(2, "0")}
                          </span>
                        ) : null}
                        {row.kicker ? <p className="text-sm font-medium text-neutral-600">{row.kicker}</p> : null}
                      </div>
                      {showNumbers || row.kicker ? <span aria-hidden="true" className="mt-4 block h-px w-12 bg-neutral-300" /> : null}
                      {row.title ? (
                        <Item className={`${showNumbers || row.kicker ? "mt-5" : ""} text-2xl font-semibold tracking-tight text-balance text-neutral-950 sm:text-3xl`}>
                          {row.title}
                        </Item>
                      ) : null}
                      {paragraphs.length > 0 ? (
                        <div className="mt-4 space-y-4 text-base leading-7 text-pretty text-neutral-600 sm:text-lg sm:leading-8">
                          {paragraphs.map((para, j) => (
                            <p key={j}>{para}</p>
                          ))}
                        </div>
                      ) : null}
                      {row.linkLabel ? (
                        <p className="mt-6">
                          <a
                            href={row.linkHref || "#"}
                            className="group inline-flex min-h-11 items-center gap-1.5 rounded-sm font-semibold text-indigo-700 hover:text-indigo-900 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600"
                          >
                            {row.linkLabel}
                            <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="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>
                        </p>
                      ) : null}
                    </div>
                  </li>
                );
              })}
            </ol>
          ) : null}
        </div>
      </section>
    );
  },
};
```
