/* The lightbox (js/lightbox.js): a picture opened big over the whole page. Shared by the articles of the blog and the page of a tip. */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3.5rem 4rem;
    background: rgba(8, 12, 18, .92);
}

.lightbox[hidden] {
    display: none;
}

.lightbox-figure {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 100%;
    max-height: 100%;
    margin: 0;
}

.lightbox-image {
    display: block;
    max-width: 100%;
    max-height: calc(100vh - 11rem);
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 6px;
}

.lightbox-caption {
    margin-top: .75rem;
    max-width: 44rem;
    color: #e3e8ee;
    font-size: 1rem;
    line-height: 1.4;
    text-align: center;
}

.lightbox-count {
    display: block;
    margin-top: .2rem;
    color: #9aa7b6;
    font-size: .85rem;
}

.lightbox-button {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    padding: 0;
    background: rgba(255, 255, 255, .16);
    border: 1px solid rgba(255, 255, 255, .35);
    border-radius: 50%;
    color: #fff;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}

.lightbox-button:hover,
.lightbox-button:focus-visible {
    background: rgba(255, 255, 255, .3);
}

.lightbox-close {
    top: .75rem;
    right: .75rem;
}

.lightbox-prev {
    top: 50%;
    left: .75rem;
    transform: translateY(-50%);
}

.lightbox-next {
    top: 50%;
    right: .75rem;
    transform: translateY(-50%);
}

.lightbox-button[hidden] {
    display: none;
}

@media (max-width: 767px) {
    .lightbox {
        padding: 3.5rem .5rem 1rem;
    }

    .lightbox-prev {
        top: auto;
        bottom: .75rem;
        left: .75rem;
        transform: none;
    }

    .lightbox-next {
        top: auto;
        right: .75rem;
        bottom: .75rem;
        transform: none;
    }
}

@media (prefers-reduced-motion: no-preference) {
    .lightbox {
        animation: lightbox-in .18s ease;
    }
}

@keyframes lightbox-in {
    from {
        opacity: 0;
    }
}
