diff --git a/src/components/ImageGallery.tsx b/src/components/ImageGallery.tsx index e5ba94ad..ee341831 100644 --- a/src/components/ImageGallery.tsx +++ b/src/components/ImageGallery.tsx @@ -1,4 +1,5 @@ import { useState, useCallback, useEffect, useRef } from 'react'; +import { createPortal } from 'react-dom'; import { ChevronLeft, ChevronRight, X, Download } from 'lucide-react'; import { Blurhash } from 'react-blurhash'; import { cn } from '@/lib/utils'; @@ -125,8 +126,8 @@ export function ImageGallery({ ))} - {/* Lightbox */} - {lightboxIndex !== null && lightboxIndex !== undefined && ( + {/* Lightbox — portaled to document.body to escape stacking contexts (e.g. the center column z-0) */} + {lightboxIndex !== null && lightboxIndex !== undefined && createPortal( + />, + document.body, )} );