:root {
    --timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    --animation-duration: 250ms;
}

.gallery {
    display: grid;
    max-width: 1128px;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 200px;
    gap: 24px;
    margin-left: auto;
    margin-right: auto;
    padding: 0;
    list-style: none;
}

.gallery-item {
    width: 100%;
    height: 100%;
}

.gallery-link {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
}

.gallery-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--animation-duration) var(--timing-function);
}

.gallery-image:hover {
    transform: scale(1.03);
    cursor: zoom-in;
}

.lightbox {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--animation-duration) var(--timing-function);
    z-index: 999;
}

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

.lightbox__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(46, 47, 66, 0.8);
}

.lightbox__content {
    position: relative;
    width: 1112px;
    height: 640px;
}

.lightbox__image {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.lightbox__button {
    position: absolute;
    top: 24px;
    right: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 50%;
    background-color: transparent;
    color: #fff;
    cursor: pointer;
    transition: background-color var(--animation-duration) var(--timing-function);
}

.lightbox__button:hover {
    background-color: rgba(255, 255, 255, 0.1);
}