# Add the "Header — Centered Logo" block to this P1 project

Add a Puck component from P1 Blocks (https://p1-blocks.prolificdigital.io/blocks/header-centered) to this Pantheon Content Publisher (P1) Next.js project. Editorial header with a serif wordmark centered between two sets of links, a notice line above and a double rule below.

## Steps

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

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

/**
 * Header (Centered Logo) — an editorial header with the wordmark centered between two sets
 * of links, an optional notice line above, and a double rule below. Phones get a <details> menu.
 * Register: `HeaderCenteredBlock: headerCenteredBlock` in puck.config.tsx.
 */

export type HeaderCenteredProps = {
  notice: string;
  logoText: string;
  logoTagline: string;
  logoImageUrl: string;
  logoImageAlt: string;
  logoHref: string;
  navLabel: string;
  leftLinks: { label: string; href: string }[];
  rightLinks: { label: string; href: string }[];
  ctaLabel: string;
  ctaHref: string;
  menuLabel: string;
};

const focusRing = "focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600";
const deskLink = `inline-flex min-h-11 items-center rounded px-2 text-sm font-medium tracking-wide text-neutral-700 underline-offset-8 transition hover:text-neutral-950 hover:underline hover:decoration-indigo-600 ${focusRing}`;

const linkFields = {
  type: "array" as const,
  min: 0,
  max: 4,
  getItemSummary: (item: { label?: string }) => item?.label || "Link",
  defaultItemProps: { label: "New link", href: "/" },
  arrayFields: {
    label: { type: "text" as const, label: "Label" },
    href: { type: "text" as const, label: "Link" },
  },
};

export const headerCenteredBlock: ComponentConfig<HeaderCenteredProps> = {
  label: "Header (Centered Logo)",
  fields: {
    notice: { type: "text", label: "Notice line", metadata: { help: "A short line above the header, like today's hours. Leave blank to hide it." } },
    logoText: { type: "text", label: "Wordmark", metadata: { help: "Set large in a serif. Keep it short, two or three words." } },
    logoTagline: { type: "text", label: "Wordmark tagline", metadata: { help: "Small capitals under the wordmark. Leave blank to hide it." } },
    logoImageUrl: { type: "text", label: "Logo image URL", metadata: { help: "Optional. Replaces the wordmark when set." } },
    logoImageAlt: { type: "text", label: "Logo alt text", metadata: { help: "Your organization's name, as it appears in the logo." } },
    logoHref: { type: "text", label: "Logo link", metadata: { help: "Usually / for the home page." } },
    navLabel: { type: "text", label: "Navigation name", metadata: { help: "Read by screen readers, like Main. Name each menu on a page differently." } },
    leftLinks: { ...linkFields, label: "Links left of the logo" },
    rightLinks: { ...linkFields, label: "Links right of the logo", metadata: { help: "Balance the two sides: the same number of links on each reads best." } },
    ctaLabel: { type: "text", label: "Button text", metadata: { help: "Sits at the far right. Leave blank to hide it." } },
    ctaHref: { type: "text", label: "Button link" },
    menuLabel: { type: "text", label: "Mobile menu label" },
  },
  defaultProps: {
    notice: "Open today 10 a.m.–5 p.m. · Free on Thursday evenings",
    logoText: "The Harlan",
    logoTagline: "Museum of Art & Gardens",
    logoImageUrl: "",
    logoImageAlt: "",
    logoHref: "/",
    navLabel: "Main",
    leftLinks: [
      { label: "Visit", href: "/visit" },
      { label: "Exhibitions", href: "/exhibitions" },
      { label: "Collection", href: "/collection" },
    ],
    rightLinks: [
      { label: "Learn", href: "/learn" },
      { label: "Join & give", href: "/support" },
    ],
    ctaLabel: "Tickets",
    ctaHref: "/tickets",
    menuLabel: "Menu",
  },
  render: ({ notice, logoText, logoTagline, logoImageUrl, logoImageAlt, logoHref, navLabel, leftLinks, rightLinks, ctaLabel, ctaHref, menuLabel }) => {
    const left = (leftLinks ?? []).filter((l) => l?.label);
    const right = (rightLinks ?? []).filter((l) => l?.label);
    const all = [...left, ...right];
    const label = navLabel || "Main";
    const hasLogo = Boolean(logoText || logoImageUrl);

    const logo = hasLogo ? (
      <a href={logoHref || "/"} className={`inline-flex min-h-11 min-w-0 flex-col justify-center rounded-lg px-1 lg:items-center lg:text-center ${focusRing}`}>
        {logoImageUrl ? (
          <img src={logoImageUrl} alt={logoImageAlt || logoText || ""} className="h-10 w-auto lg:h-12" />
        ) : (
          <>
            <span className="font-serif text-2xl leading-none font-medium tracking-tight text-neutral-950 lg:text-4xl">{logoText}</span>
            {logoTagline ? <span className="mt-1.5 text-xs font-semibold tracking-widest text-neutral-600 uppercase">{logoTagline}</span> : null}
          </>
        )}
      </a>
    ) : null;

    const ctaClass = `min-h-11 items-center justify-center rounded-full bg-neutral-950 px-5 text-sm font-semibold tracking-wide text-white transition hover:bg-indigo-700 ${focusRing}`;

    return (
      <header className="relative z-30 border-b-4 border-double border-neutral-900 bg-white">
        {notice ? (
          <p className="border-b border-neutral-200 px-4 py-2.5 text-center text-xs font-medium tracking-wide text-pretty text-neutral-700 sm:px-6">{notice}</p>
        ) : null}
        <div className="mx-auto max-w-7xl px-4 sm:px-6 lg:px-8">
          <div className="flex min-h-16 items-center justify-between gap-4 py-3 lg:grid lg:min-h-28 lg:grid-cols-3 lg:py-5">
            <div className="min-w-0 lg:relative lg:z-10 lg:col-start-2 lg:row-start-1 lg:flex lg:justify-center">{logo}</div>

            {all.length || ctaLabel ? (
              <nav aria-label={label} className="hidden lg:col-span-3 lg:col-start-1 lg:row-start-1 lg:grid lg:grid-cols-3 lg:items-center">
                <ul role="list" className="flex flex-wrap items-center gap-x-3">
                  {left.map((l, i) => (
                    <li key={`${l.label}-${i}`}>
                      <a href={l.href || "#"} className={deskLink}>
                        {l.label}
                      </a>
                    </li>
                  ))}
                </ul>
                <ul role="list" className="col-start-3 flex flex-wrap items-center justify-end gap-x-3">
                  {right.map((l, i) => (
                    <li key={`${l.label}-${i}`}>
                      <a href={l.href || "#"} className={deskLink}>
                        {l.label}
                      </a>
                    </li>
                  ))}
                  {ctaLabel ? (
                    <li className="ml-2">
                      <a href={ctaHref || "#"} className={`inline-flex ${ctaClass}`}>
                        {ctaLabel}
                      </a>
                    </li>
                  ) : null}
                </ul>
              </nav>
            ) : null}

            {all.length || ctaLabel ? (
              <details className="group lg:hidden">
                <summary
                  className={`inline-flex min-h-11 cursor-pointer list-none items-center gap-2 rounded-full px-4 text-sm font-semibold tracking-wide text-neutral-900 ring-1 ring-neutral-900 ring-inset hover:bg-neutral-50 [&::-webkit-details-marker]:hidden ${focusRing}`}
                >
                  <svg aria-hidden="true" viewBox="0 0 20 20" fill="currentColor" className="size-5 group-open:hidden">
                    <path fillRule="evenodd" d="M2 6.75A.75.75 0 0 1 2.75 6h14.5a.75.75 0 0 1 0 1.5H2.75A.75.75 0 0 1 2 6.75Zm0 6.5a.75.75 0 0 1 .75-.75h14.5a.75.75 0 0 1 0 1.5H2.75a.75.75 0 0 1-.75-.75Z" clipRule="evenodd" />
                  </svg>
                  <svg aria-hidden="true" viewBox="0 0 20 20" fill="currentColor" className="hidden size-5 group-open:block">
                    <path d="M6.28 5.22a.75.75 0 0 0-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 1 0 1.06 1.06L10 11.06l3.72 3.72a.75.75 0 1 0 1.06-1.06L11.06 10l3.72-3.72a.75.75 0 0 0-1.06-1.06L10 8.94 6.28 5.22Z" />
                  </svg>
                  {menuLabel || "Menu"}
                </summary>
                <div className="absolute inset-x-0 top-full z-40 mt-1 max-h-svh overflow-y-auto border-b border-neutral-200 bg-white px-4 pt-4 pb-8 shadow-lg sm:px-6">
                  {all.length ? (
                    <nav aria-label={`${label} (mobile)`}>
                      <ul role="list">
                        {all.map((l, i) => (
                          <li key={`${l.label}-${i}`} className="border-b border-neutral-200">
                            <a href={l.href || "#"} className={`flex min-h-14 items-center rounded font-serif text-2xl text-neutral-950 hover:text-indigo-700 ${focusRing}`}>
                              {l.label}
                            </a>
                          </li>
                        ))}
                      </ul>
                    </nav>
                  ) : null}
                  {ctaLabel ? (
                    <div className="mt-6 grid grid-cols-1">
                      <a href={ctaHref || "#"} className={`flex text-base ${ctaClass}`}>
                        {ctaLabel}
                      </a>
                    </div>
                  ) : null}
                </div>
              </details>
            ) : null}
          </div>
        </div>
      </header>
    );
  },
};
```
