/* works */

.works {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transition: filter 1000ms, opacity 300ms;
    filter: blur(2vw);
    pointer-events: none;
    overflow: scroll;
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
}

.works.auto-scroll {
    scroll-snap-type: none;
}

.year.hide-year {
    display: none;
}

.thumbnail-view .year.hide-year {
    min-height: 0;
    padding: 0;
}

.thumbnail-view .year {
    scroll-snap-align: start;
    display: flex;
    flex-wrap: wrap;
    grid-gap: 4vw;
    align-items: center;
    align-content: flex-start;
    min-height: 100%;
    padding: 4vw;
}

.work {
    position: relative;
    scroll-snap-align: start;
    width: 70vw;
    height: 100vh;
    margin-left: 15vw;
    display: block;
}

.thumbnail-view .work {
    scroll-snap-align: none;
    margin-left: unset;
    width: calc((100vw - (4vw * 8)) / 7);
    height: auto;
} 

picture.single-image {
    display: block;
}

picture.thumbnail {
    cursor: pointer;
    display: none;
}

.thumbnail-view picture.single-image {
    display: none;
}

.thumbnail-view picture.thumbnail {
    display: block;
}

.thumbnail-view .work figure {
    position: relative;
    top: 0;
    left: 0;
    transform: translateY(0) translateX(0);
}

.thumbnail-view .work a {
    /*display: inline-block;*/
}

.thumbnail-view .work figure img {
    max-width: 100%;
    max-height: 100%;
}

.thumbnail-view .work figcaption {
    display: none;
}

.work.hide {
    display: none;
}

.work a {
    display: block;
    cursor: default;
    text-decoration: none;
}

.works.hide {
    opacity: 0;
}

.works.show {
    filter: blur(0);
    pointer-events: all;
}

.work figure {
    position: absolute;
    display: inline-block;
    margin: 0 auto;
    top: 50%;
    width: 100%;
    transform: translateY(-50%);
}

.work figure img {
    display: block;
    margin: 0 auto;
    width: auto;
    height: auto;
    max-width: calc(70vw - 2vw);
    max-height: calc(100vh - 10vw);
}

.work .zoom img {
    cursor: zoom-in;
}

.work figcaption {
    color: var(--font-color);
    position: absolute;
    bottom: 0;
    right: -12vw;
    width: 10vw;
    display: inline-block;
    font-size: 0.5em;
    line-height: 1.1em;
    display: flex;
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: flex-start;
    grid-gap: 2vw;
}

.work figcaption .magnifier {
    display: none;
}

figure.detail-image {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    width: 100%;
    height: 100%;
    padding: 0;
    margin: 0;
}

figure.detail-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

html.l-open, html.l-open body {
    overscroll-behavior: none;
}

.lightbox {
    background-color: white;
    position: fixed;
    width: 100%;
    height: 100%;
    z-index: 1000;
    transition: opacity 300ms;
    opacity: 0;
    pointer-events: none;
    top: 0;
    left: 0;
    cursor: move; /* fallback if grab cursor is unsupported */
    cursor: grab;
    cursor: -moz-grab;
    cursor: -webkit-grab;
}

.lightbox:active {
    cursor: grabbing;
    cursor: -moz-grabbing;
    cursor: -webkit-grabbing;
}

.close {
    opacity: 0;
    position: fixed;
    top: 2vw;
    right: 2vw;
    max-width: 3vw;
    z-index: 2000;
    transition: opacity 300ms;
    pointer-events: none;
    cursor: pointer;
}

.close img {
    width: 100%;
}

.lightbox img {
    position: absolute;
    width: auto;
    height: auto;
    min-width: 200%;
    min-height: 150%;
}

.lightbox.show,
.close.show {
    opacity: 1;
    pointer-events: all;
}

.lightbox figure.detail-image {
    display: block;
}

