<style>
        /* --- Styles de base --- */
        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            background-color: #f4f4f9;
            margin: 0;
            padding: 20px;
            display: flex;
            flex-direction: column;
            align-items: center;
        }

        h1 {
            color: #333;
            margin-bottom: 30px;
        }

        /* --- Grille de la galerie --- */
        .galerie-container {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
            gap: 20px;
            width: 100%;
            max-width: 1200px;
            padding: 10px;
        }

        .galerie-item {
            position: relative;
            overflow: hidden;
            border-radius: 8px;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
            background-color: #fff;
            cursor: pointer;
            transition: transform 0.3s ease, box-shadow 0.3s ease;
        }

        .galerie-item:hover {
            transform: translateY(-5px);
            box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
        }

        /* Ajustement des médias dans la grille */
        .galerie-item img, 
        .galerie-item video {
            width: 100%;
            height: 200px;
            object-fit: cover;
            display: block;
        }

        /* Indicateur visuel "Play" pour les vidéos dans la grille */
        .video-badge {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            background: rgba(0, 0, 0, 0.7);
            color: white;
            border-radius: 50%;
            width: 50px;
            height: 50px;
            display: flex;
            justify-content: center;
            align-items: center;
            font-size: 24px;
            pointer-events: none; /* Laisse passer le clic vers le conteneur */
        }

        .legende {
            padding: 15px;
            font-size: 14px;
            color: #555;
            text-align: center;
            font-weight: 500;
        }

        /* --- Fenêtre Pop-up (Lightbox) --- */
        .lightbox {
            display: none;
            position: fixed;
            z-index: 999;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.9);
            justify-content: center;
            align-items: center;
            user-select: none;
        }

        /* Conteneur du média affiché en grand */
        .lightbox-media {
            max-width: 85%;
            max-height: 80%;
            border-radius: 4px;
            box-shadow: 0 5px 25px rgba(0,0,0,0.5);
            animation: zoomEffect 0.3s ease;
            display: none; /* Géré dynamiquement par JS */
        }

        @keyframes zoomEffect {
            from { transform: scale(0.9); opacity: 0; }
            to { transform: scale(1); opacity: 1; }
        }

        /* Bouton Fermer (Croix) */
        .lightbox-close {
            position: absolute;
            top: 20px;
            right: 30px;
            color: #fff;
            font-size: 50px;
            font-weight: bold;
            cursor: pointer;
            z-index: 1000;
        }

        .lightbox-close:hover { color: #bbb; }

        /* Flèches de navigation */
        .lightbox-nav {
            position: absolute;
            top: 50%;
            transform: translateY(-50%);
            color: white;
            font-size: 60px;
            font-weight: bold;
            cursor: pointer;
            padding: 10px 20px;
            z-index: 1000;
            border-radius: 4px;
            transition: background-color 0.2s;
        }

        .lightbox-nav:hover { background-color: rgba(255, 255, 255, 0.1); }
        .prev { left: 20px; }
        .next { right: 20px; }
    </style>