.container {
    width: 100%;
    margin: 0 auto;
    padding: 0 20px;
}

.masonry-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    width: 100%;
}

.grid-item-link {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
    background: #f5f5f5;
}

.masonry-grid > .grid-item-link {
    height: 700px;
}

.grid-item {
    width: 100%;
    height: 100%;
    position: relative;
}

.grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.grid-item-link:hover img {
    transform: scale(1.01);
}

/* Nouveau système de positionnement du titre */
.title-container {
    display: flex;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 1rem;
    pointer-events: none;
    z-index: 2;
}

/* Conteneur pour le texte */
.text-content {
    transition: opacity 0.3s ease, transform 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
}

/* Affichage au survol */
.grid-item-link:hover .text-content {
    opacity: 1;
    transform: translateY(0);
}

/* Titre de galerie - Police plus grosse */
.gallery-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: black;
    margin: 0 0 0.5rem 0;
    padding: 0;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Sous-titre de galerie - Police plus grosse */
.gallery-subtitle {
    font-size: 1.8rem;
    font-weight: 600;
    color: black;
    margin: 0;
    padding: 0;
    line-height: 1.3;
    letter-spacing: 0.5px;
}

/* Alignements horizontaux */
.justify-content-start {
    justify-content: flex-start;
}

.justify-content-center {
    justify-content: center;
    text-align: center;
}

.justify-content-end {
    justify-content: flex-end;
    text-align: right;
}

/* Alignements verticaux */
.align-items-start {
    align-items: flex-start;
}

.align-items-center {
    align-items: center;
}

.align-items-end {
    align-items: flex-end;
}

/* Description au survol */
.caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.7);
    color: black;
    padding: 12px 16px;
    font-size: 11px;
    font-weight: 300;
    letter-spacing: 0.5px;
    z-index: 1;
    transition: transform 0.3s ease, opacity 0.3s ease;
    transform: translateY(100%);
    opacity: 0;
}

.description {
    margin-top: 5px;
    font-size: 10px;
    line-height: 1.4;
}

/* Voile blanc léger au survol */
.grid-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.3);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.grid-item-link:hover .grid-item::after {
    opacity: 1;
}

/* Gestion du tactile pour les smartphones */
@media (hover: none) and (pointer: coarse) {
    .text-content {
        opacity: 1;
        transform: translateY(0);
    }

    .grid-item-link:active .text-content {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 992px) {
    .masonry-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .gallery-title {
        font-size: 2.2rem;
    }

    .gallery-subtitle {
        font-size: 1.6rem;
    }
}

@media (max-width: 768px) {
    .masonry-grid {
        grid-template-columns: 1fr;
    }

    .grid-item-link,
    .masonry-grid > .grid-item-link:nth-child(n) {
        grid-column: 1;
        height: 350px !important;
    }

    .container {
        width: 100%;
        margin: 0 auto;
        padding: 0 0;
    }

    .gallery-title {
        font-size: 1.8rem;
    }

    .gallery-subtitle {
        font-size: 1.4rem;
    }

    .title-container {
        padding: 1.5rem;
    }

    /* Affichage permanent sur mobile */
    .text-content {
        opacity: 1;
        transform: translateY(0);
    }
}