#image-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: auto;
    height: auto;
    max-width: calc(100vw - 10vmin);
    max-height: calc(100vh - 10vmin);
    z-index: 9999;
    margin: auto;
    border: none;
    padding: 0;
    background: transparent;
    color: inherit;
}

#lightbox-frame {
    position: relative;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: .75em;
    background: white;
    border: 1px solid #ddd;
    box-shadow: 0 4px 24px rgba(0, 0, 0, .1);
    min-width: 0;
}

#lightbox-frame::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

#lightbox-content {
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
}

@media (min-width: 768px) {
    #lightbox-img-wrapper {
        min-width: 75vmin;
        min-height: 75vmin;
    }
}

#lightbox-close {
    position: absolute;
    top: -4.5rem;
    right: -4rem;
    z-index: 10;
    border: none;
    background: none;
    font-size: 5rem;
    cursor: pointer;
    color: #111;
    padding: 0 .5rem;
    opacity: .5;
    transition: opacity .2s ease;
    line-height: 1;
    font-weight: bold;
    user-select: none;
}

#lightbox-close:hover {
    opacity: 1;
}

#lightbox-prev {
    left: -4rem;
}

#lightbox-next {
    right: -4rem;
}

#lightbox-prev,
#lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    border: none;
    background: none;
    font-size: 5rem;
    cursor: pointer;
    color: #111;
    padding: 0 .5rem;
    opacity: .5;
    transition: opacity .2s ease, transform .2s ease;
    line-height: 1;
    font-weight: bold;
    user-select: none;
}

#lightbox-prev:hover {
    opacity: 1;
    transform: translateY(-50%) scale(1.2);
}

#lightbox-next:hover {
    opacity: 1;
    transform: translateY(-50%) scale(1.2);
}

#lightbox-img {
    display: block;
    /*border: 1px solid #ddd;*/
    max-width: calc(100vw - 10vmin);
    max-height: calc(100vh - 10vmin);
}

@media (orientation: portrait) {
    #lightbox-img {
        width: 70vmin;
        height: auto;
    }
}

@media (orientation: landscape) {
    #lightbox-img {
        height: 70vmin;
        width: auto;
    }
}

#lightbox-caption {
    color: var(--c-ocean);
    font-size: .85rem;
    text-align: center;
    max-width: 90vw;
    width: 100%;
    line-height: 1.5;
    border-top: 1px solid #ddd;
    padding: .75em 1em 1em;
    display: none;
    pointer-events: auto;
    box-sizing: border-box;
}

.lightbox-wrapper {
    padding: 0 0 2rem;
}

#image-lightbox::backdrop {
    background: rgba(255, 255, 255, .85);
}
