/**
 * 图片灯箱样式（E05 切片 C）。
 *
 * 与脚本一起按需加载：没有灯箱图片的页面既不下载这个文件，也不下载脚本。
 * 触屏不依赖 hover——按钮在任何输入方式下都常驻可见，只是悬停时加深。
 */
.yk-lightbox {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgb(0 0 0 / 0.85);
    padding: 1rem;
}

.yk-lightbox[hidden] {
    display: none;
}

.yk-lightbox-figure {
    margin: 0;
    max-width: 92vw;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.yk-lightbox-img {
    max-width: 92vw;
    max-height: 78vh;
    border-radius: 0.5rem;
    box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.5);
    object-fit: contain;
}

.yk-lightbox-caption {
    color: rgb(255 255 255 / 0.9);
    font-size: 0.875rem;
    text-align: center;
    max-width: 60ch;
}

.yk-lightbox-caption[hidden] {
    display: none;
}

.yk-lightbox-counter {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    color: rgb(255 255 255 / 0.7);
    font-size: 0.75rem;
    margin: 0;
}

.yk-lightbox button {
    position: absolute;
    background: rgb(0 0 0 / 0.35);
    color: rgb(255 255 255 / 0.85);
    border: 0;
    border-radius: 9999px;
    cursor: pointer;
    line-height: 1;
    /* 触屏目标不小于 44px，且不靠 hover 才出现 */
    min-width: 2.75rem;
    min-height: 2.75rem;
}

.yk-lightbox button:hover,
.yk-lightbox button:focus-visible {
    background: rgb(0 0 0 / 0.6);
    color: #fff;
}

.yk-lightbox button:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.yk-lightbox button[hidden] {
    display: none;
}

.yk-lightbox-close {
    top: 1rem;
    right: 1rem;
    font-size: 1.75rem;
}

.yk-lightbox-prev,
.yk-lightbox-next {
    top: 50%;
    transform: translateY(-50%);
    font-size: 2rem;
}

.yk-lightbox-prev {
    left: 0.75rem;
}

.yk-lightbox-next {
    right: 0.75rem;
}
