(function initDavidGouettGallery() {
            const filmstrip = document.getElementById('david-gouett-gallery-filmstrip-inner');
            const items = Array.from(document.querySelectorAll('.david-gouett-gallery-item'));
            const prevBtn = document.getElementById('david-gouett-gallery-prev');
            const nextBtn = document.getElementById('david-gouett-gallery-next');
            
            const lightbox = document.getElementById('david-gouett-gallery-lightbox-modal');
            const lightboxImg = document.getElementById('david-gouett-gallery-lightbox-display-img');
            const lightboxTitle = document.getElementById('david-gouett-gallery-lightbox-display-title');
            const lightboxClose = document.getElementById('david-gouett-gallery-lightbox-close');
            const lightboxPrev = document.getElementById('david-gouett-gallery-lightbox-prev-btn');
            const lightboxNext = document.getElementById('david-gouett-gallery-lightbox-next-btn');

            let scrollAmount = 0;
            const scrollSpeed = 0.5;
            let currentLightboxIndex = 0;
            let autoScrollEnabled = true;
            let resumeTimeout = null;

            const originalCount = items.length;
            items.forEach(child => {
                const clone = child.cloneNode(true);
                filmstrip.appendChild(clone);
            });

            function moveFilmstrip() {
                if (!autoScrollEnabled) return;
                scrollAmount -= scrollSpeed;
                const itemWidth = items[0].offsetWidth + 24;
                const totalWidth = originalCount * itemWidth;
                
                if (Math.abs(scrollAmount) >= totalWidth) {
                    scrollAmount = 0;
                }
                
                filmstrip.style.transform = `translateX(${scrollAmount}px)`;
                requestAnimationFrame(moveFilmstrip);
            }

            function manualScroll(direction) {
                autoScrollEnabled = false;
                const itemWidth = items[0].offsetWidth + 24;
                scrollAmount += direction * itemWidth;
                
                const totalWidth = originalCount * itemWidth;
                if (scrollAmount > 0) scrollAmount = -totalWidth + itemWidth;
                if (Math.abs(scrollAmount) >= totalWidth) scrollAmount = 0;
                
                filmstrip.style.transform = `translateX(${scrollAmount}px)`;
                
                clearTimeout(resumeTimeout);
                resumeTimeout = setTimeout(() => {
                    autoScrollEnabled = true;
                    requestAnimationFrame(moveFilmstrip);
                }, 3000);
            }

            function openLightbox(index) {
                currentLightboxIndex = index % originalCount;
                updateLightboxContent();
                lightbox.classList.add('active');
                document.body.style.overflow = 'hidden';
            }

            function closeLightbox() {
                lightbox.classList.remove('active');
                setTimeout(() => { document.body.style.overflow = ''; }, 600);
            }

            function updateLightboxContent() {
                const target = items[currentLightboxIndex];
                const img = target.querySelector('img');
                const title = target.querySelector('.font-headline-md').textContent;
                
                lightboxImg.style.opacity = '0';
                setTimeout(() => {
                    lightboxImg.src = img.src;
                    lightboxTitle.textContent = title;
                    lightboxImg.style.opacity = '1';
                }, 200);
            }

            function navigateLightbox(step) {
                currentLightboxIndex = (currentLightboxIndex + step + originalCount) % originalCount;
                updateLightboxContent();
            }

            // Event Binding
            window.addEventListener('load', () => requestAnimationFrame(moveFilmstrip));
            prevBtn.addEventListener('click', () => manualScroll(1));
            nextBtn.addEventListener('click', () => manualScroll(-1));

            document.querySelectorAll('.david-gouett-gallery-item').forEach((item, index) => {
                item.addEventListener('click', () => openLightbox(index));
            });

            lightboxClose.addEventListener('click', closeLightbox);
            lightboxPrev.addEventListener('click', (e) => { e.stopPropagation(); navigateLightbox(-1); });
            lightboxNext.addEventListener('click', (e) => { e.stopPropagation(); navigateLightbox(1); });
            lightbox.addEventListener('click', (e) => { if(e.target === lightbox) closeLightbox(); });

            document.addEventListener('keydown', (e) => {
                if (!lightbox.classList.contains('active')) return;
                if (e.key === 'Escape') closeLightbox();
                if (e.key === 'ArrowLeft') navigateLightbox(-1);
                if (e.key === 'ArrowRight') navigateLightbox(1);
            });

            // Section Visibility Observer
            const observer = new IntersectionObserver((entries) => {
                entries.forEach(entry => {
                    if (entry.isIntersecting) {
                        entry.target.classList.add('opacity-100', 'translate-y-0');
                        entry.target.classList.remove('opacity-0', 'translate-y-10');
                    }
                });
            }, { threshold: 0.1 });

            document.querySelectorAll('.david-gouett-gallery-glass-panel').forEach(el => {
                el.classList.add('transition-all', 'duration-1000', 'opacity-0', 'translate-y-10');
                observer.observe(el);
            });

        })();