/* Library page image lightbox */
.lib-lb {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: #080808;
    display: flex;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
}

.lib-lb.open {
    opacity: 1;
    pointer-events: all;
}

.lib-lb-topbar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 32px;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.7), transparent);
    pointer-events: none;
}

.lib-lb-counter {
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.65);
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
}

.lib-lb-close {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    cursor: pointer;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
    pointer-events: all;
    backdrop-filter: blur(8px);
    padding: 0;
}

.lib-lb-close:hover {
    background: rgba(255, 255, 255, 0.22);
    transform: scale(1.06);
}

.lib-lb-stage {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 80px 100px 12px;
}

.lib-lb-img-wrap {
    position: relative;
    max-width: 100%;
    max-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lib-lb-img {
    max-width: 100%;
    max-height: calc(100vh - 200px);
    object-fit: contain;
    display: block;
    border-radius: 14px;
    opacity: 0;
    transform: scale(0.96);
    transition: opacity 0.32s ease, transform 0.32s ease;
    user-select: none;
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.6);
}

.lib-lb-img.visible {
    opacity: 1;
    transform: scale(1);
}

.lib-lb-caption {
    position: absolute;
    bottom: 16px;
    left: 20px;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(12px);
    border-radius: 8px;
    padding: 8px 14px;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    pointer-events: none;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.3s 0.2s, transform 0.3s 0.2s;
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
    max-width: min(90vw, 640px);
}

.lib-lb-img.visible ~ .lib-lb-caption {
    opacity: 1;
    transform: translateY(0);
}

.lib-lb-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    cursor: pointer;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, border-color 0.2s, transform 0.25s;
    backdrop-filter: blur(12px);
    z-index: 10;
    padding: 0;
}

.lib-lb-arrow:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-50%) scale(1.08);
}

.lib-lb-arrow.prev { left: 20px; }
.lib-lb-arrow.next { right: 20px; }
.lib-lb-arrow:disabled { opacity: 0.2; pointer-events: none; }

.lib-lb-thumbstrip {
    flex-shrink: 0;
    height: 108px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 32px;
    overflow-x: auto;
    overflow-y: hidden;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85), transparent);
    scrollbar-width: none;
    scroll-behavior: smooth;
}

.lib-lb-thumbstrip::-webkit-scrollbar { display: none; }

.lib-lb-thumb {
    flex-shrink: 0;
    width: 82px;
    height: 58px;
    overflow: hidden;
    cursor: pointer;
    border-radius: 6px;
    border: 2px solid transparent;
    opacity: 0.45;
    transition: opacity 0.25s, border-color 0.25s, transform 0.25s, box-shadow 0.25s;
}

.lib-lb-thumb:hover {
    opacity: 0.8;
    transform: scale(1.06);
}

.lib-lb-thumb.active {
    border-color: #fff;
    opacity: 1;
    transform: scale(1.1);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.3), 0 4px 16px rgba(0, 0, 0, 0.6);
}

.lib-lb-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
    border-radius: 4px;
}

@media (max-width: 768px) {
    .lib-lb-stage { padding: 64px 8px 8px; }
    .lib-lb-arrow.prev { left: 8px; }
    .lib-lb-arrow.next { right: 8px; }
    .lib-lb-topbar { padding: 16px; }
}
