/* ==================================================
   GALERIE
================================================== */

.gallery {
    width: 100%;
    box-sizing: border-box;

    margin: 120px auto 0;
    padding: 0 3vw 100px;
}


/* ==================================================
   EN-TÊTE
================================================== */

.gallery-header {
    max-width: 700px;

    margin-bottom: 70px;
}


.gallery-header h2 {
    margin-bottom: 20px;

    font-size: 35px;
    font-weight: 700;

    --entry-y: 200px;
}


.gallery-intro {
    max-width: 750px;

    font-size: 15px;
    line-height: 1.4;

    color: var(--color-secondary);

    --entry-y: 100px;
}


/* ==================================================
   GALERIE — EYEBROW
================================================== */

.gallery-eyebrow {
    margin: 0 0 16px 0;

    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;

    color: #666666;
}


/* ==================================================
   GRILLE
================================================== */

.gallery-grid {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 80px;

    width: 100%;
    min-width: 0;

    --entry-y: 80px;
}


/* ==================================================
   CARTE
================================================== */

.drawing-card {
    width: 100%;
    max-width: 100%;
    min-width: 0;

    margin: 0;

    color: #111;
    text-decoration: none;

    text-align: left;
}


/* ==================================================
   IMAGE
================================================== */

.drawing-card img {
    display: block;

    width: 100%;
    height: auto;

    max-width: none;

    cursor: pointer;

    transition:
        transform 0.5s ease;
}


/* ==================================================
   INFORMATIONS
================================================== */

.drawing-info {
    width: 100%;
    max-width: 100%;

    padding: 18px 0 0;

    overflow-wrap: break-word;

    text-align: left;
}


.drawing-info h2,
.drawing-info h3 {
    margin: 0 0 7px;

    font-size: 18px;
    font-weight: 700;

    line-height: 1.25;

    text-align: left;
}


.drawing-info p {
    margin: 0;

    font-size: 14px;

    color: var(--color-secondary);

    text-align: left;
}


/* ==================================================
   HOVER
================================================== */

.drawing-card:hover img {
    transform: scale(1.015);
}


/* ==================================================
   ANIMATION D'ENTRÉE
================================================== */

:root {
    --gallery-animation-duration: 1.2s;

    --gallery-animation-easing:
        cubic-bezier(0.55, 1, 0.55, 1);
}


.gallery-entry {
    opacity: 0;

    animation:
        gallery-entry-animation
        var(--gallery-animation-duration)
        var(--gallery-animation-easing)
        forwards;
}


@keyframes gallery-entry-animation {

    from {
        opacity: 0;

        transform:
            translateY(var(--entry-y));
    }

    to {
        opacity: 1;

        transform:
            translateY(0);
    }

}


/* ==================================================
   TABLETTE
================================================== */

@media (max-width: 900px) {

    .gallery {
        padding-top: 0;
    }


    .gallery-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        gap: 30px;
    }


    .gallery-header h2 {
        font-size: 50px;
    }


    /* ----------------------------------------------
       CARTES
    ---------------------------------------------- */

    .drawing-card {
        width: 100%;
        max-width: 100%;
        min-width: 0;

        justify-self: stretch;

        text-align: left;
    }


    /* ----------------------------------------------
       IMAGES
    ---------------------------------------------- */

    .drawing-card img {
        width: 100%;
        max-width: none;
        height: auto;
    }

}


/* ==================================================
   FILTRES GALERIE
================================================== */

.gallery-filters {
    display: flex;

    gap: 28px;

    margin-top: 50px;
    margin-bottom: -25px;
}


/* ==================================================
   BOUTONS FILTRES
================================================== */

.filter-button {
    padding: 0;

    border: none;

    background: none;

    color: var(--color-secondary);

    font-family: inherit;

    font-size: 13px;
    font-weight: 400;

    cursor: pointer;

    transition:
        color 0.25s ease;
}


.filter-button:hover {
    color: var(--color-primary);
}


/* ==================================================
   FILTRE ACTIF
================================================== */