/* tablet landscape */
@media (max-width: 1400px) and (pointer: coarse) {
    .works {
        scroll-snap-type: y mandatory;
        padding-top: 25vh;
        transition: filter 300ms, opacity 300ms;
    }
    .work figure:not(.detail-image) img {
        max-width: calc(60vw - 2vw);
        max-height: calc(100vh - 10vw);
    }
    .work figcaption {
        right: -14vw;
        width: 18vw;
        flex-direction: column-reverse;
        grid-gap: 0.4vw;

    }
    .work figcaption .magnifier {
        display: block;
        width: 1.5vw;
        height: 1.5vw;
    }
    .close {
        top: 6vw;
        right: 4vw;
        font-size: 7vw;
    }
    .thumbnail-view .work {
        scroll-snap-align: none;
        margin-left: unset;
        width: calc((100vw - (4vw * 5)) / 4);
        height: auto;
    } 
    .thumbnail-view .work figure:not(.detail-image) {
        width: 100%;
        padding: 2vw;
    }
    .thumbnail-view .work figure:not(.detail-image) img {
        max-width: 100%;
        max-height: auto;
    }

    .thumbnail-view .year {
        padding: 20vw 4vw 50vh 4vw;
    }
}

/* tablet portrait */
@media (max-width: 1024px) and (pointer: coarse) {
    .work figure:not(.detail-image) {
        width: unset;
        top: 50%;
        left: 50%;
        transform: translateX(-50%) translateY(-50%);
    }
    .thumbnail-view .work figure:not(.detail-image) {
        width: unset;
        top: 0;
        left: 0;
        transform: translateX(0) translateY(0);
    }
    .work figure:not(.detail-image) img {
        max-width: calc(70vw - 2vw);
        max-height: calc(80vh - 10vw);
    }
    .work figcaption {
        left: 0;
        width: 100%;
        transform: translateY(calc(100% + 1vw));
        font-size: unset;
    }
    .work figcaption {
        flex-direction: row;
        grid-gap: 0.4vw;
    }
    .work figcaption .magnifier {
        display: block;
        width: 2vw;
        height: 2vw;
    }
    .thumbnail-view .work {
        scroll-snap-align: none;
        margin-left: unset;
        width: calc((100vw - (4vw * 4)) / 3);
        height: auto;
    } 
    .thumbnail-view .work figure:not(.detail-image) {
        width: 100%;
        padding: 2vw;
    }
    .thumbnail-view .work figure:not(.detail-image) img {
        max-width: 100%;
        max-height: auto;
    }

    .thumbnail-view .year {
        padding: 20vw 4vw 50vh 4vw;
    }
}

@media (max-width: 800px) {
    .works {
        scroll-snap-type: y-mandatory;
        padding-top: 25vh;
        transition: filter 300ms, opacity 300ms;
    }
    .work {
        width: unset;
        margin-left: 0;
        margin-top: 8vw;
        scroll-snap-align: center;
    }
    .work figure:not(.detail-image) {
        display: block;
        padding: 4vw;
        position: relative;
        width: unset;
    }
    .work figure:not(.detail-image) img {
        max-width: calc(100vw - 8vw);
        max-height: calc(80vh - 10vw);
    }
    .work figcaption {
        position: relative;
        width: 100%;
        margin-top: 2vw;
        transform: unset;
        font-size: unset;
        right: unset;
        left: 0;
    }
    .work figcaption {
        flex-direction: row;
        grid-gap: 2vw;
    }
    .work figcaption .magnifier {
        display: block;
        width: 4vw;
        height: 4vw;
    }
    .thumbnail-view .work {
        scroll-snap-align: none;
        margin-left: unset;
        width: calc((100vw - (4vw * 4)) / 3);
        height: auto;
    } 
    .thumbnail-view .work figure:not(.detail-image) {
        width: 100%;
        padding: 2vw;
    }
    .thumbnail-view .work figure:not(.detail-image) img {
        max-width: 100%;
        max-height: auto;
    }

    .thumbnail-view .year {
        padding: 16vw 4vw 50vh 4vw;
    }
    .close {
        top: 4vw;
        right: 4vw;
    }

}

