/* Lightbox: click a .content-image to zoom, click close/backdrop or Esc to shrink back. */
.content-image,
.page p > img[src^="images/"] {
    cursor: zoom-in;
}

.lightbox-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: rgba(20, 18, 15, 0);
    backdrop-filter: blur(0px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, background-color 0.3s ease, backdrop-filter 0.3s ease, visibility 0s linear 0.3s;
}

.lightbox-overlay.open {
    opacity: 1;
    visibility: visible;
    background: rgba(20, 18, 15, 0.82);
    backdrop-filter: blur(4px);
    transition: opacity 0.3s ease, background-color 0.3s ease, backdrop-filter 0.3s ease, visibility 0s;
}

.lightbox-img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 8px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
    transform: scale(0.85);
    opacity: 0;
    transition: transform 0.32s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.3s ease;
    object-fit: contain;
}

.lightbox-overlay.open .lightbox-img {
    transform: scale(1);
    opacity: 1;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 24px;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.24);
    transform: scale(1.08);
}

@media (max-width: 640px) {
    .lightbox-overlay {
        padding: 16px;
    }
    .lightbox-close {
        top: 12px;
        right: 12px;
    }
}
