/* Frontend Styles pour Image Gallery Labels */

/* Container de la galerie */
.igl-gallery-wrapper {
    margin: 30px 0;
    width: 100%;
}

.igl-gallery {
    display: grid;
    gap: 15px;
}

/* Colonnes responsive */
.igl-gallery[data-columns="1"] {
    grid-template-columns: 1fr;
}

.igl-gallery[data-columns="2"] {
    grid-template-columns: repeat(2, 1fr);
}

.igl-gallery[data-columns="3"] {
    grid-template-columns: repeat(3, 1fr);
}

.igl-gallery[data-columns="4"] {
    grid-template-columns: repeat(4, 1fr);
}

.igl-gallery[data-columns="5"] {
    grid-template-columns: repeat(5, 1fr);
}

/* Item de galerie */
.igl-gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

/* Lien image */
.igl-image-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

/* Container de l'image */
.igl-image-container {
    position: relative;
    width: 100%;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: #f0f0f0;
}

.igl-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.igl-gallery-item:hover .igl-image {
    transform: scale(1.1);
}

/* Titre de l'image (en haut, toujours visible) */
.igl-image-title {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    /*background: linear-gradient(to bottom, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.5) 70%, transparent 100%);*/
    padding: 15px 20px;
    z-index: 2;
}

.igl-title-text {
    color: #000;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.4;
    display: block;
    text-shadow: 0 2px 4px rgba(255, 255, 255, 0.5);
    letter-spacing: 0.3px;
}

/* Étiquette avec effet hover */
.igl-image-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(255, 255, 255, 0.85) 0%, rgba(255, 255, 255, 0.6) 70%, transparent 100%);
    padding: 40px 20px 20px;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2;
}

.igl-gallery-item:hover .igl-image-label {
    transform: translateY(0);
}

.igl-label-text {
    color: #000;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.4;
    display: block;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    animation: labelSlideUp 0.4s ease;
}

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

/* Effet alternatif: étiquette en haut */
.igl-gallery-wrapper.label-top .igl-image-label {
    top: 0;
    bottom: auto;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.85) 0%, rgba(255, 255, 255, 0.6) 70%, transparent 100%);
    padding: 20px 20px 40px;
    transform: translateY(-100%);
}

.igl-gallery-wrapper.label-top .igl-gallery-item:hover .igl-image-label {
    transform: translateY(0);
}

/* Responsive */
@media (max-width: 1024px) {
    .igl-gallery[data-columns="5"] {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .igl-gallery[data-columns="4"] {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .igl-gallery[data-columns="5"],
    .igl-gallery[data-columns="4"],
    .igl-gallery[data-columns="3"] {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .igl-label-text {
        font-size: 14px;
    }
    
    .igl-title-text {
        font-size: 15px;
    }
    
    .igl-image-label {
        padding: 30px 15px 15px;
    }
    
    .igl-image-title {
        padding: 12px 15px;
    }
}

@media (max-width: 480px) {
    .igl-gallery[data-columns="5"],
    .igl-gallery[data-columns="4"],
    .igl-gallery[data-columns="3"],
    .igl-gallery[data-columns="2"] {
        grid-template-columns: 1fr;
    }
    
    .igl-label-text {
        font-size: 14px;
    }
    
    .igl-title-text {
        font-size: 14px;
    }
}

/* Effet lightbox simple (optionnel) */
.igl-image-link {
    cursor: zoom-in;
}

/* Loading state */
.igl-image.loading {
    opacity: 0.5;
}

/* Animation d'entrée des items */
.igl-gallery-item {
    animation: fadeInUp 0.6s ease backwards;
}

.igl-gallery-item:nth-child(1) { animation-delay: 0.1s; }
.igl-gallery-item:nth-child(2) { animation-delay: 0.2s; }
.igl-gallery-item:nth-child(3) { animation-delay: 0.3s; }
.igl-gallery-item:nth-child(4) { animation-delay: 0.4s; }
.igl-gallery-item:nth-child(5) { animation-delay: 0.5s; }
.igl-gallery-item:nth-child(6) { animation-delay: 0.6s; }
.igl-gallery-item:nth-child(n+7) { animation-delay: 0.7s; }

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

/* Style pour message d'erreur */
/*
.igl-gallery-wrapper p {
    padding: 20px;
    background: #f9f9f9;
    border-left: 4px solid #0073aa;
    color: #666;
}
*/

/* Lightbox */
.igl-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.igl-lightbox.active {
    display: flex;
    opacity: 1;
}

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

.igl-lightbox-image {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    animation: zoomIn 0.3s ease;
}

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

.igl-lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    color: #fff;
    font-size: 30px;
    line-height: 46px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.igl-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: #fff;
    transform: rotate(90deg);
}

.igl-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    color: #fff;
    font-size: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    user-select: none;
}

.igl-lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: #fff;
    transform: translateY(-50%) scale(1.1);
}

.igl-lightbox-nav.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

.igl-lightbox-prev {
    left: 20px;
}

.igl-lightbox-next {
    right: 20px;
}

.igl-lightbox-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, transparent 100%);
    color: #fff;
    padding: 30px 20px 20px;
    text-align: center;
    font-size: 18px;
    font-weight: 600;
}

.igl-lightbox-counter {
    position: absolute;
    top: 20px;
    left: 20px;
    color: #fff;
    font-size: 16px;
    background: rgba(0, 0, 0, 0.5);
    padding: 8px 15px;
    border-radius: 20px;
}

/* Responsive lightbox */
@media (max-width: 768px) {
    .igl-lightbox-nav {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }
    
    .igl-lightbox-prev {
        left: 10px;
    }
    
    .igl-lightbox-next {
        right: 10px;
    }
    
    .igl-lightbox-close {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
        font-size: 24px;
        line-height: 36px;
    }
    
    .igl-lightbox-label {
        font-size: 16px;
        padding: 20px 15px 15px;
    }
    
    .igl-lightbox-counter {
        font-size: 14px;
        padding: 6px 12px;
    }
}
