{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "case-study",
  "type": "registry:block",
  "title": "Case study block",
  "description": "One project told as a page: a wide hero image, the facts in a row, the story with its labels in a narrow left column, the series in a carousel, the details in a grid and the next project as a card. Every image opens one lightbox that runs through them all, and the carousel follows it.",
  "registryDependencies": [
    "https://littmd.vercel.app/r/litt.json",
    "https://littmd.vercel.app/r/breadcrumb.json",
    "https://littmd.vercel.app/r/card.json",
    "https://littmd.vercel.app/r/carousel.json",
    "https://littmd.vercel.app/r/framed.json",
    "https://littmd.vercel.app/r/lightbox.json",
    "https://littmd.vercel.app/r/list-cover.json",
    "https://littmd.vercel.app/r/media.json"
  ],
  "files": [
    {
      "path": "registry/litt/components/litt-blocks/case-study.tsx",
      "type": "registry:component",
      "content": "\"use client\";\n// @litt/case-study 2026.11.07. What changed: https://littmd.vercel.app/changelog.md\n\n/**\n * Case study: one project told as a page, for a studio's or a photographer's site. A block: a whole page built from\n * the litt parts, to copy and make your own. Swap the project, the words and the images at the top for yours; the\n * layout stays.\n *\n * Where the page sits, then the title and its line as one sentence in two inks. A wide hero image, the facts in a row\n * of labels and values, and the story in sections with their label in a narrow left column and the text at a reading\n * measure beside it (R9, asymmetric and left-aligned). The series runs in a carousel, one image and the next peeking;\n * the details sit in a grid; the next project is one linked card at the end. Every image opens the lightbox on itself,\n * and the lightbox runs through them all in page order. The carousel follows it, so closing lands on the slide of the\n * image it closed on, with focus there. Nothing moves until someone moves it; opening the lightbox is the page's one\n * expressive moment.\n */\nimport { useId, useRef, useState, type ReactNode } from \"react\";\nimport { Breadcrumb } from \"../litt/breadcrumb\";\nimport { Card, CardBody, CardCover, CardDescription, CardLink, CardTitle } from \"../litt/card\";\nimport { Carousel, CarouselContent, CarouselControls, CarouselItem } from \"../litt/carousel\";\nimport { Lightbox, type LightboxItem } from \"../litt/lightbox\";\nimport { ProjectCover } from \"../litt/list-cover\";\nimport { Media } from \"../litt/media\";\nimport { Heading } from \"../litt/framed\";\n\n/* ----------------------------------------------------------------- data */\n\n/* Drawn stand-ins for photographs: a sky in two colors, light falling from the top, two ridges and a trace of grain.\n   An SVG, so the page fetches nothing; named colors, because these are pictures, not the interface. The scene is\n   cropped to the width and height asked for, as a photograph would be. Replace every src below with your images. */\nfunction plate(sky: string, glow: string, far: string, near: string, width = 1600, height = 1000) {\n  const svg =\n    `<svg xmlns='http://www.w3.org/2000/svg' width='${width}' height='${height}' viewBox='0 0 1600 1000' preserveAspectRatio='xMidYMid slice'>` +\n    `<defs><linearGradient id='s' x2='0' y2='1'><stop offset='0' stop-color='${sky}'/><stop offset='1' stop-color='${glow}'/></linearGradient>` +\n    `<radialGradient id='l' cx='.5' cy='0' r='.9'><stop offset='0' stop-color='${glow}' stop-opacity='.7'/><stop offset='1' stop-color='${glow}' stop-opacity='0'/></radialGradient>` +\n    `<filter id='g'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .12 0'/></filter></defs>` +\n    `<rect width='1600' height='1000' fill='url(#s)'/><rect width='1600' height='1000' fill='url(#l)'/>` +\n    `<path d='M0 620C260 540 430 590 650 530S1110 450 1600 545V1000H0Z' fill='${far}'/>` +\n    `<path d='M0 780C310 700 560 765 830 720S1310 655 1600 735V1000H0Z' fill='${near}'/>` +\n    `<rect width='1600' height='1000' filter='url(#g)'/></svg>`;\n  return `data:image/svg+xml,${encodeURIComponent(svg)}`;\n}\n\n/** The project, and where the page sits. Point the links at your routes. */\nconst PROJECT = {\n  name: \"Atlas portfolio\",\n  line: \"A photographer's work, on a grid that stays out of the way.\",\n  trail: [\n    { label: \"Work\", href: \"/work\" },\n    { label: \"Atlas portfolio\", href: \"/work/atlas\" },\n  ],\n  facts: [\n    { label: \"Client\", value: \"Ines Ortega\" },\n    { label: \"Year\", value: \"2025\" },\n    { label: \"Role\", value: \"Design and build\" },\n    { label: \"Built with\", value: \"Framer, a custom CMS\" },\n  ],\n};\n\n/** An image: what it shows (alt), the line under it, and its own size, so its frame has its shape before it loads. */\ntype Photo = LightboxItem & { id: string; caption: string; width: number; height: number };\n\nconst HERO: Photo = { id: \"dusk\", src: plate(\"darkslateblue\", \"lightsalmon\", \"dimgray\", \"darkslategray\"), alt: \"A violet dusk going salmon at the horizon, over grey hills\", caption: \"Dusk, the series' first frame\", width: 1600, height: 1000 };\n\n/** The series, in the carousel. */\nconst SERIES: Photo[] = [\n  { id: \"dawn\", src: plate(\"lightsteelblue\", \"mistyrose\", \"slategray\", \"darkslategray\"), alt: \"Dawn over two ridges, the sky pale blue going pink\", caption: \"Dawn over the ridge\", width: 1600, height: 1000 },\n  { id: \"dune\", src: plate(\"peachpuff\", \"navajowhite\", \"peru\", \"sienna\"), alt: \"Dunes at noon, a ridge of shadow across the middle\", caption: \"Dunes at noon\", width: 1600, height: 1000 },\n  { id: \"tide\", src: plate(\"steelblue\", \"lightblue\", \"cadetblue\", \"darkslategray\"), alt: \"A blue evening over a dark shore\", caption: \"Tide line\", width: 1600, height: 1000 },\n  { id: \"fog\", src: plate(\"gainsboro\", \"whitesmoke\", \"darkgray\", \"dimgray\"), alt: \"Fog over two grey ridges, the light flat and white\", caption: \"Fog bank\", width: 1600, height: 1000 },\n  { id: \"valley\", src: plate(\"honeydew\", \"darkseagreen\", \"seagreen\", \"darkolivegreen\"), alt: \"A green valley under a pale sky\", caption: \"Valley\", width: 1600, height: 1000 },\n];\n\n/** The details, in the grid: two upright, then one wide across both columns. */\nconst DETAILS: Photo[] = [\n  { id: \"valley-upright\", src: plate(\"honeydew\", \"darkseagreen\", \"seagreen\", \"darkolivegreen\", 1200, 1500), alt: \"The valley, cropped upright for a phone\", caption: \"The same frame, cropped for a phone\", width: 1200, height: 1500 },\n  { id: \"dune-upright\", src: plate(\"peachpuff\", \"navajowhite\", \"peru\", \"sienna\", 1200, 1500), alt: \"The dunes, cropped upright for a phone\", caption: \"Crops are set by hand, per frame\", width: 1200, height: 1500 },\n  { id: \"tide-wide\", src: plate(\"steelblue\", \"lightblue\", \"cadetblue\", \"darkslategray\", 2000, 900), alt: \"The tide line at evening, as a panorama\", caption: \"Panoramas run the full width of the grid\", width: 2000, height: 900 },\n];\n\n/** The next project, at the end. */\nconst NEXT = { name: \"Halo site\", note: \"The studio site, on Framer with a custom CMS.\", href: \"/work/halo\" };\n\n/* Every image, in page order: the hero, the series, then the details. The lightbox runs through them all. */\nconst ALL: Photo[] = [HERO, ...SERIES, ...DETAILS];\nconst FIRST_IN_SERIES = 1;\n\n/* ----------------------------------------------------------------- the page */\n\n/** One section of the story: its label in a narrow left column and the text at a reading measure beside it. */\nfunction Section({ title, children }: { title: string; children: ReactNode }) {\n  const id = useId();\n  return (\n    <section aria-labelledby={id} className=\"grid gap-1 @min-[48rem]:grid-cols-[minmax(0,1fr)_minmax(0,2fr)] @min-[48rem]:gap-12\">\n      <Heading level={2} id={id} className=\"text-litt-h4 text-litt-fg\">\n        {title}\n      </Heading>\n      <div className=\"grid max-w-(--litt-measure) gap-4 text-litt-reading text-litt-fg-muted\">{children}</div>\n    </section>\n  );\n}\n\nexport function CaseStudy() {\n  const page = useRef<HTMLElement>(null);\n  const seriesId = useId();\n  const detailsId = useId();\n  const [open, setOpen] = useState<number | null>(null);\n  const [slide, setSlide] = useState(0);\n\n  /* The buttons that open the lightbox are in page order, the same order as ALL. */\n  const opener = (i: number) => page.current?.querySelectorAll<HTMLElement>(\"[aria-haspopup=dialog]\")[i];\n\n  return (\n    <article ref={page} className=\"@container mx-auto grid w-full max-w-5xl gap-12\">\n      <header className=\"grid gap-6\">\n        <Breadcrumb label=\"Where this page is\" items={PROJECT.trail} />\n        {/* The title and its line as one sentence in two inks; the h1 stays the name alone. */}\n        <div className=\"flex flex-wrap items-baseline gap-x-2 text-litt-h1 text-balance\">\n          <Heading level={1} className=\"text-litt-fg\">{PROJECT.name}</Heading>\n          <p className=\"font-normal text-litt-fg-muted\">{PROJECT.line}</p>\n        </div>\n      </header>\n\n      {/* The image the page opens on loads at once; every other one waits until it is near the screen. */}\n      <Media src={HERO.src} alt={HERO.alt} ratio=\"16/9\" priority onOpen={() => setOpen(0)} />\n\n      <dl className=\"grid grid-cols-2 gap-x-8 gap-y-6 border-y border-litt-line py-6 @min-[48rem]:grid-cols-4\">\n        {PROJECT.facts.map((fact) => (\n          <div key={fact.label} className=\"grid content-start gap-1\">\n            <dt className=\"text-litt-caption text-litt-fg-subtle\">{fact.label}</dt>\n            <dd className=\"text-litt-small text-litt-fg\">{fact.value}</dd>\n          </div>\n        ))}\n      </dl>\n\n      <Section title=\"The brief\">\n        <p>\n          Ines shoots long series of one place, often over a year. Her old site showed them as a wall of thumbnails, so\n          nobody saw a series in order and nobody saw a frame at size.\n        </p>\n        <p>She wanted the work first, in the order she made it, and a site she could update herself between shoots.</p>\n      </Section>\n\n      <section aria-labelledby={seriesId} className=\"grid gap-6\">\n        <div className=\"grid gap-1\">\n          <Heading level={2} id={seriesId} className=\"text-litt-h4 text-litt-fg\">\n            The series\n          </Heading>\n          <p className=\"max-w-(--litt-measure) text-litt-small text-litt-fg-subtle\">Each series opens on its first frame at full width, and the next one is always in view.</p>\n        </div>\n        <Carousel label=\"Series pictures\" index={slide} onIndexChange={setSlide}>\n          <CarouselContent>\n            {SERIES.map((image, i) => (\n              <CarouselItem key={image.id} label={image.caption}>\n                <Media src={image.src} alt={image.alt} ratio=\"16/9\" caption={image.caption} onOpen={() => setOpen(FIRST_IN_SERIES + i)} />\n              </CarouselItem>\n            ))}\n          </CarouselContent>\n          <CarouselControls />\n        </Carousel>\n      </section>\n\n      <Section title=\"The grid\">\n        <p>\n          One column on a phone and two from a tablet up, with every crop set by hand, so a horizon never lands under a\n          caption. The frames keep their shape while they load, so the page never jumps as you read.\n        </p>\n      </Section>\n\n      <section aria-labelledby={detailsId} className=\"grid gap-6\">\n        <Heading level={2} id={detailsId} className=\"sr-only\">\n          Details\n        </Heading>\n        <ul className=\"grid gap-6 @min-[36rem]:grid-cols-2\">\n          {DETAILS.map((image, i) => (\n            <li key={image.id} className={image.width > image.height ? \"@min-[36rem]:col-span-2\" : \"\"}>\n              <Media\n                src={image.src}\n                alt={image.alt}\n                ratio={image.width / image.height}\n                caption={image.caption}\n                onOpen={() => setOpen(FIRST_IN_SERIES + SERIES.length + i)}\n              />\n            </li>\n          ))}\n        </ul>\n      </section>\n\n      <Section title=\"Next\">\n        <Card cover=\"inset\" className=\"max-w-sm\">\n          <CardCover>\n            <ProjectCover name=\"landing\" />\n          </CardCover>\n          <CardBody>\n            <CardTitle>\n              <CardLink href={NEXT.href}>{NEXT.name}</CardLink>\n            </CardTitle>\n            <CardDescription>{NEXT.note}</CardDescription>\n          </CardBody>\n        </Card>\n      </Section>\n\n      <Lightbox\n        label={PROJECT.name}\n        items={ALL}\n        index={open}\n        onIndexChange={(i) => {\n          setOpen(i);\n          /* The carousel follows the lightbox through the series, so it is on the right slide when it closes. */\n          if (i !== null && i >= FIRST_IN_SERIES && i < FIRST_IN_SERIES + SERIES.length) setSlide(i - FIRST_IN_SERIES);\n        }}\n        returnFocus={opener}\n      />\n    </article>\n  );\n}\n",
      "target": "components/litt-blocks/case-study.tsx"
    }
  ],
  "docs": "Import CaseStudy from components/litt-blocks/case-study and render it as a page's content. The project, its words and its images sit at the top of the file: replace the drawn stand-ins with your images and give each its width and height. See it live at https://littmd.vercel.app/#case-study.",
  "meta": {
    "version": "2026.11.07",
    "released": "2026-11-07",
    "changelog": "https://littmd.vercel.app/changelog.md"
  }
}
