/* =========================================
   SPACE1993
   BARDON MILL
   ========================================= */


.bardonmill-gallery {
    position: absolute;
    top: 105px;
    left: 50%;
    transform: translateX(-50%);

    width: 90%;
    max-width: 1100px;

    height: calc(100% - 125px);

    padding: 10px;

    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 180px;
    gap: 10px;

    overflow-y: auto;
    overflow-x: hidden;

    scrollbar-width: thin;
    scrollbar-color: #080908 transparent;

    z-index: 5;
}


.bardonmill-piece {
    position: relative;

    display: block;

    width: 100%;
    height: 100%;

    padding: 0;
    margin: 0;

    border: none;
    background: transparent;

    overflow: hidden;

    cursor: pointer;

    z-index: 6;

    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}


.bardonmill-piece img {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;

    opacity: 1;
    filter: none;

    pointer-events: none;

    transition: transform .2s ease;
}


.bardonmill-piece:hover img {
    transform: scale(1.025);
}


.bardonmill-lightbox {
    position: fixed;
    inset: 0;

    z-index: 1000;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 50px;

    background: rgba(8, 9, 8, .96);

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transition:
        opacity .2s ease,
        visibility .2s ease;
}


.bardonmill-lightbox.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}


.bardonmill-lightbox-image-container {
    position: relative;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 90vw;
    height: 90vh;

    overflow: hidden;

    touch-action: none;

    cursor: zoom-in;
}


.bardonmill-lightbox-image {
    display: block;

    max-width: 90vw;
    max-height: 90vh;

    width: auto;
    height: auto;

    object-fit: contain;

    transform:
        translate3d(0, 0, 0)
        scale(1);

    transform-origin: center center;

    transition: none;

    user-select: none;
    -webkit-user-drag: none;

    pointer-events: none;

    will-change: transform;
    backface-visibility: hidden;
}


.bardonmill-lightbox button {
    position: absolute;

    border: none;
    background: none;

    color: #d0d0cc;

    font-family:
        "Courier New",
        Courier,
        monospace;

    font-size: 28px;

    line-height: 1;

    cursor: pointer;

    z-index: 2;

    -webkit-tap-highlight-color: transparent;
}


.bardonmill-lightbox button:hover {
    color: white;
}


.bardonmill-lightbox-close {
    top: 25px;
    right: 30px;

    font-size: 34px !important;
}


.bardonmill-lightbox-previous {
    left: 25px;
    top: 50%;

    transform: translateY(-50%);
}


.bardonmill-lightbox-next {
    right: 25px;
    top: 50%;

    transform: translateY(-50%);
}


@media screen and (max-width:600px) {

    .bardonmill-gallery {
        top: 105px;

        width: 94%;

        height: calc(100% - 123px);

        padding: 5px;

        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-auto-rows: max-content;

        gap: 7px;

        align-content: start;
    }


    .bardonmill-piece {
        position: relative;

        display: block;

        width: 100%;
        height: 0 !important;

        padding: 0 0 100% 0 !important;

        margin: 0;

        overflow: hidden;
    }


    .bardonmill-piece img {
        position: absolute;

        top: 0;
        left: 0;

        display: block;

        width: 100%;
        height: 100%;

        object-fit: cover;
    }


    .bardonmill-lightbox {
        padding: 25px;
    }


    .bardonmill-lightbox-image-container {
        width: 94vw;
        height: 84vh;
    }


    .bardonmill-lightbox-image {
        max-width: 94vw;
        max-height: 82vh;
    }


    .bardonmill-lightbox-close {
        top: 18px;
        right: 20px;
    }


    .bardonmill-lightbox-previous {
        left: 12px;
    }


    .bardonmill-lightbox-next {
        right: 12px;
    }

}


@media screen and (max-width:380px) {

    .bardonmill-gallery {
        top: 100px;

        height: calc(100% - 118px);

        width: 96%;

        padding: 4px;

        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-auto-rows: max-content;

        gap: 6px;

        align-content: start;
    }


    .bardonmill-piece {
        width: 100%;

        height: 0 !important;

        padding: 0 0 100% 0 !important;
    }


    .bardonmill-piece img {
        position: absolute;

        top: 0;
        left: 0;

        width: 100%;
        height: 100%;

        object-fit: cover;
    }


    .bardonmill-lightbox button {
        font-size: 22px;
    }


    .bardonmill-lightbox-close {
        font-size: 30px !important;
    }

}