{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "scroll-accordion-showcase",
  "title": "Scroll Accordion Showcase",
  "author": "AlgorizeTech",
  "description": "A scroll-linked accordion pairing expanding text steps with a synced image panel. Use it for long-form product explainers.",
  "dependencies": [
    "lucide-react"
  ],
  "registryDependencies": [
    "utils"
  ],
  "files": [
    {
      "path": "src/components/custom/blocks/ScrollAccordionShowcaseBlock.tsx",
      "content": "\"use client\";\n\nimport { cn } from \"@/lib/utils\";\nimport { ArrowRight, CheckCircle2, Sparkles } from \"lucide-react\";\nimport React, { useCallback, useEffect, useRef, useState } from \"react\";\n\nexport interface AccordionShowcaseItem {\n  id: string;\n  stepNumber: string;\n  title: string;\n  description: string;\n  tags?: string[];\n  image: string;\n  badgeText?: string;\n}\n\nexport type ShowcaseDisplayMode = \"both\" | \"text-only\" | \"image-only\";\n\nexport interface ScrollAccordionShowcaseProps\n  extends React.HTMLAttributes<HTMLDivElement> {\n  items: AccordionShowcaseItem[];\n  defaultIndex?: number;\n  displayMode?: ShowcaseDisplayMode;\n  localStorageKey?: string;\n  defaultAccentColor?: string;\n  scrollerRef?: React.RefObject<HTMLElement | null>;\n}\n\nconst EASE_IN_OUT = \"cubic-bezier(0.42, 0, 0.58, 1)\";\nconst EASE_OUT = \"cubic-bezier(0, 0, 0.58, 1)\";\nconst BODY_EASE = \"cubic-bezier(0.16, 1, 0.3, 1)\";\n\n// Stable fallback for an empty `items` list, so `useWaitSwap` sees the same\n// object on every render.\nconst NO_ITEM = {} as AccordionShowcaseItem;\n\nconst keyframes = `\n@keyframes scroll-accordion-image-in { from { opacity: 0; scale: 1.04; } }\n@keyframes scroll-accordion-title-in { from { opacity: 0; translate: 0 5px; } }\n`;\n\ntype SwapFrom = { opacity: string; scale: string; translate: string };\n\n/**\n * One element swapped in \"wait\" order: when `itemKey` changes, the element on\n * screen plays `exit` from wherever it is, and only once that ends is the\n * latest item rendered (it enters with its own CSS animation). If the key\n * comes back mid-exit, `back` settles the element from where it got to.\n * `ref` must be attached to the swapped element.\n */\nfunction useWaitSwap<T, E extends HTMLElement>(\n  ref: React.RefObject<E | null>,\n  item: T,\n  itemKey: string,\n  exit: (el: E, from: SwapFrom) => Animation[],\n  back: (el: E, from: SwapFrom) => void,\n) {\n  const [shownKey, setShownKey] = useState(itemKey);\n  const leaving = shownKey !== itemKey;\n\n  // The leaving element keeps showing the item it had; otherwise it follows\n  // the current one. Held in state (synced during render while not leaving)\n  // so render never reads a ref.\n  const [lastShown, setLastShown] = useState(item);\n  if (!leaving && lastShown !== item) setLastShown(item);\n  const latestKey = useRef(itemKey);\n  const handlers = useRef({ exit, back });\n  useEffect(() => {\n    latestKey.current = itemKey;\n    handlers.current = { exit, back };\n  });\n\n  useEffect(() => {\n    if (!leaving) return;\n    const el = ref.current;\n    if (!el) {\n      setShownKey(latestKey.current);\n      return;\n    }\n    let done = false;\n    const animations = handlers.current.exit(el, readSwapFrom(el));\n    Promise.all(animations.map((a) => a.finished))\n      .then(() => {\n        done = true;\n        setShownKey(latestKey.current);\n      })\n      .catch(() => {});\n    return () => {\n      if (done) return;\n      // The key came back before the exit finished: settle back from here.\n      const from = readSwapFrom(el);\n      animations.forEach((a) => a.cancel());\n      handlers.current.back(el, from);\n    };\n  }, [leaving, ref]);\n\n  return { shown: leaving ? lastShown : item, shownKey };\n}\n\nfunction readSwapFrom(el: Element): SwapFrom {\n  const style = getComputedStyle(el);\n  return {\n    opacity: style.opacity,\n    scale: style.scale === \"none\" ? \"1\" : style.scale,\n    translate: style.translate === \"none\" ? \"0px 0px\" : style.translate,\n  };\n}\n\n/**\n * Keeps an accordion body mounted while it closes: `open` drives the\n * transition, `mounted` drops once the closing transition ends. A body that\n * is open on the first render is simply there.\n */\nfunction usePresence<E extends HTMLElement>(show: boolean, exitMs: number) {\n  const [mounted, setMounted] = useState(show);\n  const [open, setOpen] = useState(show);\n\n  // React to `show` flipping during render: close at once, reopen a body\n  // that is still mounted (mid-close), or mount a closed body first.\n  const [prevShow, setPrevShow] = useState(show);\n  if (show !== prevShow) {\n    setPrevShow(show);\n    if (!show) setOpen(false);\n    else if (mounted) setOpen(true);\n    else setMounted(true);\n  }\n\n  // A freshly mounted body commits closed; open it from the commit, before\n  // paint. Resolve the closed styles first, or nothing transitions.\n  const attach = useCallback((el: E | null) => {\n    if (!el) return;\n    el.getBoundingClientRect();\n    setOpen(true);\n  }, []);\n\n  useEffect(() => {\n    if (show || !mounted) return;\n    const timer = window.setTimeout(() => setMounted(false), exitMs + 100);\n    return () => window.clearTimeout(timer);\n  }, [show, mounted, exitMs]);\n\n  const onTransitionEnd = (e: React.TransitionEvent) => {\n    if (e.target === e.currentTarget && e.propertyName === \"opacity\" && !show) {\n      setMounted(false);\n    }\n  };\n\n  return { attach, mounted, open, onTransitionEnd };\n}\n\n/** An accordion body that opens to its content height and closes to nothing. */\nfunction AccordionBody({\n  isActive,\n  children,\n}: {\n  isActive: boolean;\n  children: React.ReactNode;\n}) {\n  const { attach, mounted, open, onTransitionEnd } =\n    usePresence<HTMLDivElement>(isActive, 350);\n  if (!mounted) return null;\n  return (\n    <div\n      ref={attach}\n      onTransitionEnd={onTransitionEnd}\n      className=\"overflow-hidden z-10\"\n      style={{\n        display: \"grid\",\n        gridTemplateRows: open ? \"1fr\" : \"0fr\",\n        opacity: open ? 1 : 0,\n        transition: `grid-template-rows 0.35s ${BODY_EASE}, opacity 0.35s ${BODY_EASE}`,\n      }}\n    >\n      <div className=\"min-h-0 overflow-hidden\">{children}</div>\n    </div>\n  );\n}\n\nfunction hexToRgba(hex: string, alpha: number): string {\n  if (/^#([A-Fa-f0-9]{3}){1,2}$/.test(hex)) {\n    let digits = hex.substring(1);\n    if (digits.length === 3)\n      digits = digits\n        .split(\"\")\n        .map((d) => d + d)\n        .join(\"\");\n    const packed = parseInt(digits, 16);\n    return `rgba(${(packed >> 16) & 255},${(packed >> 8) & 255},${packed & 255},${alpha})`;\n  }\n  // Any other CSS colour (the theme's `var(--primary)`, rgb(), hsl()…).\n  return `color-mix(in oklab, ${hex} ${alpha * 100}%, transparent)`;\n}\n\nexport const ScrollAccordionShowcase = React.forwardRef<\n  HTMLDivElement,\n  ScrollAccordionShowcaseProps\n>(\n  (\n    {\n      items,\n      defaultIndex = 0,\n      displayMode = \"both\",\n      localStorageKey = \"primaryColor\",\n      defaultAccentColor = \"var(--primary)\",\n      scrollerRef,\n      className,\n      ...props\n    },\n    ref,\n  ) => {\n    const [activeIndex, setActiveIndex] = useState(defaultIndex);\n    const [accentColor, setAccentColor] = useState<string>(defaultAccentColor);\n\n    // Refs for precision scroll tracking and animation lockout\n    const itemRefs = useRef<(HTMLDivElement | null)[]>([]);\n    const gridRef = useRef<HTMLDivElement>(null);\n    const stickyCardRef = useRef<HTMLDivElement>(null);\n    const activeIndexRef = useRef(defaultIndex);\n    const isClickScrolling = useRef(false);\n    const clickTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n\n    useEffect(() => {\n      activeIndexRef.current = activeIndex;\n    }, [activeIndex]);\n\n    // 1. Instant 0ms LocalStorage & Theme Sync Engine\n    useEffect(() => {\n      if (typeof window === \"undefined\") return;\n\n      const loadColor = () => {\n        let foundColor: string | null = null;\n        const knownKeys = [\n          localStorageKey,\n          \"primaryColor\",\n          \"docs-theme-color\",\n          \"theme-color\",\n          \"accentColor\",\n          \"color\",\n          \"theme\",\n          \"primary-color\",\n        ];\n\n        for (const k of knownKeys) {\n          if (!k) continue;\n          try {\n            const val = localStorage.getItem(k);\n            if (val) {\n              const cleaned = val.replace(/['\"]/g, \"\").trim();\n              const hexMatch = cleaned.match(\n                /#([0-9A-Fa-f]{6}|[0-9A-Fa-f]{3})\\b/,\n              );\n              if (hexMatch) {\n                foundColor = hexMatch[0];\n                break;\n              }\n              if (/^(rgb|hsl)a?\\(/i.test(cleaned)) {\n                foundColor = cleaned;\n                break;\n              }\n            }\n          } catch {\n            // Unreadable stylesheet (cross-origin): try the next one.\n          }\n        }\n\n        if (!foundColor && typeof localStorage !== \"undefined\") {\n          try {\n            for (let i = 0; i < localStorage.length; i++) {\n              const k = localStorage.key(i);\n              if (\n                k &&\n                (k.toLowerCase().includes(\"color\") ||\n                  k.toLowerCase().includes(\"theme\") ||\n                  k.toLowerCase().includes(\"primary\"))\n              ) {\n                const val = localStorage.getItem(k);\n                if (val) {\n                  const match = val.match(/#([0-9A-Fa-f]{6}|[0-9A-Fa-f]{3})\\b/);\n                  if (match) {\n                    foundColor = match[0];\n                    break;\n                  }\n                }\n              }\n            }\n          } catch {\n            // Unreadable stylesheet (cross-origin): try the next one.\n          }\n        }\n\n        if (!foundColor && typeof document !== \"undefined\") {\n          try {\n            const computed = getComputedStyle(document.documentElement);\n            const cssVar =\n              computed.getPropertyValue(\"--primary-color\") ||\n              computed.getPropertyValue(\"--primary\") ||\n              computed.getPropertyValue(\"--theme-color\");\n            if (cssVar && cssVar.trim()) {\n              const trimmed = cssVar.trim();\n              if (\n                /^#([0-9A-Fa-f]{6}|[0-9A-Fa-f]{3})$/.test(trimmed) ||\n                /^(rgb|hsl)a?\\(/i.test(trimmed)\n              ) {\n                foundColor = trimmed;\n              }\n            }\n          } catch {\n            // Unreadable stylesheet (cross-origin): try the next one.\n          }\n        }\n\n        const targetColor = foundColor || defaultAccentColor;\n        setAccentColor((prev) => (prev !== targetColor ? targetColor : prev));\n      };\n\n      loadColor();\n\n      const origProtoSetItem = Storage.prototype.setItem;\n      Storage.prototype.setItem = function (key: string, value: string) {\n        origProtoSetItem.apply(this, [key, value]);\n        loadColor();\n      };\n      const origInstanceSetItem = window.localStorage.setItem;\n      window.localStorage.setItem = function (key: string, value: string) {\n        origInstanceSetItem.apply(window.localStorage, [key, value]);\n        loadColor();\n      };\n\n      const observer = new MutationObserver(loadColor);\n      if (typeof document !== \"undefined\") {\n        observer.observe(document.documentElement, {\n          attributes: true,\n          attributeFilter: [\"style\", \"class\", \"data-theme\", \"data-color\"],\n        });\n      }\n\n      window.addEventListener(\"storage\", loadColor);\n      window.addEventListener(\"theme-color-change\", loadColor);\n      const intervalId = setInterval(loadColor, 50);\n\n      return () => {\n        Storage.prototype.setItem = origProtoSetItem;\n        window.localStorage.setItem = origInstanceSetItem;\n        observer.disconnect();\n        window.removeEventListener(\"storage\", loadColor);\n        window.removeEventListener(\"theme-color-change\", loadColor);\n        clearInterval(intervalId);\n      };\n    }, [localStorageKey, defaultAccentColor]);\n\n    // 2. Unified 60fps Scroll Engine (Sticky Mockup Pinning + Precision Focal-Line Step Tracking)\n    useEffect(() => {\n      if (typeof window === \"undefined\") return;\n\n      let rafId: number;\n      const updateEngine = () => {\n        // A. Handle Sticky Mockup Pinning\n        if (\n          gridRef.current &&\n          stickyCardRef.current &&\n          displayMode !== \"text-only\"\n        ) {\n          if (window.innerWidth < 1024) {\n            stickyCardRef.current.style.transform = \"translate3d(0, 0, 0)\";\n            stickyCardRef.current.style.position = \"\";\n          } else {\n            const gridRect = gridRef.current.getBoundingClientRect();\n            const cardHeight = stickyCardRef.current.offsetHeight;\n            const gridHeight = gridRef.current.offsetHeight;\n            const topOffset = 112;\n\n            if (gridRect.top < topOffset) {\n              const rawOffset = topOffset - gridRect.top;\n              const maxTranslate = Math.max(0, gridHeight - cardHeight);\n              const bounded = Math.min(rawOffset, maxTranslate);\n              stickyCardRef.current.style.position = \"relative\";\n              stickyCardRef.current.style.transform = `translate3d(0, ${bounded}px, 0)`;\n            } else {\n              stickyCardRef.current.style.position = \"\";\n              stickyCardRef.current.style.transform = \"translate3d(0, 0, 0)\";\n            }\n          }\n        }\n\n        // B. Precision Focal-Line Step Tracking (Only on Desktop to prevent mobile layout shifts)\n        if (\n          displayMode !== \"image-only\" &&\n          !isClickScrolling.current &&\n          window.innerWidth >= 1024\n        ) {\n          const scroller = scrollerRef?.current;\n          const focalLine = scroller\n            ? scroller.getBoundingClientRect().top +\n              scroller.clientHeight * 0.42\n            : window.innerHeight * 0.42;\n\n          let newIndex = 0;\n          for (let i = 0; i < itemRefs.current.length; i++) {\n            const el = itemRefs.current[i];\n            if (!el) continue;\n            const rect = el.getBoundingClientRect();\n            if (rect.top <= focalLine || i === 0) {\n              newIndex = i;\n            } else {\n              break;\n            }\n          }\n\n          if (newIndex !== activeIndexRef.current) {\n            activeIndexRef.current = newIndex;\n            setActiveIndex(newIndex);\n          }\n        }\n      };\n\n      const handleScroll = () => {\n        cancelAnimationFrame(rafId);\n        rafId = requestAnimationFrame(updateEngine);\n      };\n\n      const targetScroller = scrollerRef?.current || window;\n      targetScroller.addEventListener(\"scroll\", handleScroll, {\n        passive: true,\n      });\n      window.addEventListener(\"resize\", handleScroll, { passive: true });\n\n      updateEngine();\n      const interval = setInterval(updateEngine, 100);\n\n      return () => {\n        targetScroller.removeEventListener(\"scroll\", handleScroll);\n        window.removeEventListener(\"resize\", handleScroll);\n        cancelAnimationFrame(rafId);\n        clearInterval(interval);\n        if (clickTimeoutRef.current) clearTimeout(clickTimeoutRef.current);\n      };\n    }, [displayMode, items, scrollerRef]);\n\n    const handleCardClick = (index: number) => {\n      if (clickTimeoutRef.current) clearTimeout(clickTimeoutRef.current);\n      isClickScrolling.current = true;\n      activeIndexRef.current = index;\n      setActiveIndex(index);\n\n      itemRefs.current[index]?.scrollIntoView({\n        behavior: \"smooth\",\n        block: \"center\",\n      });\n\n      clickTimeoutRef.current = setTimeout(() => {\n        isClickScrolling.current = false;\n      }, 700);\n    };\n\n    const activeItem = items[activeIndex] || items[0] || NO_ITEM;\n\n    // The mockup image and its caption each swap in \"wait\" order: the old one\n    // leaves completely before the new one comes in.\n    const imageRef = useRef<HTMLDivElement>(null);\n    const image = useWaitSwap<typeof activeItem, HTMLDivElement>(\n      imageRef,\n      activeItem,\n      activeItem.id || \"default\",\n      (el, from) => [\n        el.animate(\n          { opacity: [from.opacity, \"0\"], scale: [from.scale, \"0.96\"] },\n          { duration: 400, easing: EASE_IN_OUT, fill: \"forwards\" },\n        ),\n      ],\n      (el, from) => {\n        el.animate(\n          { opacity: [from.opacity, \"1\"], scale: [from.scale, \"1\"] },\n          { duration: 400, easing: EASE_IN_OUT },\n        );\n      },\n    );\n    const captionRef = useRef<HTMLParagraphElement>(null);\n    const caption = useWaitSwap<typeof activeItem, HTMLParagraphElement>(\n      captionRef,\n      activeItem,\n      activeItem.title || \"default-title\",\n      (el, from) => [\n        el.animate(\n          {\n            opacity: [from.opacity, \"0\"],\n            translate: [from.translate, \"0 -5px\"],\n          },\n          { duration: 200, easing: EASE_OUT, fill: \"forwards\" },\n        ),\n      ],\n      (el, from) => {\n        el.animate(\n          {\n            opacity: [from.opacity, \"1\"],\n            translate: [from.translate, \"0px 0px\"],\n          },\n          { duration: 200, easing: EASE_OUT },\n        );\n      },\n    );\n\n    const activeBgGlow = hexToRgba(accentColor, 0.12);\n    const activeBadgeBg = hexToRgba(accentColor, 0.1);\n    const activeBadgeBorder = hexToRgba(accentColor, 0.3);\n\n    return (\n      <div\n        ref={ref}\n        className={cn(\n          \"relative w-full max-w-7xl mx-auto px-4 sm:px-6 py-8 md:py-16 select-none transition-colors duration-300\",\n          className,\n        )}\n        {...props}\n      >\n        <style>{keyframes}</style>\n\n        {displayMode === \"image-only\" && (\n          <div className=\"flex items-center justify-start sm:justify-center gap-2 sm:gap-3 overflow-x-auto pb-4 sm:pb-6 mb-4 sm:mb-8 border-b border-border no-scrollbar px-1\">\n            {items.map((item, index) => {\n              const isActive = activeIndex === index;\n              return (\n                <button\n                  key={item.id}\n                  onClick={() => handleCardClick(index)}\n                  style={{\n                    backgroundColor: isActive ? activeBadgeBg : undefined,\n                    borderColor: isActive ? accentColor : undefined,\n                    color: isActive ? accentColor : undefined,\n                  }}\n                  className={cn(\n                    \"inline-flex items-center gap-2 px-3.5 sm:px-4 py-1.5 sm:py-2 rounded-full text-[11px] sm:text-xs font-mono font-semibold uppercase transition-all duration-300 border shrink-0 cursor-pointer outline-none\",\n                    isActive\n                      ? \"shadow-sm scale-105\"\n                      : \"bg-muted border-border text-muted-foreground hover:border-border\",\n                  )}\n                >\n                  <span>{item.stepNumber}</span>\n                  <span className=\"truncate max-w-[120px] sm:max-w-[140px]\">\n                    {item.title}\n                  </span>\n                </button>\n              );\n            })}\n          </div>\n        )}\n\n        <div\n          ref={gridRef}\n          className={cn(\n            \"flex flex-col gap-6 sm:gap-12 relative\",\n            displayMode === \"both\" &&\n              \"lg:grid lg:grid-cols-12 lg:gap-16 items-start lg:items-stretch\",\n            displayMode === \"text-only\" && \"max-w-4xl mx-auto\",\n            displayMode === \"image-only\" && \"max-w-5xl mx-auto\",\n          )}\n        >\n          {/* LEFT COLUMN: TEXT ACCORDIONS */}\n          {displayMode !== \"image-only\" && (\n            <div\n              className={cn(\n                \"w-full flex flex-col gap-4 sm:gap-6\",\n                displayMode === \"both\" ? \"lg:col-span-6\" : \"w-full\",\n              )}\n            >\n              {items.map((item, index) => {\n                const isActive = activeIndex === index;\n                return (\n                  <div\n                    key={item.id}\n                    ref={(el) => {\n                      itemRefs.current[index] = el;\n                    }}\n                    className=\"py-1 scroll-mt-24 transition-all duration-300\"\n                  >\n                    <div\n                      onClick={() => handleCardClick(index)}\n                      style={{\n                        borderColor: isActive ? accentColor : undefined,\n                        boxShadow: isActive\n                          ? `0 20px 40px -15px ${hexToRgba(accentColor, 0.15)}`\n                          : undefined,\n                      }}\n                      className={cn(\n                        \"group relative flex flex-col justify-between p-5 sm:p-8 rounded-2xl sm:rounded-3xl border transition-all duration-500 cursor-pointer overflow-hidden bg-card outline-none\",\n                        isActive\n                          ? \"shadow-2xl ring-1 ring-foreground/5\"\n                          : \"border-border/80 opacity-85 hover:opacity-100 hover:border-border\",\n                      )}\n                    >\n                      {isActive && (\n                        <div\n                          style={{ backgroundColor: activeBgGlow }}\n                          className=\"absolute -top-24 -right-24 w-56 h-56 rounded-full blur-3xl pointer-events-none transition-colors duration-500\"\n                        />\n                      )}\n\n                      {/* Accordion Header */}\n                      <div className=\"flex items-start sm:items-center justify-between gap-4 z-10\">\n                        <div className=\"flex items-start sm:items-center gap-3 sm:gap-4 min-w-0\">\n                          <span\n                            style={{\n                              backgroundColor: isActive\n                                ? activeBadgeBg\n                                : undefined,\n                              borderColor: isActive\n                                ? activeBadgeBorder\n                                : undefined,\n                              color: isActive ? accentColor : undefined,\n                            }}\n                            className={cn(\n                              \"font-mono text-xs sm:text-sm font-semibold px-2.5 sm:px-3 py-1 sm:py-1.5 rounded-lg sm:rounded-xl border transition-all duration-300 shrink-0 mt-0.5 sm:mt-0\",\n                              !isActive &&\n                                \"bg-muted border-border text-muted-foreground\",\n                            )}\n                          >\n                            {item.stepNumber}\n                          </span>\n                          <h3\n                            className={cn(\n                              \"text-base sm:text-2xl font-semibold tracking-tight transition-colors duration-300 leading-snug sm:leading-tight\",\n                              isActive\n                                ? \"text-foreground\"\n                                : \"text-muted-foreground\",\n                            )}\n                          >\n                            {item.title}\n                          </h3>\n                        </div>\n                        <div\n                          style={{\n                            backgroundColor: isActive ? accentColor : undefined,\n                            color: isActive\n                              ? accentColor === \"var(--primary)\"\n                                ? \"var(--primary-foreground)\"\n                                : \"#000000\"\n                              : undefined,\n                          }}\n                          className={cn(\n                            \"w-8 h-8 sm:w-9 sm:h-9 rounded-full flex items-center justify-center shrink-0 transition-all duration-300 mt-0.5 sm:mt-0 self-start sm:self-center\",\n                            isActive\n                              ? \"rotate-0 shadow-md font-semibold\"\n                              : \"bg-muted text-muted-foreground -rotate-45 group-hover:bg-foreground/10 group-hover:text-foreground\",\n                          )}\n                        >\n                          <ArrowRight className=\"w-3.5 h-3.5 sm:w-4 sm:h-4 stroke-[2.5]\" />\n                        </div>\n                      </div>\n\n                      {/* Accordion Body */}\n                      <AccordionBody isActive={isActive}>\n                        <div className=\"pt-4 sm:pt-6 mt-4 sm:mt-6 border-t border-border flex flex-col gap-4 sm:gap-6\">\n                          {/* Inline Mobile Image for 'both' mode */}\n                          {displayMode === \"both\" && (\n                            <div className=\"block lg:hidden w-full relative rounded-xl overflow-hidden aspect-[16/10] border border-border/80 shadow-sm mt-2\">\n                              <img\n                                src={item.image}\n                                alt={item.title}\n                                className=\"w-full h-full object-cover object-top\"\n                              />\n                            </div>\n                          )}\n                          <p className=\"text-muted-foreground text-[13px] sm:text-base leading-relaxed\">\n                            {item.description}\n                          </p>\n                          {item.tags && item.tags.length > 0 && (\n                            <div className=\"flex flex-wrap gap-1.5 sm:gap-2 pt-1\">\n                              {item.tags.map((tag, tagIdx) => (\n                                <span\n                                  key={tagIdx}\n                                  style={{\n                                    backgroundColor: activeBadgeBg,\n                                    borderColor: activeBadgeBorder,\n                                    color: accentColor,\n                                  }}\n                                  className=\"inline-flex items-center gap-1 sm:gap-1.5 px-2.5 sm:px-3 py-1 rounded-full text-[10px] sm:text-[11px] font-semibold uppercase tracking-wider border transition-colors duration-300\"\n                                >\n                                  <CheckCircle2\n                                    style={{ color: accentColor }}\n                                    className=\"w-3 h-3 sm:w-3.5 sm:h-3.5\"\n                                  />\n                                  {tag}\n                                </span>\n                              ))}\n                            </div>\n                          )}\n                        </div>\n                      </AccordionBody>\n                    </div>\n                  </div>\n                );\n              })}\n            </div>\n          )}\n\n          {/* RIGHT COLUMN: STICKY DESKTOP IMAGE */}\n          {displayMode !== \"text-only\" && (\n            <div\n              className={cn(\n                \"w-full\",\n                // Hide completely on mobile if displayMode is both (it's rendered inline above)\n                displayMode === \"both\"\n                  ? \"hidden lg:block lg:col-span-6\"\n                  : \"w-full\",\n              )}\n            >\n              <div\n                ref={stickyCardRef}\n                className={cn(\n                  \"z-20 transition-transform duration-75 ease-out\",\n                  displayMode === \"both\" && \"lg:sticky lg:top-28 pt-2 lg:pt-0\",\n                )}\n              >\n                <div\n                  className={cn(\n                    \"relative w-full rounded-2xl sm:rounded-3xl overflow-hidden border border-border/80 bg-muted shadow-2xl transition-all duration-300\",\n                    displayMode === \"both\"\n                      ? \"aspect-[16/11]\"\n                      : \"aspect-video md:aspect-[16/9]\",\n                  )}\n                >\n                  <div\n                    key={image.shownKey}\n                    ref={imageRef}\n                    className=\"absolute inset-0 w-full h-full\"\n                    style={{\n                      animation: `scroll-accordion-image-in 0.4s ${EASE_IN_OUT} backwards`,\n                    }}\n                  >\n                    <img\n                      src={image.shown.image}\n                      alt={image.shown.title}\n                      className=\"w-full h-full object-cover object-top\"\n                    />\n                    <div className=\"absolute inset-0 bg-gradient-to-t from-black/80 via-black/20 to-transparent dark:from-black/90\" />\n                  </div>\n                  <div className=\"absolute bottom-4 sm:bottom-6 left-4 sm:left-6 right-4 sm:right-6 z-10 flex items-end justify-between pointer-events-none\">\n                    <div className=\"flex flex-col gap-1 sm:gap-1.5 p-3.5 sm:p-5 rounded-xl sm:rounded-2xl bg-card/90 backdrop-blur-md border border-border/80 shadow-2xl max-w-sm\">\n                      <div className=\"inline-flex items-center gap-2\">\n                        <Sparkles\n                          style={{ color: accentColor }}\n                          className=\"w-3.5 h-3.5 animate-pulse\"\n                        />\n                        <span\n                          style={{ color: accentColor }}\n                          className=\"text-[10px] sm:text-[11px] font-mono font-semibold uppercase tracking-widest\"\n                        >\n                          {activeItem.badgeText || \"Selected Service\"}\n                        </span>\n                      </div>\n                      <p\n                        key={caption.shownKey}\n                        ref={captionRef}\n                        className=\"text-sm sm:text-lg font-semibold text-foreground tracking-tight leading-snug truncate\"\n                        style={{\n                          animation: `scroll-accordion-title-in 0.2s ${EASE_OUT} backwards`,\n                        }}\n                      >\n                        {caption.shown.title}\n                      </p>\n                    </div>\n                  </div>\n                </div>\n              </div>\n            </div>\n          )}\n        </div>\n      </div>\n    );\n  },\n);\n\nScrollAccordionShowcase.displayName = \"ScrollAccordionShowcase\";\n",
      "type": "registry:component",
      "target": "components/custom/blocks/ScrollAccordionShowcaseBlock.tsx"
    }
  ],
  "docs": "Named export: ScrollAccordionShowcase. `displayMode` is both | text-only | image-only; items carry stepNumber, tags and an image. The open step persists via `localStorageKey`. Needs real page height to advance.",
  "categories": [
    "scroll",
    "marketing"
  ],
  "type": "registry:component"
}
