/*
    Design épuré et sobre pour la galerie WP.
*/

.cwg-gallery-wrapper {
    margin: 3rem auto;
    max-width: 1200px;
    width: 100%;
    background: #ffffff; /* S'assure que le wrapper soit blanc si besoin */
}

.cwg-gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    align-items: stretch; /* Permet aux colonnes d'avoir la même hauteur si souhaité, mais l'image dicte la hauteur interne */
}

.cwg-gallery-item {
    margin: 0;
    position: relative;
    border-radius: 0; /* Pas de bords arrondis */
    overflow: hidden;
    background: #ffffff; /* Fond entièrement blanc pour chaque carte */
    display: flex;
    flex-direction: column;
}

.cwg-img-link {
    display: block;
    text-decoration: none;
    overflow: hidden;
}

.cwg-img {
    display: block;
    max-width: 100%;
    width: 100%;
    height: auto;
    /* On laisse la dimension naturelle de l'image (selon le choix medium/large) dicter le rendu */
}

/* Zone Caption sous l'image */
.cwg-gallery-item figcaption {
    padding: 15px 0; /* Espacement simple sans bordures */
    background: #ffffff;
    text-align: center;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cwg-caption {
    margin: 0 !important;
    font-size: 1rem !important;
    font-weight: normal !important; /* Corps normal, pas de gras */
    font-style: normal !important;  /* Pas d'italique */
    line-height: 1.4 !important;
    color: #000000; /* Texte classique */
}

/* Animations d'entrée douces (optionnel mais propre) */
@keyframes cwgFadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cwg-gallery-item {
    animation: cwgFadeInUp 0.6s ease-out forwards;
}

.cwg-gallery-item:nth-child(1) { animation-delay: 0s; }
.cwg-gallery-item:nth-child(2) { animation-delay: 0.1s; }
.cwg-gallery-item:nth-child(3) { animation-delay: 0.2s; }
.cwg-gallery-item:nth-child(n+4) { animation-delay: 0.3s; }


/* Responsivité (La grille s'adapte en colonnes, l'image devient fluide mais sans casser ses proportions naturelles) */
@media screen and (max-width: 990px) {
    .cwg-gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }
}

@media screen and (max-width: 650px) {
    .cwg-gallery-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}
