# Add the "Neighborhood Guides" block to this P1 project

Add a Puck component from P1 Blocks (https://p1-blocks.prolificdigital.io/blocks/neighborhood-guides) to this Pantheon Content Publisher (P1) Next.js project. Alternating photo-led district profiles with a vibe tagline, best-for tags, three top picks and an explore link.

## Steps

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

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

/**
 * Neighborhood Guides — alternating, photo-led profiles of a destination's districts:
 * a vibe tagline, "best for" tags, three top picks and an explore link for each.
 * Register: `NeighborhoodGuidesBlock: neighborhoodGuidesBlock` in puck.config.tsx.
 */

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

export type NeighborhoodGuidesProps = {
  eyebrow: string;
  heading: string;
  headingLevel: Heading;
  intro: string;
  neighborhoods: {
    name: string;
    tagline: string;
    imageUrl: string;
    imageAlt: string;
    bestFor: string;
    picks: string;
    linkLabel: string;
    linkHref: string;
  }[];
};

const childHeading: Record<Heading, "h2" | "h3" | "h4" | "h5"> = { h1: "h2", h2: "h3", h3: "h4", h4: "h5" };
const FOCUS = "focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600";
const ARROW = "M2 8a.75.75 0 0 1 .75-.75h8.69L8.22 4.03a.75.75 0 0 1 1.06-1.06l4.5 4.5a.75.75 0 0 1 0 1.06l-4.5 4.5a.75.75 0 0 1-1.06-1.06l3.22-3.22H2.75A.75.75 0 0 1 2 8Z";

const splitTags = (raw: string) => (raw || "").split(",").map((t) => t.trim()).filter(Boolean);

function parsePicks(raw: string) {
  return (raw || "")
    .split("\n")
    .map((line) => line.trim())
    .filter(Boolean)
    .slice(0, 3)
    .map((line) => {
      const bar = line.indexOf("|");
      return bar === -1 ? { name: line, note: "" } : { name: line.slice(0, bar).trim(), note: line.slice(bar + 1).trim() };
    });
}

export const neighborhoodGuidesBlock: ComponentConfig<NeighborhoodGuidesProps> = {
  label: "Neighborhood Guides",
  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. Neighborhood names use the next level down." },
    },
    intro: { type: "textarea", label: "Intro" },
    neighborhoods: {
      type: "array",
      label: "Neighborhoods",
      min: 1,
      max: 8,
      getItemSummary: (item) => item?.name || "Neighborhood",
      defaultItemProps: {
        name: "New neighborhood",
        tagline: "",
        imageUrl: "https://picsum.photos/seed/riverbend-neighborhood/1400/1000",
        imageAlt: "",
        bestFor: "",
        picks: "",
        linkLabel: "Explore the neighborhood",
        linkHref: "#",
      },
      arrayFields: {
        name: { type: "text", label: "Name" },
        tagline: { type: "textarea", label: "Vibe tagline", metadata: { help: "One sentence that sums up the feel." } },
        imageUrl: { type: "text", label: "Image URL", metadata: { help: "A wide street or landmark photo. Images alternate sides on wide screens." } },
        imageAlt: { type: "text", label: "Image alt text", metadata: { help: "Describe the photo for screen reader users. Leave blank only if it's purely decorative." } },
        bestFor: { type: "text", label: "Best for", metadata: { help: "Comma separated, like “Foodies, Night owls, Families”." } },
        picks: { type: "textarea", label: "Top picks", metadata: { help: "Up to three, one per line as “Place | why it's great”. The note after the bar is optional." } },
        linkLabel: { type: "text", label: "Link text", metadata: { help: "Leave blank to hide the link." } },
        linkHref: { type: "text", label: "Link" },
      },
    },
  },
  defaultProps: {
    eyebrow: "Neighborhoods",
    heading: "Five neighborhoods, one river",
    headingLevel: "h2",
    intro: "Riverbend grew up along the water, one landing at a time. Each neighborhood kept its own personality. Here's how to choose where to spend your day.",
    neighborhoods: [
      {
        name: "Downtown & Front Street",
        tagline: "Cast-iron storefronts, rooftop bars and the busiest sidewalk in town after dark.",
        imageUrl: "https://picsum.photos/seed/riverbend-downtown/1400/1000",
        imageAlt: "A historic main street with brick storefronts and string lights at dusk",
        bestFor: "Night owls, First-timers, Live music",
        picks: "The Palace Theatre | A 1928 movie palace with weekend classics\nFront Street jazz | Free sets every Thursday at 7\nRiverwalk Bridge | The best sunset photo in town",
        linkLabel: "Explore Downtown",
        linkHref: "/neighborhoods/downtown",
      },
      {
        name: "Old Mill",
        tagline: "A slow-morning kind of place: brunch, bookshops and a water wheel that still turns.",
        imageUrl: "https://picsum.photos/seed/riverbend-oldmill/1400/1000",
        imageAlt: "A stone grist mill with a wooden water wheel beside a narrow creek",
        bestFor: "Brunch, Book lovers, Couples",
        picks: "Millstone Kitchen | Wood-fired dinners by the wheel\nDog-Ear Books | Three floors of used and rare titles\nMill Race Trail | A shaded half-mile creek walk",
        linkLabel: "Explore Old Mill",
        linkHref: "/neighborhoods/old-mill",
      },
      {
        name: "Warehouse District",
        tagline: "Tobacco warehouses turned studios, a brewery row and murals on every block.",
        imageUrl: "https://picsum.photos/seed/riverbend-warehouse/1400/1000",
        imageAlt: "A large colorful mural painted across the side of a brick warehouse",
        bestFor: "Artists, Craft beer, Photographers",
        picks: "Tobacco Row Studios | Open studios every Saturday\nLock & Dam Brewing | Riverside beer garden\nMural Mile | A self-guided walk of 30 murals",
        linkLabel: "Explore the Warehouse District",
        linkHref: "/neighborhoods/warehouse-district",
      },
    ],
  },
  render: ({ eyebrow, heading, headingLevel, intro, neighborhoods }) => {
    const H = headingLevel || "h2";
    const Item = childHeading[H] ?? "h3";
    const list = (neighborhoods ?? []).filter((n) => n?.name);
    const hasHeader = Boolean(eyebrow || heading || intro);
    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="mx-auto max-w-3xl text-center">
              {eyebrow ? <p className="text-sm font-semibold tracking-widest text-indigo-700 uppercase">{eyebrow}</p> : null}
              {heading ? <H className={`${eyebrow ? "mt-3" : ""} text-4xl font-semibold tracking-tight text-balance text-neutral-950 sm:text-5xl`}>{heading}</H> : null}
              {intro ? <p className="mt-5 text-lg leading-8 text-pretty text-neutral-600">{intro}</p> : null}
            </div>
          ) : null}

          {list.length > 0 ? (
            <div className={`${hasHeader ? "mt-14 sm:mt-20" : ""} space-y-16 sm:space-y-24`}>
              {list.map((n, i) => {
                const flip = i % 2 === 1;
                const tags = splitTags(n.bestFor);
                const picks = parsePicks(n.picks);
                return (
                  <article key={`${n.name}-${i}`} className="grid grid-cols-1 items-center gap-8 lg:grid-cols-12 lg:gap-14">
                    {n.imageUrl ? (
                      <div className={`relative lg:col-span-7 ${flip ? "lg:order-2" : ""}`}>
                        <img src={n.imageUrl} alt={n.imageAlt || ""} className="aspect-4/3 w-full rounded-3xl bg-neutral-200 object-cover sm:aspect-3/2" />
                        <span
                          aria-hidden="true"
                          className={`absolute -bottom-5 hidden size-20 place-items-center rounded-full bg-indigo-600 text-2xl font-semibold text-white tabular-nums shadow-lg ring-8 ring-white sm:grid ${flip ? "-left-3" : "-right-3"}`}
                        >
                          {String(i + 1).padStart(2, "0")}
                        </span>
                      </div>
                    ) : null}
                    <div className={n.imageUrl ? `lg:col-span-5 ${flip ? "lg:order-1" : ""}` : "lg:col-span-8 lg:col-start-3"}>
                      <Item className="text-3xl font-semibold tracking-tight text-balance text-neutral-950 sm:text-4xl">{n.name}</Item>
                      {n.tagline ? <p className="mt-4 text-lg leading-8 text-pretty text-neutral-600">{n.tagline}</p> : null}
                      {tags.length > 0 ? (
                        <div className="mt-6">
                          <p className="text-xs font-semibold tracking-widest text-neutral-500 uppercase">Best for</p>
                          <ul role="list" className="mt-2 flex flex-wrap gap-2">
                            {tags.map((t, k) => (
                              <li key={`${t}-${k}`} className="rounded-full bg-indigo-50 px-3 py-1 text-sm font-medium text-indigo-800">
                                {t}
                              </li>
                            ))}
                          </ul>
                        </div>
                      ) : null}
                      {picks.length > 0 ? (
                        <div className="mt-8">
                          <p className="text-xs font-semibold tracking-widest text-neutral-500 uppercase">Top picks</p>
                          <ol role="list" className="mt-3 divide-y divide-neutral-200 border-y border-neutral-200">
                            {picks.map((p, k) => (
                              <li key={`${p.name}-${k}`} className="flex gap-4 py-3">
                                <span aria-hidden="true" className="w-5 shrink-0 pt-0.5 text-sm font-semibold text-indigo-600 tabular-nums">
                                  {k + 1}
                                </span>
                                <p className="min-w-0 text-base leading-6">
                                  <span className="font-semibold text-neutral-950">{p.name}</span>
                                  {p.note ? <span className="block text-sm text-neutral-600">{p.note}</span> : null}
                                </p>
                              </li>
                            ))}
                          </ol>
                        </div>
                      ) : null}
                      {n.linkLabel ? (
                        <a
                          href={n.linkHref || "#"}
                          className={`group mt-6 inline-flex min-h-11 items-center gap-2 rounded-lg bg-neutral-950 px-5 text-sm font-semibold text-white transition hover:bg-indigo-700 ${FOCUS}`}
                        >
                          {n.linkLabel}
                          <svg aria-hidden="true" viewBox="0 0 16 16" fill="currentColor" className="size-4 transition group-hover:translate-x-0.5">
                            <path fillRule="evenodd" d={ARROW} clipRule="evenodd" />
                          </svg>
                        </a>
                      ) : null}
                    </div>
                  </article>
                );
              })}
            </div>
          ) : null}
        </div>
      </section>
    );
  },
};
```
