:root {
    --layout-grid-gap: 60px;
    --project-detail-radius: 0;
    --project-detail-wide-height: 235px;
    --project-detail-tall-height: 540px;
    --project-detail-short-height: 215px;
}

.project-page {
    background: var(--color-background);
}

.project-hero {
    padding: calc(var(--layout-section-space) - 10px) var(--page-padding-x) 0;
    text-align: center;
}

.project-hero__title {
    font-weight: normal;
    margin: 0 0 var(--title-control-gap);
    color: var(--color-ink);
    font-size: var(--title-size);
    line-height: var(--title-line-height);
    letter-spacing: var(--title-letter-spacing);
}

.project-gallery__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--layout-grid-gap);
}

.project-gallery__grid.is-masonry {
    position: relative;
    display: block;
}

.project-gallery__item {
    display: block;
    width: 100%;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: var(--project-detail-radius);
    background: transparent;
    cursor: zoom-in;
    margin: 0;
}

.project-gallery__grid.is-masonry .project-gallery__item {
    position: absolute;
    left: 0;
    top: 0;
}

.project-gallery__item--wide {
    height: auto; /*var(--project-detail-wide-height);*/
}

.project-gallery__item--tall {
    height: auto; /*var(--project-detail-short-height);*/
}

.project-gallery__item--short {
    height: auto;
}

.project-gallery__item img {
    display: block;
    width: 100%;
    height: auto;
    transition: transform 450ms ease, filter 450ms ease;
}

.project-gallery__item:hover img,
.project-gallery__item:focus-visible img {
    filter: brightness(0.8);
    transform: scale(1.025);
}

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px;
    background: rgba(23, 34, 43, 0.88);
    opacity: 0;
    pointer-events: none;
    transition: opacity 220ms ease;
}

.lightbox.is-open {
    opacity: 1;
    pointer-events: auto;
}

.lightbox__stage {
    display: flex;
    align-items: center;
    justify-content: center;
    width: min(1100px, calc(100% - 140px));
    height: 100%;
    touch-action: pan-y;
}

.lightbox__image {
    max-width: min(1100px, 100%);
    max-height: 100%;
    border-radius: var(--project-detail-radius);
    object-fit: contain;
    transition: transform 450ms ease;
    user-select: none;
}

.lightbox__image.is-dragging {
    transition: none;
}

.lightbox__close {
    position: absolute;
    top: 32px;
    right: 32px;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.lightbox__close::before,
.lightbox__close::after {
    content: "";
    position: absolute;
    top: 15px;
    left: 7px;
    width: 18px;
    height: 1px;
    background: var(--color-white);
}

.lightbox__close::before {
    transform: rotate(45deg);
}

.lightbox__close::after {
    transform: rotate(-45deg);
}

.lightbox__nav {
    position: absolute;
    top: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    width: var(--project-nav-arrow-size);
    height: var(--project-nav-arrow-size);
    padding: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--color-white);
    font-size: var(--button-font-size);
    line-height: 1;
    cursor: pointer;
    transform: translateY(-50%);
    border: none;
/*    transition: background-color 220ms ease;*/
}

@media (max-width: 1100px) {
    :root {
        --layout-grid-gap: 30px;
    }
}

.lightbox__nav img.active {
    display: none;
}
.lightbox__nav:hover img.default {
    display: none;
}
.lightbox__nav:hover img.active {
    display: block;
}


@media (min-width: 768px) {
    .lightbox__nav {
        display: inline-flex;
    }
}

@media (hover: none) and (pointer: coarse) {
    .lightbox__nav {
        display: none;
    }
}

.lightbox__nav--prev {
    left: 32px;
}

.lightbox__nav--next {
    right: 32px;
}

.lightbox__counter {
    position: absolute;
    left: 50%;
    bottom: 28px;
    color: var(--color-white);
    font-size: var(--button-font-size);
    line-height: var(--button-line-height);
    letter-spacing: var(--button-letter-spacing);
    transform: translateX(-50%);
}

@media (max-width: 767px) {
    :root {
        --layout-grid-gap: 30px;
        --project-detail-radius: 0;
        --project-detail-wide-height: 156px;
        --project-detail-tall-height: 330px;
        --project-detail-short-height: 156px;
    }
    .project-gallery__item {
        cursor: default;
    }

    .project-gallery__grid {
        grid-template-columns: 1fr;
    }

    .project-gallery__item:nth-child(n+7) {
        display: none;
    }

    .lightbox {
        padding: 28px;
    }

    .lightbox__stage {
        width: 100%;
    }

    .lightbox__counter {
        bottom: 36px;
    }
}
