<!-- ================================================================= -->
            <!-- 4. GALLERY SLIDER (Moments Gallery Infinite Horizontal Marquee)   -->
            <!-- ================================================================= -->
            <?php if (isset($sectionMap['gallery'])): 
                $galleryConfig = $sectionMap['gallery'];
                $rawGalleryPaths = array_slice((array)($galleryConfig['images'] ?? []), 0, 10);
                $galleryUrls = array_filter(array_map(
                    fn($p) => $p ? url('/i/media/serve') . '?path=' . urlencode($p) : '',
                    $rawGalleryPaths
                ));
            ?>
                <?php if (!empty($galleryUrls)): ?>
                    <section class="py-10 md:py-12 text-center space-y-6 border-b <?= $style['borderColor'] ?> overflow-hidden">
                        <?php
    $headerClass = 'text-center space-y-2 px-8';
    $headerEmoji = '📸';
    $headerTitle = 'Moments Gallery';
    require __DIR__ . '/../partials/section_header.php';
    unset($headerClass, $headerEmoji, $headerEmojiClass, $headerTitle);
?>
                        
                        <!-- Infinite Seamless Marquee Slider -->
                        <div class="relative w-full group py-4 overflow-x-auto sm:overflow-hidden scrollbar-none">
                            <div class="animate-marquee gap-4">
                                <?php 
                                    // Duplicate array for seamless infinite marquee loop
                                    $marqueeList = array_merge($galleryUrls, $galleryUrls);
                                    foreach ($marqueeList as $gUrl): 
                                ?>
                                    <div class="flex-shrink-0 w-60 h-80 rounded-2xl overflow-hidden border border-slate-100 shadow-sm bg-slate-100">
                                        <img src="<?= escape_html($gUrl) ?>" alt="Gallery Image" class="w-full h-full object-cover hover:scale-105 transition duration-500">
                                    </div>
                                <?php endforeach; ?>
                            </div>
                        </div>
                    </section>
                <?php endif; ?>
            <?php endif; ?>
