 
:root {

    --site-width: 1200px;
    --bg-rbg: 160 150 133;
    --bg-dark-rbg: 33 30 25;

    --color: #2b3e3a;

    --bg: rgb(var(--bg-rbg));
    --bg-dark: rgb(var(--bg-dark-rbg));;
    --light: color-mix(in srgb, var(--bg) 40%, white);
    --dark: color-mix(in srgb, var(--bg-dark) 50%, var(--bg));

}


@font-face{font-family: "Bitter";src: url("fonts/Bitter-VariableFont_wght.ttf");}


 * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            background:  var(--bg-dark);
            color: var(--light);
            font-family: sans-serif;
            font-size: 18px;
            line-height: 1.6;
        }

        .container {
            max-width: var(--site-width);
            min-height: 110vh;
            margin: 0 auto;
            padding: 60px 20px;

        }

        header {
            text-align: center;
            margin-bottom: 60px;
        }

        h1 {
            font-size: 2.7rem;
            font-weight: 300;
            color: var(--light);
            margin-bottom: 10px;
            font-family: 'Bitter', serif;
        }

        .subtitle {
            color: var(--dark);

        }
        
         .contact {
           color: var(--dark);
            text-align: center;
            margin-bottom: 10px;
        }

        .profil {
            width: 120px;
            height: 120px;
            border-radius: 50%;
            overflow: hidden;
            margin: auto;
            margin-bottom: 20px;
        }

        .profil img {
            width: 100%;
        }
        

        .gallery {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
            gap: 40px;
            margin-bottom: 60px;
        }

        .gallery-item {
            position: relative;
            overflow: hidden;
            aspect-ratio: 1;
            background-color: var(--bg-dark);
            color: var(--bg-dark);
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .gallery-item.loaded {

        }

        .gallery-item:hover {
            border-color: #444;
            transform: scale(1.02);
        }

        .gallery-item img {
            width: 100%;
            height: 100%;
            object-fit: cover;
             opacity: 0;
            transition: all 0.4s ease;
        }




        .gallery-item.loaded img { opacity: 1;}


        .gallery-item.loading::before {    
            content: "";    
            position: absolute;    
            top: 50%;    
            left: 50%;    
            width: 32px;    
            height: 32px;    
            border: 3px solid rgba(0, 0, 0, 0.15);    
            border-top-color: var(--light);    
            border-radius: 50%;    
            transform: translate(-50%, -50%);    
            animation: spin 0.8s linear infinite;    
            z-index: 2;
        }


        .gallery-item.loading:nth-child(2n)::before {      
            animation-delay: -.1s ;    
        }
        .gallery-item.loading:nth-child(3n)::before {      
            animation-delay: -.2s ;    
        }
        .gallery-item.loading:nth-child(4n)::before {      
            animation-delay: -.15s ;    
        }
        .gallery-item.loading:nth-child(5n)::before {      
            animation-delay: -.25s ;    
        }

        .gallery-item.error::after {    
            content: "Image indisponible";    
            position: absolute;    
            top: 50%;    
            left: 50%;    
            transform: translate(-50%, -50%);    
            color: var(--light);    
            font-size: 14px;

        }
        @keyframes spin {    to {        transform: translate(-50%, -50%) rotate(360deg);    }}


        .gallery-item:hover img {
            transform: scale(1.08);
        }

        .gallery-overlay {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(var(--bg-dark-rbg) / .8);
             color: var(--light);
            display: flex;
            align-items: center;
            justify-content: center;
            opacity: 0;
            transition: opacity 0.3s ease;
        }

        .gallery-item:hover .gallery-overlay {
            opacity: 1;
        }

        .gallery-icon {
            width: 50px;
            height: 50px;
            border: 2px solid #e0e0e0;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 24px;
            font-weight: bold;
        }

        #lightbox {
    overscroll-behavior-x: none;
    touch-action: pan-y; /* Permet le défilement vertical s'il y a du texte, mais bloque le horizontal */
}


        /* Lightbox */
        .lightbox {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(var(--bg-dark-rbg) / .9);
            z-index: 1000;
            align-items: center;
            justify-content: center;
            animation: fadeIn 0.3s ease;
        }

        .lightbox.active {
            display: flex;
        }

        @keyframes fadeIn {
            from { opacity: 0; }
            to { opacity: 1; }
        }

        .lightbox-content {
            position: relative;
            max-width: 90vw;
            max-height: 90vh;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .lightbox img {
            max-width: 95vw;
            max-height: 95vh;
            width: auto;
            height: auto;
            object-fit: contain;
            animation: zoomIn 0.3s ease;
        }



        @keyframes zoomIn {
            from {
                transform: scale(0.9);
                opacity: 0;
            }
            to {
                transform: scale(1);
                opacity: 1;
            }
        }

        .lightbox-close {
            position: absolute;
            top: 30px;
            right: 30px;
            width: 50px;
            height: 50px;
            background: none;
            border: none;
            color: #e0e0e0;
            font-size: 36px;
            cursor: pointer;
            transition: transform 0.2s ease;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .lightbox-close:hover {
            transform: rotate(90deg);
        }

        .lightbox-nav {
            position: absolute;
            top: 50%;
            transform: translateY(-50%);
            background: none;
            border: none;
            color: #e0e0e0;
            font-size: 40px;
            line-height: 1;
            cursor: pointer;
            transition: color 0.2s ease;
            z-index: 1001;
        }

        .lightbox-nav:hover {
            color: #fff;
        }

        .lightbox-prev {
            left: 20px;
        }

        .lightbox-next {
            right: 20px;
        }

        #lightboxCounter {
            position: absolute;
            text-align: center;
            bottom: 30px;
            left: 50%;
            transform: translateX(-50%);
            color: #ccc;
            background: rgba(var(--bg-dark-rbg) / .7);
            padding: 5px 25px ;
        }



        /* Responsive */
        @media (max-width: 768px) {
            .gallery {
                grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
                gap: 15px;
            }

            h1 {
                font-size: 1.8rem;
                letter-spacing: 5px;
            }

            .lightbox-close {
                top: 15px;
                right: 15px;
                width: 40px;
                height: 40px;
                font-size: 28px;
            }

            .lightbox-nav {
                font-size: 28px;
                padding: 15px;
            }
        }