        /* --- Galerie d'images JPG --- */

        .gallery-proto {
            margin-top: 2.5em;
            margin-left: auto;
            /* Centre le conteneur horizontalement */
            margin-right: auto;
            /* Centre le conteneur horizontalement */

            width: 95%;
            /* Sur mobile/petit écran : prend 95% de la largeur disponible */
            max-width: 640px;
            /* max-width : largeur max sur grand ecran (PC) */

            display: flex;
            flex-wrap: wrap;
            justify-content: center;
            gap: 20px;
        }

        /* --- Conteneur individuel d'une image et de son titre (c'est un <label>) --- */
        .gallery-proto .img-card {
            display: inline-flex;
            flex-direction: column;
            align-items: center;
            cursor: pointer;
            user-select: none;
            -webkit-tap-highlight-color: transparent;
        }

        .gallery-proto .img-card img {
            width: auto;
            height: auto;
            max-width: 100%;
            max-height: 100%;
            margin: 10px;
            display: inline-block;
            border-radius: 0px;
            border: 1px solid #bbb;
            box-shadow: 0 4px 8px rgba(0, 0, 0, .1);
            transition: transform 0.2s ease, box-shadow 0.1s ease;
        }

        /* Effet au survol */
        .gallery-proto .img-card:hover img {
            transform: scale(1.02);
            box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
            /* ombre portée */
        }

        /* --- Légende sous chaque image de la galerie (<span> => display:block) --- */
        .gallery-proto .img-label {
            display: block;
            margin-top: 0px;
            font-size: 12px;
            font-weight: 500;
            letter-spacing: 0px;
            color: #333333;
            text-align: center;
            overflow-wrap: anywhere;
        }

        /* --- RADIOS CACHÉS (pilotent l'ouverture des popups) ---
           Pas de display:none : ils restent focusables au clavier.
           position:fixed évite que la page saute en haut quand le radio prend le focus. */
        .proto-radio {
            position: fixed;
            top: 0;
            left: 0;
            width: 1px;
            height: 1px;
            opacity: 0;
            pointer-events: none;
        }

        /* Popup visible quand le radio qui la précède est coché */
        .proto-radio:checked+.modal {
            display: flex;
        }

        /* Pas de défilement de la page derrière une popup ouverte */
        body:has(.proto-radio:not(#proto-none):checked) {
            overflow: hidden;
        }

        /* --- POPUP (Couvre toute la page) --- */
        .modal {
            display: none;
            position: fixed;
            inset: 0;
            min-height: 100dvh;
            background-color: rgba(0, 0, 0, 0.85);
            z-index: 999999 !important;

            justify-content: center;
            align-items: center;
        }

        /* Label transparent qui recouvre toute la popup (boîte comprise) :
           un clic n'importe où coche le radio "aucun" et ferme la popup */
        .modal-close-all {
            position: absolute;
            inset: 0;
            z-index: 2;
            cursor: pointer;
        }

        /* --- CONTENEUR DU GIF (Taille fixe et centrée) --- */
        .modal-box {
            position: relative;
            background-color: #000000;
            width: 300px;
            height: 400px;
            max-width: 90vw;
            max-height: 90vh;

            /* Image et titre sont centrés ensemble : Haut Droit Bas Gauche */
            /* padding: 50px 20px 100px 20px; */
            padding: 65px 20px 85px 20px;
            /* padding: 20px; */

            border-radius: 12px;
            box-shadow: 0 8px 30px rgba(0, 0, 0, 0.8);
            box-sizing: border-box;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
        }

        /* Image GIF */
        .modal-content {
            max-width: 100%;
            max-height: calc(100% - 40px);
            width: auto;
            height: auto;
            object-fit: contain;
            border-radius: 0px;
        }

        /* Titre sous le GIF dans la popup */
        .modal-title {
            color: #ffffff;
            margin-top: 10px;
            font-size: 13px;
            font-weight: 100;
            opacity: 0.8;
            text-align: center;
            overflow-wrap: anywhere;
        }

        /* Croix de fermeture (décorative : le clic est capté par .modal-close-all) */
        .modal-close {
            position: absolute;
            top: 10px;
            right: 15px;
            color: #ffffff;
            font-size: 30px;
            font-weight: bold;
            user-select: none;
            transition: color 0.2s ease;
            /* Pas de z-index élevé : la croix doit rester SOUS .modal-close-all (z-index: 2)
               pour que le clic soit capté par le label de fermeture */
            pointer-events: none;
        }

        .modal:hover .modal-close {
            color: #cccccc;
        }

        /* Placer le sous-titre tout en bas de la boîte sans pousser l'image */
        .modal-subtitle {
            position: absolute;
            bottom: 30px;
            /* Distance par rapport au bas de la boîte noire */
            left: 0;
            width: 100%;
            /* Pour que le texte reste bien centré */
            color: #ffffff;
            font-size: 13px;
            font-weight: 300;
            opacity: 0.3;
            text-align: center;
            text-transform: uppercase;
            letter-spacing: 1.5px;
        }

        /* Catégorie affichée en haut de la boîte, au-dessus du GIF (sans pousser l'image) */
        .modal-categorie {
            position: absolute;
            top: 70px;
            left: 0;
            width: 100%;
            color: #ffffff;
            font-size: 16px;
            font-weight: 300;
            opacity: .4;
            text-align: center;
            text-transform: uppercase;
            letter-spacing: 1.1px;
        }

        /* Si une page n'a pas de catégorie, la div ne prend aucune place */
        .modal-categorie:empty {
            display: none;
        }