/* Lightbox 縮圖觸發按鈕重置 */
.lightbox-trigger {
    border: none;
    background: transparent;
    padding: 0;
    cursor: zoom-in;
    display: block;
    width: 100%;
}
.lightbox-trigger img {
    display: block;
    width: 100%;
    height: auto;
}

/* 滿版遮罩層 */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.92);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    padding: 32px;
    box-sizing: border-box;
}
.lightbox-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* 圖片容器，居中不動 */
.lightbox-wrap {
    position: relative;
    max-width: min(1500px, calc(100vw - 64px));
    max-height: calc(100vh - 80px);
    z-index: 2;
}
.lightbox-img {
    display: block;
    width: 100%;
    height: auto;
    max-height: calc(100vh - 80px);
    object-fit: contain;
    border: 2px solid #fff;
    transition: opacity 0.25s ease;
}
.lightbox-img.loading {
    opacity: 0;
}

/* 關閉按鈕 固定圖片右上角 */
.lightbox-close {
    position: absolute;
    top: -44px;
    right: 0;
    color: #fff;
    font-size: 36px;
    background: transparent;
    border: none;
    cursor: pointer;
    line-height: 1;
    padding: 0 8px;
    z-index: 3;
}

/* ========== 滿版左右箭頭（重點修改） ========== */
.lightbox-prev,
.lightbox-next {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 45%;
    height: 100vh;
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.4);
    font-size: 52px;
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 0 20px;
    transition: color 0.2s ease;
    z-index: 1;
}
.lightbox-prev:hover,
.lightbox-next:hover {
    color: #ffffff;
}
.lightbox-prev {
    left: 0;
    justify-content: flex-start;
}
.lightbox-next {
    right: 0;
    justify-content: flex-end;
}

/* 彈窗開啟時禁止頁面滾動 */
body.lightbox-open {
    overflow: hidden;
}