:root {
    --lightbox-bg-color: #292929;
    --lightbox-caption-text-color: #fff;
    --lightbox-controls-color: #fff;
    --lightbox-controls-hover-color: #e95301
}

#lightbox {
    display: none;
    justify-content: center;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1001;
    width: 100%;
    height: 100%;
    background: var(--lightbox-bg-color);
    opacity: 0;
    transition: opacity .5s
}

#lightbox figure {
    max-width: calc(90vw - 100px);
    max-height: calc(90vh - 100px);
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center
}

.lightbox-image {
    width: 60vw;
    height: 100%;
    max-height: calc(100vh - 100px);
    display: block;
    margin: 0;
    opacity: 0;
    transition: opacity .5s;
    object-fit: contain;
    aspect-ratio: 4/3
}

#lightbox-caption {
    color: var(--lightbox-caption-text-color);
    text-align: center;
    width: 100%;
    height: 80px;
    background: rgba(0, 0, 0, 0);
    padding: 10px;
    box-sizing: border-box;
    padding-top: 15px
}

#lightbox-caption h2 {
    font-size: 1.2em;
    margin: 0
}

#lightbox-caption p {
    font-size: .9em;
    margin: 0
}

#close,
#prev,
#next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.5);
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    color: var(--lightbox-controls-color)
}

#prev,
#next {
    font-size: 3rem;
}

#lightbox #close {
    top: 35px;
    right: 20px;
    width: 35px;
    height: 35px
}

#lightbox #close:hover {
    background: rgba(178, 34, 52, 0.95)
}

#lightbox #close {
    text-indent: -9999px;
    cursor: pointer
}

#lightbox #close:after,
.close-button:before {
    content: ""'';
    width: 55%;
    height: 2px;
    background: #fafafa;
    position: absolute;
    top: 48%;
    left: 22%;
    transform: rotate(-45deg);
    transition: .3s ease-out
}

#lightbox #close:after {
    transform: rotate(45deg);
    transition: .3s ease-out
}

#lightbox #close:hover:after,
.close-button:hover:before {
    transform: rotate(180deg)
}

#lightbox #prev {
    left: 20px
}

#lightbox #next {
    right: 20px
}

#close:hover,
#prev:hover,
#next:hover {
    color: var(--lightbox-controls-hover-color);
    transition: all .5s ease-in-out
}

#prev:hover,
#next:hover {
    background: #fff;
}

.top-title {
    width: 90vw;
    max-width: 120rem;
    margin: 0 auto;
    padding-bottom: 5rem
}

.gallery {
    width: 90vw;
    max-width: 120rem;
    margin: 0 auto 3rem;
}

.gallery img {
    cursor: pointer;
    transition: transform .5s ease, box-shadow .5s ease;
}

.gallery img:hover {
    transform: scale(1.05) translateY(-5px)
}

@media (max-width: 980px) {
    gallery img:hover {
        transform: none
    }
}