{
  "name": "cai-blog",
  "type": "registry:ui",
  "description": "CAI editorial blog kit: brand duotone image filter, masthead, magazine feature, cards, collapsible tag rail, article hero, prose, pull quote, reading progress and open-licence topic covers",
  "registryDependencies": [
    "https://brand.canadian-ai.ca/r/cai-blog-client.json"
  ],
  "files": [
    {
      "path": "components/ui/cai-blog.tsx",
      "content": "import * as React from \"react\"\nimport Link from \"next/link\"\n\nimport { cn } from \"@/lib/utils\"\nimport { CaiBrandImage } from \"@/components/ui/cai-blog-client\"\n\nexport { CaiBrandImage, CaiBlogTagRail, CaiReadingProgress, type CaiImageTone } from \"@/components/ui/cai-blog-client\"\n\n/**\n * CAI editorial blog kit (server-safe: no hooks, callable from server components).\n * Interactive pieces live in cai-blog-client.tsx and are re-exported here.\n *\n * Implements the Editorial / Magazine / Minimal structures from the brand\n * guidelines (/brand#blogs) as reusable pieces:\n *\n * - CaiBrandImage: client-side duotone filter that maps any photo into the\n *   CAI palette (Void shadows -> Emerald mids -> Pearl/Mint highlights), so\n *   open-licence photography reads as one system.\n * - CaiBlogMasthead, CaiBlogFeature, CaiBlogCard, CaiBlogTagRail\n * - CaiBlogArticleHero, CaiBlogProse, CaiBlogPullQuote, CaiReadingProgress\n * - CAI_BLOG_TOPIC_COVERS + resolveBlogCover: open-licence (Unsplash License)\n *   covers keyed by topic, used when a post has no art of its own.\n */\n\n// ─── Covers ────────────────────────────────────────────────────────────────\n\nexport type CaiBlogCover = {\n  /** Direct image URL. Unsplash URLs get size params appended automatically. */\n  src: string\n  alt: string\n  /** Attribution page for the photo (shown as the credit link). */\n  creditUrl?: string\n  /** Source name, e.g. \"Unsplash\". Derived from the image host when omitted. */\n  creditLabel?: string\n  /** Photographer or author, e.g. \"Jane Doe\". */\n  creditName?: string\n  /** Licence label, e.g. \"Unsplash License\" or \"CC BY-SA 4.0\". */\n  license?: string\n}\n\nconst KNOWN_SOURCES: Array<[RegExp, string, string]> = [\n  [/(^|\\.)unsplash\\.com$/, \"Unsplash\", \"https://unsplash.com\"],\n  [/(^|\\.)wikimedia\\.org$/, \"Wikimedia Commons\", \"https://commons.wikimedia.org\"],\n  [/(^|\\.)pexels\\.com$/, \"Pexels\", \"https://www.pexels.com\"],\n  [/(^|\\.)openverse\\.org$/, \"Openverse\", \"https://openverse.org\"],\n]\n\n/**\n * Resolves who to credit for a cover. Every image gets a source: explicit\n * fields win, otherwise the source is derived from the image host. Returns\n * null only for same-site images (relative paths), which need no credit.\n */\nexport function imageCredit(cover: CaiBlogCover): { source: string; name?: string; url?: string; license?: string } | null {\n  let host = \"\"\n  try {\n    host = new URL(cover.src).hostname\n  } catch {\n    if (!cover.creditLabel && !cover.creditName) return null\n  }\n  const known = KNOWN_SOURCES.find(([pattern]) => pattern.test(host))\n  return {\n    source: cover.creditLabel ?? known?.[1] ?? host.replace(/^www\\./, \"\"),\n    name: cover.creditName,\n    url: cover.creditUrl ?? known?.[2] ?? (host ? `https://${host}` : undefined),\n    license: cover.license ?? (known?.[1] === \"Unsplash\" ? \"Unsplash License\" : undefined),\n  }\n}\n\nconst unsplash = (id: string, alt: string, creditUrl?: string): CaiBlogCover => ({\n  src: `https://images.unsplash.com/photo-${id}`,\n  alt,\n  creditUrl,\n  creditLabel: \"Unsplash\",\n  license: \"Unsplash License\",\n})\n\n/** Topic library. Keys are matched against post tags, title and slug. */\nexport const CAI_BLOG_TOPIC_COVERS: Record<string, CaiBlogCover> = {\n  health: unsplash(\"1758691462620-9018c602ed3e\", \"Clinician holding a tablet in a clinic\"),\n  finance: unsplash(\"1742836531239-1fe146bf7e3f\", \"Phone used for a contactless payment\"),\n  construction: unsplash(\"1778074762022-c33cc42f79ae\", \"Two construction workers reviewing plans on a tablet\"),\n  defence: unsplash(\"1707236585778-cc1f5a0e3963\", \"Radar array mounted on a vehicle\"),\n  government: unsplash(\"1578973615934-8d9cdb0792b4\", \"Canadian flag in front of the Peace Tower in Ottawa\"),\n  robotics: unsplash(\"1581091226825-a6a2a5aee158\", \"Engineer working beside robotic equipment in a lab\"),\n  agents: unsplash(\"1485827404703-89b55fcc595e\", \"Humanoid service robot\"),\n  infrastructure: unsplash(\"1558494949-ef010cbdcc31\", \"Server racks and cabling in a data centre\"),\n  code: unsplash(\"1555066931-4365d14bab8c\", \"Source code on a laptop screen\"),\n  automation: unsplash(\"1526374965328-7f61d4dc18c5\", \"Streams of green code\"),\n  data: unsplash(\"1460925895917-afdab827c52f\", \"Analytics dashboard on a laptop\"),\n  models: unsplash(\"1518770660439-4636190af475\", \"Close-up of a circuit board\"),\n  ai: unsplash(\"1677442136019-21780ecad995\", \"Three-dimensional AI lettering\"),\n  network: unsplash(\"1451187580459-43490279c0fa\", \"City lights across the earth at night\"),\n  security: unsplash(\"1550751827-4bd374c3f58b\", \"Illuminated circuit pattern\"),\n  ontario: unsplash(\"1750479015832-b33a015d45b1\", \"Toronto skyline at night over the water\"),\n  archive: unsplash(\"1762627105132-f6ed848a23bf\", \"Rows of archive boxes on wooden shelves\"),\n  typography: unsplash(\"1461360422312-048b738a1830\", \"Drawer of letterpress type\"),\n  barber: unsplash(\"1585747860715-2ba37e788b70\", \"Barber chairs in front of a brick wall\"),\n  food: unsplash(\"1635351373171-40bf0c83e1eb\", \"Maple syrup poured into a glass jar\"),\n  team: unsplash(\"1522071820081-009f0129c71c\", \"Team working together around a table\"),\n}\n\nconst TOPIC_KEYWORDS: Array<[keyof typeof CAI_BLOG_TOPIC_COVERS, RegExp]> = [\n  [\"health\", /health|clinic|medical|hospital|patient/i],\n  [\"finance\", /fintech|finance|payment|bank|rent/i],\n  [\"construction\", /construct|contech|builder|renovat/i],\n  [\"defence\", /defen[cs]e|military|surveillance|radar/i],\n  [\"government\", /govtech|government|public sector|policy|sovereign/i],\n  [\"robotics\", /robot|haptic|industrial|manufactur/i],\n  [\"agents\", /agent/i],\n  [\"infrastructure\", /infrastructure|mlops|cloud|platform/i],\n  [\"automation\", /automation|rpa|workflow/i],\n  [\"code\", /coding|developer|software|saas|website/i],\n  [\"data\", /data|analytics|report|funding/i],\n  [\"models\", /model|machine learning|rag|memory|prompt/i],\n  [\"security\", /security|privacy|governance|resilien/i],\n  [\"ontario\", /ontario|toronto/i],\n  [\"archive\", /archive|history/i],\n  [\"typography\", /typograph|text|layout|font/i],\n  [\"barber\", /barber|salon|cuts/i],\n  [\"food\", /maple|food|farm|syrup/i],\n  [\"team\", /team|hiring|agency|people/i],\n  [\"ai\", /\\bai\\b|artificial intelligence/i],\n]\n\n/** Low-signal sources (diagrams, logos, placeholders) that look poor full-bleed. */\nconst WEAK_IMAGE = /placeholder|\\.svg($|\\?)|upload\\.wikimedia\\.org\\/.+\\.png($|\\?)/i\n\nexport function resolveBlogCover(post: {\n  slug?: string\n  title?: string\n  tags?: string[]\n  imageUrl?: string\n  /** Hand-picked covers for specific posts; wins over everything. */\n  overrides?: Record<string, CaiBlogCover>\n}): CaiBlogCover {\n  if (post.slug && post.overrides?.[post.slug]) return post.overrides[post.slug]\n  if (post.imageUrl && !WEAK_IMAGE.test(post.imageUrl)) {\n    return { src: post.imageUrl, alt: post.title ? `Cover image for ${post.title}` : \"Article cover image\" }\n  }\n  const haystack = [...(post.tags ?? []), post.title ?? \"\", post.slug?.replace(/-/g, \" \") ?? \"\"].join(\" \")\n  const match = TOPIC_KEYWORDS.find(([, pattern]) => pattern.test(haystack))\n  return CAI_BLOG_TOPIC_COVERS[match?.[0] ?? \"ai\"]\n}\n\n/** \"2026-09-01\" -> \"Sep 1, 2026\". Unparseable input is returned unchanged. */\nexport function formatBlogDate(date: string | undefined, locale = \"en-CA\"): string | undefined {\n  if (!date) return date\n  const parsed = new Date(/^\\d{4}-\\d{2}-\\d{2}$/.test(date) ? `${date}T00:00:00Z` : date)\n  if (Number.isNaN(parsed.getTime())) return date\n  return parsed.toLocaleDateString(locale, { month: \"short\", day: \"numeric\", year: \"numeric\", timeZone: \"UTC\" })\n}\n\n/**\n * Drops a leading Markdown heading that repeats the article title, since the\n * article hero already shows it.\n */\nexport function stripLeadingTitle(content: string, title: string): string {\n  const normalize = (value: string) => value.toLowerCase().replace(/[^a-z0-9]+/g, \" \").trim()\n  return content.replace(/^\\s*#{1,2}\\s+(.+?)\\s*(?:\\r?\\n|$)/, (match, heading: string) =>\n    normalize(heading) === normalize(title) ? \"\" : match,\n  )\n}\n\n/** Words-per-minute estimate for \"x min read\". */\nexport function estimateReadTime(content: string | undefined, wpm = 230): string {\n  const words = (content ?? \"\").trim().split(/\\s+/).filter(Boolean).length\n  return `${Math.max(1, Math.round(words / wpm))} min read`\n}\n\n// ─── Shared bits ─────────────────────────────────────────────────────────\n\nexport type CaiBlogPostSummary = {\n  slug: string\n  title: string\n  excerpt?: string\n  date?: string\n  author?: string\n  tags?: string[]\n  readTime?: string\n  cover: CaiBlogCover\n}\n\nfunction Eyebrow({ children, className }: { children: React.ReactNode; className?: string }) {\n  return (\n    <p className={cn(\"flex items-center gap-3 text-[11px] font-semibold uppercase tracking-[0.28em] text-muted-foreground\", className)}>\n      <span aria-hidden className=\"h-px w-8 bg-[#0f7b4e]\" />\n      {children}\n    </p>\n  )\n}\n\nfunction Arrow({ className }: { className?: string }) {\n  return (\n    <svg aria-hidden viewBox=\"0 0 16 16\" className={cn(\"h-3.5 w-3.5\", className)} fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.5\">\n      <path d=\"M2 8h11M9 4l4 4-4 4\" strokeLinecap=\"square\" />\n    </svg>\n  )\n}\n\nfunction Meta({ items, className }: { items: Array<string | undefined>; className?: string }) {\n  const visible = items.filter(Boolean)\n  if (visible.length === 0) return null\n  return (\n    <p className={cn(\"flex flex-wrap items-center gap-x-2 font-mono text-[11px] uppercase tracking-[0.14em]\", className)}>\n      {visible.map((item, i) => (\n        <React.Fragment key={`${item}-${i}`}>\n          {i > 0 ? <span aria-hidden className=\"opacity-40\">/</span> : null}\n          <span>{item}</span>\n        </React.Fragment>\n      ))}\n    </p>\n  )\n}\n\n// ─── Credits ─────────────────────────────────────────────────────────────\n\n/**\n * Source credit shown on every blog image by default.\n * - variant \"overlay\" (default placement): a small chip set inside the photo,\n *   bottom-right corner. Position it with absolute bottom and right classes.\n * - variant \"caption\": muted text for use outside an image\n * Pass linked={false} inside an element that is already a link (cards),\n * since a link cannot contain another link.\n */\nexport function CaiImageCredit({\n  cover,\n  variant = \"caption\",\n  linked = true,\n  className,\n}: {\n  cover: CaiBlogCover\n  variant?: \"caption\" | \"overlay\"\n  linked?: boolean\n  className?: string\n}) {\n  const credit = imageCredit(cover)\n  if (!credit) return null\n  const label = credit.name ? `${credit.name} / ${credit.source}` : credit.source\n\n  return (\n    <p\n      data-slot=\"cai-image-credit\"\n      className={cn(\n        \"flex min-w-0 items-center gap-1 font-mono text-[7px] uppercase leading-[10px] tracking-[0.1em] sm:text-[8px]\",\n        variant === \"caption\"\n          ? \"text-muted-foreground\"\n          : \"pointer-events-auto max-w-[calc(100%-1.5rem)] bg-[#161717]/50 px-1 py-px text-[#eff0f0]/70 backdrop-blur-sm\",\n        className,\n      )}\n    >\n      <span className=\"sr-only\">Photo credit: </span>\n      {linked && credit.url ? (\n        <a\n          href={credit.url}\n          target=\"_blank\"\n          rel=\"noopener noreferrer\"\n          className=\"truncate underline decoration-current/40 underline-offset-2 transition-colors hover:decoration-current\"\n        >\n          {label}\n        </a>\n      ) : (\n        <span className=\"truncate\">{label}</span>\n      )}\n      {credit.license ? <span className=\"hidden shrink-0 opacity-60 sm:inline\">· {credit.license}</span> : null}\n    </p>\n  )\n}\n\n/** In-article image with brand filter, optional caption and the source credit. */\nexport function CaiBlogFigure({\n  cover,\n  caption,\n  tone,\n  className,\n}: {\n  cover: CaiBlogCover\n  caption?: React.ReactNode\n  tone?: React.ComponentProps<typeof CaiBrandImage>[\"tone\"]\n  className?: string\n}) {\n  return (\n    <figure data-slot=\"cai-blog-figure\" className={cn(\"my-12\", className)}>\n      <div className=\"relative\">\n        <CaiBrandImage src={cover.src} alt={cover.alt} tone={tone} width={1600} className=\"aspect-[16/9] rounded-[2px]\" />\n        <CaiImageCredit cover={cover} variant=\"overlay\" className=\"absolute bottom-2 right-2\" />\n      </div>\n      {caption ? <figcaption className=\"mt-3 text-sm leading-6 text-muted-foreground\">{caption}</figcaption> : null}\n    </figure>\n  )\n}\n\n// ─── Index pieces ────────────────────────────────────────────────────────\n\nexport function CaiBlogMasthead({\n  eyebrow,\n  title,\n  intro,\n  stat,\n  className,\n}: {\n  eyebrow: string\n  title: React.ReactNode\n  intro?: React.ReactNode\n  stat?: { value: string; label: string }\n  className?: string\n}) {\n  return (\n    <header data-slot=\"cai-blog-masthead\" className={cn(\"relative grid gap-10 pb-12 pt-16 md:pt-24 lg:grid-cols-[1.25fr_0.75fr] lg:items-end\", className)}>\n      <div>\n        <Eyebrow>{eyebrow}</Eyebrow>\n        <h1 className=\"mt-8 max-w-4xl text-balance font-serif text-5xl font-semibold leading-[0.92] tracking-[-0.02em] md:text-7xl lg:text-[5.5rem]\">\n          {title}\n        </h1>\n      </div>\n      <div className=\"flex flex-col gap-6 lg:pb-3\">\n        {intro ? <p className=\"max-w-md text-base leading-8 text-muted-foreground md:text-lg\">{intro}</p> : null}\n        {stat ? (\n          <p className=\"flex items-baseline gap-3 border-t border-foreground/15 pt-5\">\n            <span className=\"font-serif text-4xl font-semibold tabular-nums\">{stat.value}</span>\n            <span className=\"text-[11px] uppercase tracking-[0.22em] text-muted-foreground\">{stat.label}</span>\n          </p>\n        ) : null}\n      </div>\n    </header>\n  )\n}\n\n/** Magazine-style full-bleed lead story with the title set over the image. */\nexport function CaiBlogFeature({\n  post,\n  href,\n  label = \"Featured\",\n  showCredit = true,\n  className,\n}: {\n  post: CaiBlogPostSummary\n  href: string\n  label?: string\n  /** Source credit over the image (on by default). */\n  showCredit?: boolean\n  className?: string\n}) {\n  return (\n    <Link\n      href={href}\n      data-slot=\"cai-blog-feature\"\n      className={cn(\"group relative block overflow-hidden rounded-[2px] border border-foreground/10 bg-[#161717] text-[#eff0f0] outline-none focus-visible:ring-2 focus-visible:ring-[#0f7b4e]\", className)}\n    >\n      <CaiBrandImage src={post.cover.src} alt={post.cover.alt} width={2000} priority reveal className=\"aspect-[4/5] sm:aspect-[16/10] lg:aspect-[21/9]\" />\n      <div aria-hidden className=\"absolute inset-0 bg-gradient-to-t from-[#161717] via-[#161717]/55 to-transparent\" />\n      {showCredit ? <CaiImageCredit cover={post.cover} variant=\"overlay\" linked={false} className=\"absolute bottom-3 right-3\" /> : null}\n      <div className=\"absolute inset-x-0 bottom-0 grid gap-6 p-6 pb-12 sm:p-10 sm:pb-14 lg:grid-cols-[1.4fr_0.6fr] lg:items-end lg:p-14\">\n        <div>\n          <p className=\"inline-flex items-center gap-2 border border-[#eff0f0]/25 bg-[#161717]/40 px-2.5 py-1 text-[10px] font-semibold uppercase tracking-[0.24em] backdrop-blur-sm\">\n            <span aria-hidden className=\"h-1.5 w-1.5 bg-[#30805f]\" />\n            {label}\n          </p>\n          <h2 className=\"mt-5 max-w-4xl text-balance font-serif text-3xl font-semibold leading-[1.02] tracking-[-0.015em] sm:text-5xl lg:text-6xl\">{post.title}</h2>\n          <Meta className=\"mt-5 text-[#eff0f0]/65\" items={[post.date, post.readTime, post.author]} />\n        </div>\n        <div className=\"flex flex-col gap-5 lg:items-end\">\n          {post.excerpt ? <p className=\"line-clamp-3 max-w-md text-sm leading-7 text-[#eff0f0]/75 lg:text-right\">{post.excerpt}</p> : null}\n          <span className=\"inline-flex items-center gap-2 bg-[#eff0f0] px-4 py-2.5 text-xs font-semibold uppercase tracking-[0.18em] text-[#161717] transition-colors group-hover:bg-[#0f7b4e] group-hover:text-[#eff0f0]\">\n            Read the story <Arrow className=\"transition-transform group-hover:translate-x-0.5\" />\n          </span>\n        </div>\n      </div>\n    </Link>\n  )\n}\n\nexport type CaiBlogCardVariant = \"default\" | \"compact\" | \"overlay\"\n\nexport function CaiBlogCard({\n  post,\n  href,\n  index,\n  variant = \"default\",\n  showCredit = true,\n  className,\n}: {\n  post: CaiBlogPostSummary\n  href: string\n  /** Shows an editorial number badge (01, 02...). */\n  index?: number\n  variant?: CaiBlogCardVariant\n  /** Source credit on the image (on by default; compact cards never show it). */\n  showCredit?: boolean\n  className?: string\n}) {\n  const number = typeof index === \"number\" ? String(index + 1).padStart(2, \"0\") : null\n  const category = post.tags?.find((tag) => tag !== \"AI-generated\")\n\n  if (variant === \"compact\") {\n    return (\n      <Link href={href} data-slot=\"cai-blog-card\" className={cn(\"group grid grid-cols-[88px_1fr] items-center gap-5 py-5 outline-none focus-visible:bg-foreground/5\", className)}>\n        <CaiBrandImage src={post.cover.src} alt={post.cover.alt} width={240} className=\"aspect-square rounded-[2px]\" />\n        <div className=\"min-w-0\">\n          {number ? <span className=\"font-mono text-[11px] text-[#0f7b4e]\">{number}</span> : null}\n          <h3 className=\"mt-1 line-clamp-2 font-serif text-xl font-semibold leading-snug tracking-tight decoration-[#0f7b4e] decoration-1 underline-offset-4 group-hover:underline\">\n            {post.title}\n          </h3>\n          <Meta className=\"mt-2 text-muted-foreground\" items={[post.date, post.readTime]} />\n        </div>\n      </Link>\n    )\n  }\n\n  if (variant === \"overlay\") {\n    return (\n      <Link href={href} data-slot=\"cai-blog-card\" className={cn(\"group relative block overflow-hidden rounded-[2px] bg-[#161717] text-[#eff0f0] outline-none focus-visible:ring-2 focus-visible:ring-[#0f7b4e]\", className)}>\n        <CaiBrandImage src={post.cover.src} alt={post.cover.alt} width={1200} reveal className=\"aspect-[4/5] h-full\" />\n        <div aria-hidden className=\"absolute inset-0 bg-gradient-to-t from-[#161717] via-[#161717]/40 to-transparent\" />\n        {number ? <span className=\"absolute left-4 top-4 font-mono text-[11px] text-[#eff0f0]/70\">{number}</span> : null}\n        {showCredit ? <CaiImageCredit cover={post.cover} variant=\"overlay\" linked={false} className=\"absolute bottom-3 right-3\" /> : null}\n        <div className=\"absolute inset-x-0 bottom-0 p-6 pb-11\">\n          {category ? <p className=\"text-[10px] font-semibold uppercase tracking-[0.24em] text-[#d1f2e8]\">{category}</p> : null}\n          <h3 className=\"mt-3 text-balance font-serif text-2xl font-semibold leading-tight tracking-tight\">{post.title}</h3>\n          <Meta className=\"mt-3 text-[#eff0f0]/60\" items={[post.date, post.readTime]} />\n        </div>\n      </Link>\n    )\n  }\n\n  return (\n    <Link href={href} data-slot=\"cai-blog-card\" className={cn(\"group flex flex-col outline-none\", className)}>\n      <div className=\"relative\">\n        <CaiBrandImage src={post.cover.src} alt={post.cover.alt} width={900} reveal className=\"aspect-[4/3] rounded-[2px]\" />\n        {number ? (\n          <span className=\"absolute left-3 top-3 bg-[#161717]/70 px-1.5 py-0.5 font-mono text-[10px] text-[#eff0f0] backdrop-blur-sm\">{number}</span>\n        ) : null}\n        {showCredit ? <CaiImageCredit cover={post.cover} variant=\"overlay\" linked={false} className=\"absolute bottom-2 right-2\" /> : null}\n      </div>\n      <div className=\"flex flex-1 flex-col pt-5\">\n        <div className=\"flex items-center justify-between gap-3\">\n          {category ? <p className=\"truncate text-[10px] font-semibold uppercase tracking-[0.24em] text-[#0f7b4e] dark:text-[#50856f]\">{category}</p> : <span />}\n          <Meta className=\"shrink-0 text-muted-foreground\" items={[post.readTime]} />\n        </div>\n        <h3 className=\"mt-3 text-balance font-serif text-2xl font-semibold leading-[1.15] tracking-tight decoration-[#0f7b4e] decoration-1 underline-offset-[6px] group-hover:underline group-focus-visible:underline\">\n          {post.title}\n        </h3>\n        {post.excerpt ? <p className=\"mt-3 line-clamp-3 text-sm leading-7 text-muted-foreground\">{post.excerpt}</p> : null}\n        <Meta className=\"mt-auto pt-5 text-muted-foreground\" items={[post.date]} />\n      </div>\n    </Link>\n  )\n}\n\n// ─── Article pieces ──────────────────────────────────────────────────────\n\nexport function CaiBlogArticleHero({\n  title,\n  eyebrow,\n  date,\n  author,\n  readTime,\n  cover,\n  backHref,\n  backLabel = \"All articles\",\n  tags,\n  tagHrefBase,\n  showCredit = true,\n  className,\n}: {\n  title: string\n  eyebrow?: string\n  date?: string\n  author?: string\n  readTime?: string\n  cover: CaiBlogCover\n  backHref: string\n  backLabel?: string\n  tags?: string[]\n  /** e.g. \"/blog?tag=\" — tags render as links when set. */\n  tagHrefBase?: string\n  /** Linked source credit in the corner of the hero image (on by default). */\n  showCredit?: boolean\n  className?: string\n}) {\n  return (\n    <header data-slot=\"cai-blog-article-hero\" className={cn(\"relative overflow-hidden bg-[#161717] text-[#eff0f0]\", className)}>\n      <CaiBrandImage src={cover.src} alt={cover.alt} width={2400} priority className=\"absolute inset-0 h-full w-full opacity-70\" />\n      <div aria-hidden className=\"absolute inset-0 bg-gradient-to-t from-[#161717] via-[#161717]/70 to-[#161717]/20\" />\n      <div className=\"relative mx-auto flex min-h-[72svh] max-w-6xl flex-col justify-between px-4 pb-12 pt-8 sm:px-8 md:pb-16 lg:min-h-[78svh]\">\n        <Link href={backHref} className=\"inline-flex w-fit items-center gap-2 text-xs font-medium uppercase tracking-[0.2em] text-[#eff0f0]/70 transition-colors hover:text-[#eff0f0]\">\n          <Arrow className=\"rotate-180\" /> {backLabel}\n        </Link>\n        <div className=\"mt-24\">\n          {eyebrow ? <Eyebrow className=\"text-[#d1f2e8]\">{eyebrow}</Eyebrow> : null}\n          <h1 className=\"mt-6 max-w-5xl text-balance font-serif text-4xl font-semibold leading-[0.98] tracking-[-0.02em] sm:text-6xl lg:text-7xl\">{title}</h1>\n          <div className=\"mt-10 flex flex-col gap-5 border-t border-[#eff0f0]/15 pt-6 sm:flex-row sm:items-center sm:justify-between\">\n            <Meta className=\"text-[#eff0f0]/70\" items={[date, readTime, author]} />\n            {tags?.length ? (\n              <div className=\"flex flex-wrap gap-2\">\n                {tags.slice(0, 4).map((tag) =>\n                  tagHrefBase ? (\n                    <Link key={tag} href={`${tagHrefBase}${encodeURIComponent(tag)}`} className=\"border border-[#eff0f0]/20 px-2.5 py-1 text-[11px] text-[#eff0f0]/80 transition-colors hover:border-[#eff0f0]/60 hover:text-[#eff0f0]\">\n                      {tag}\n                    </Link>\n                  ) : (\n                    <span key={tag} className=\"border border-[#eff0f0]/20 px-2.5 py-1 text-[11px] text-[#eff0f0]/80\">{tag}</span>\n                  ),\n                )}\n              </div>\n            ) : null}\n          </div>\n        </div>\n      </div>\n      {showCredit ? (\n        <CaiImageCredit cover={cover} variant=\"overlay\" className=\"absolute bottom-3 right-3 sm:bottom-4 sm:right-6\" />\n      ) : null}\n    </header>\n  )\n}\n\n/**\n * Long-form reading column: serif body, emerald drop cap on the first\n * paragraph, generous measure, branded links, quotes and rules.\n */\nexport function CaiBlogProse({ children, dropCap = true, className }: { children: React.ReactNode; dropCap?: boolean; className?: string }) {\n  return (\n    <div\n      data-slot=\"cai-blog-prose\"\n      className={cn(\n        \"mx-auto max-w-[68ch] text-[1.075rem] leading-[1.85] text-foreground/85\",\n        \"[&_h2]:mt-16 [&_h2]:font-serif [&_h2]:text-3xl [&_h2]:font-semibold [&_h2]:leading-tight [&_h2]:tracking-tight [&_h2]:text-foreground\",\n        \"[&_h3]:mt-10 [&_h3]:font-serif [&_h3]:text-2xl [&_h3]:font-semibold [&_h3]:text-foreground\",\n        \"[&_p]:mt-6 [&_p]:text-[1.075rem] [&_p]:leading-[1.85] [&_p]:text-foreground/80 [&_ul]:mt-6 [&_ol]:mt-6 [&_li]:mt-2 [&_li]:text-[1.075rem] [&_li]:leading-[1.8] [&_li]:text-foreground/80 [&_li]:marker:text-[#0f7b4e]\",\n        \"[&_a]:text-foreground [&_a]:underline [&_a]:decoration-[#0f7b4e] [&_a]:decoration-[1.5px] [&_a]:underline-offset-4 hover:[&_a]:decoration-2\",\n        \"[&_blockquote]:my-12 [&_blockquote]:border-l-2 [&_blockquote]:border-[#0f7b4e] [&_blockquote]:pl-6 [&_blockquote]:font-serif [&_blockquote]:text-2xl [&_blockquote]:italic [&_blockquote]:leading-snug [&_blockquote]:text-foreground\",\n        \"[&_hr]:my-14 [&_hr]:border-foreground/10 [&_img]:my-10 [&_img]:rounded-[2px]\",\n        \"[&_strong]:font-semibold [&_strong]:text-foreground\",\n        dropCap &&\n          \"[&>*:first-child>p:first-of-type]:first-letter:float-left [&>*:first-child>p:first-of-type]:first-letter:mr-3 [&>*:first-child>p:first-of-type]:first-letter:mt-1 [&>*:first-child>p:first-of-type]:first-letter:font-serif [&>*:first-child>p:first-of-type]:first-letter:text-[4.5rem] [&>*:first-child>p:first-of-type]:first-letter:font-semibold [&>*:first-child>p:first-of-type]:first-letter:leading-[0.8] [&>*:first-child>p:first-of-type]:first-letter:text-[#0f7b4e]\",\n        className,\n      )}\n    >\n      {children}\n    </div>\n  )\n}\n\nexport function CaiBlogPullQuote({ children, cite, className }: { children: React.ReactNode; cite?: string; className?: string }) {\n  return (\n    <figure data-slot=\"cai-blog-pull-quote\" className={cn(\"my-16 border-y border-foreground/10 py-10 text-center\", className)}>\n      <blockquote className=\"mx-auto max-w-3xl text-balance font-serif text-3xl font-semibold italic leading-tight tracking-tight md:text-4xl\">\n        <span aria-hidden className=\"text-[#0f7b4e]\">“</span>\n        {children}\n        <span aria-hidden className=\"text-[#0f7b4e]\">”</span>\n      </blockquote>\n      {cite ? <figcaption className=\"mt-5 text-[11px] uppercase tracking-[0.24em] text-muted-foreground\">{cite}</figcaption> : null}\n    </figure>\n  )\n}\n",
      "type": "registry:ui"
    }
  ]
}