  .image-container {
    width: 100%;  /* largeur du cadre visible */
    height: 54vh; /* hauteur du cadre visible */
    overflow: hidden; /* cache le reste de l'image */
  }
  



/* Structure principale */
.gallery-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    padding: 25px;
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Items de galerie */
.gallery-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    background: #f8f9fa;
    cursor: pointer;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 20px rgba(0,0,0,0.15);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90vh;
    width: auto;
    height: auto;
    text-align: center;
}

.lightbox-img {
    max-height: 80vh;
    max-width: 90vw;
    border-radius: 8px;
    transition: opacity 0.3s ease;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
}

.lightbox-caption {
    display: none !important;
}

.lightbox-caption {
    color: white;
    margin-top: 15px;
    font-size: 1.2rem;
    text-align: center;
    padding: 0 20px;
}

.close-btn {
    position: absolute;
    top: -50px;
    right: 0;
    color: white;
    font-size: 35px;
    cursor: pointer;
    transition: transform 0.3s;
    background: none;
    border: none;
    padding: 5px;
}

.close-btn:hover {
    transform: scale(1.2);
}

.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    font-size: 2rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-btn:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: translateY(-50%) scale(1.1);
}

.prev-btn {
    left: 20px;
}

.next-btn {
    right: 20px;
}

/* États particuliers */
.gallery-item.broken {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 2px dashed #ff6b6b;
    background: #fff9f9;
}

.broken-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
    opacity: 0.7;
}

.filename {
    color: #495057;
    font-size: 0.9rem;
    word-break: break-all;
    text-align: center;
    padding: 0 10px;
}

/* Loader */
.loader {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
}

.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top: 4px solid #3498db;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Erreur */
.error {
    grid-column: 1 / -1;
    background: #fff0f0;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.tech-info {
    background: white;
    border-radius: 8px;
    padding: 15px;
    margin: 20px 0;
    text-align: left;
    font-family: monospace;
    font-size: 0.9rem;
}

.retry-btn {
    background: #4e73df;
    color: white;
    border: none;
    padding: 10px 25px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s;
    margin-top: 15px;
}

.retry-btn:hover {
    background: #2e59d9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(78, 115, 223, 0.3);
}

/* Responsive */
@media (max-width: 768px) {
    .gallery-container {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 15px;
        padding: 15px;
    }
    
    .lightbox-content {
        max-width: 95%;
    }
    
    .nav-btn {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }
    
    .close-btn {
        top: -40px;
        font-size: 30px;
    }
}

@media (max-width: 480px) {
    .gallery-container {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .lightbox-img {
        max-height: 60vh;
    }
}