.filter-button.active {
    color: var(--color-primary);

    font-weight: 700;
}


/* ==================================================
   LIGHTBOX
================================================== */

.lightbox {
    position: fixed;

    inset: 0;

    display: flex;

    align-items: center;
    justify-content: center;

    padding: 40px;

    background:
        rgba(0, 0, 0, 0.92);

    opacity: 0;
    visibility: hidden;

    z-index: 2000;

    touch-action: none;

    transition:
        opacity 0.3s ease,
        visibility 0.3s ease;
}


/* ==================================================
   OUVERTURE LIGHTBOX
================================================== */

.lightbox.active {
    opacity: 1;

    visibility: visible;
}


/* ==================================================
   IMAGE LIGHTBOX
================================================== */

.lightbox-image {
    display: block;

    width: auto;
    height: auto;

    max-width: 90vw;
    max-height: 90vh;

    object-fit: contain;

    transform: scale(0.96);

    transition:
        transform 0.35s
        cubic-bezier(0.16, 1, 0.3, 1);

    user-select: none;

    -webkit-user-drag: none;

    touch-action: none;

    cursor: default;
}


/* ==================================================
   IMAGE LIGHTBOX ACTIVE
================================================== */

.lightbox.active .lightbox-image {
    transform: scale(1);

    cursor: grab;
}


.lightbox.active .lightbox-image:active {
    cursor: grabbing;
}


/* ==================================================
   BOUTON FERMER
================================================== */

.lightbox-close {
    position: absolute;

    top: 25px;
    right: 30px;

    width: 40px;
    height: 40px;

    border: none;

    background: transparent;

    color: white;

    font-size: 36px;
    font-weight: 300;

    line-height: 1;

    cursor: pointer;

    opacity: 0.8;

    z-index: 2000;

    transition:
        opacity 0.2s ease;
}


.lightbox-close:hover {
    opacity: 1;
}


/* ==================================================
   MOBILE
================================================== */

@media (max-width: 700px) {

    .gallery {
        margin-top: 80px;

        padding:
            0
            3vw
            80px;
    }


    /* ----------------------------------------------
       EN-TÊTE
    ---------------------------------------------- */

    .gallery-header {
        margin-bottom: 50px;
    }


    .gallery-header h2 {
        font-size: 42px;
    }


    /* ----------------------------------------------
       GRILLE
    ---------------------------------------------- */

    .gallery-grid {
        grid-template-columns:
            minmax(0, 1fr);

        gap: 40px;
    }


    /* ----------------------------------------------
       CARTES
    ---------------------------------------------- */

    .drawing-card {
        width: 100%;
        max-width: 100%;
        min-width: 0;

        justify-self: stretch;

        text-align: left;
    }


    /* ----------------------------------------------
       IMAGES
    ---------------------------------------------- */

    .drawing-card img {
        display: block;

        width: 100%;
        max-width: none;

        height: auto;
        max-height: none;

        object-fit: fill;

        cursor: pointer;
    }


    /* ----------------------------------------------
       INFORMATIONS
    ---------------------------------------------- */

    .drawing-info {
        width: 100%;

        padding: 18px 0 0;

        text-align: left;
    }


    .drawing-info h2,
    .drawing-info h3,
    .drawing-info p {
        text-align: left;
    }


    /* ----------------------------------------------
       FILTRES
    ---------------------------------------------- */

    .gallery-filters {
        gap: 20px;

        margin-top: 40px;
        margin-bottom: 0;

        flex-wrap: wrap;
    }


    /* ----------------------------------------------
       ANIMATION
    ---------------------------------------------- */

    .gallery-entry {
        opacity: 1;

        transform: none;

        animation: none;
    }


    /* ----------------------------------------------
       LIGHTBOX
    ---------------------------------------------- */

    .lightbox {
        padding: 20px;
    }


    .lightbox-image {
        max-width: 94vw;
        max-height: 85vh;
    }


    .lightbox-close {
        top: 15px;
        right: 15px;

        font-size: 32px;
    }

}