/* Gallery thumbnail focus ring
   .gallery-icon has overflow: hidden which clips focus indicators on the <a> inside it.
   Suppress the clipped ring on the link and redraw it on the container instead. */
.gallery .gallery-icon a:focus-visible {
    box-shadow: none;
    outline: none;
}

.gallery .gallery-icon:focus-within {
    box-shadow: 0 0 0 0.3rem #0c7bbc;
    outline: 2px solid #1d1d1d;
    outline-offset: 0.3rem;
}

.cn-lightbox__announce {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

#cn-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
}

#cn-lightbox[hidden] {
    display: none;
}

.cn-lightbox__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
    cursor: pointer;
}

.cn-lightbox__figure {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 90vw;
    max-height: 90vh;
    margin: 0;
}

.cn-lightbox__img {
    display: block;
    max-width: 90vw;
    max-height: 80vh;
    object-fit: contain;
    user-select: none;
    border: 0.6rem solid white;
}

.cn-lightbox__caption {
    margin: 0.5rem 0 0;
    color: #e0e0e0;
    font-size: 0.875rem;
    text-align: center;
}

.cn-lightbox__caption[hidden] {
    display: none;
}

.cn-lightbox__counter {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8125rem;
    white-space: nowrap;
    pointer-events: none;
}

.cn-lightbox__close,
.cn-lightbox__prev,
.cn-lightbox__next {
    position: absolute;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    line-height: 1;
    transition: background 0.15s ease;
}

.cn-lightbox__close:hover,
.cn-lightbox__prev:hover,
.cn-lightbox__next:hover {
    background: rgba(0, 0, 0, 0.75);
}

.cn-lightbox__close:focus-visible,
.cn-lightbox__prev:focus-visible,
.cn-lightbox__next:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 3px;
}

.cn-lightbox__close[hidden],
.cn-lightbox__prev[hidden],
.cn-lightbox__next[hidden] {
    display: none;
}

.cn-lightbox__close {
    top: 1rem;
    right: 1rem;
    width: 2.5rem;
    height: 2.5rem;
}

.cn-lightbox__prev,
.cn-lightbox__next {
    top: 50%;
    transform: translateY(-50%);
    width: 3.5rem;
    height: 3.5rem;
}

.cn-lightbox__prev {
    left: 1rem;
}

.cn-lightbox__next {
    right: 1rem;
}

@media screen and (max-width: 39.9375em) {
    .cn-lightbox__img {
        max-height: 75vh;
    }

    .cn-lightbox__prev,
    .cn-lightbox__next {
        width: 2.75rem;
        height: 2.75rem;
    }
}
