/* ── Gallery Hover Effect (zoom icon) ────────────────────────────── */

.ce_gallery a[data-lightbox] {
    display: block;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.ce_gallery a[data-lightbox] img {
    transition: transform 0.3s ease, filter 0.3s ease;
}

.ce_gallery a[data-lightbox]::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0) url('data:image/svg+xml,\
      <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" \
        stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\
        <circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/>\
        <line x1="11" y1="8" x2="11" y2="14"/><line x1="8" y1="11" x2="14" y2="11"/>\
      </svg>') no-repeat center center;
    background-size: 40px 40px;
    opacity: 0;
    transition: opacity 0.3s ease, background-color 0.3s ease;
    pointer-events: none;
}

.ce_gallery a[data-lightbox]:hover img {
    transform: scale(1.05);
    filter: brightness(0.75);
}

.ce_gallery a[data-lightbox]:hover::after {
    opacity: 1;
    background-color: rgba(0, 0, 0, 0.15);
}

/* ── BFR Wisskirchen Lightbox ─────────────────────────────────────── */

.lightbox-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    z-index: 10000;
    cursor: pointer;
}

.lightbox-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-image-wrap {
    position: relative;
    max-width: 90vw;
    max-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-image-wrap img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    image-rendering: auto;
    cursor: default;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.lightbox-image-wrap img.loaded {
    opacity: 1;
}

/* Loading spinner */
.lightbox-image-wrap::after {
    content: '';
    position: absolute;
    width: 36px;
    height: 36px;
    border: 3px solid rgba(255, 255, 255, 0.25);
    border-top-color: #fff;
    border-radius: 50%;
    animation: lb-spin 0.7s linear infinite;
    pointer-events: none;
}

.lightbox-image-wrap img.loaded + .lb-spacer,
.lightbox-image-wrap:has(img.loaded)::after {
    display: none;
}

@keyframes lb-spin {
    to { transform: rotate(360deg); }
}

/* Close button */
.lightbox-close {
    position: fixed;
    top: 16px;
    right: 20px;
    width: 40px;
    height: 40px;
    cursor: pointer;
    z-index: 10002;
    background: none;
    border: none;
    padding: 0;
}

.lightbox-close::before,
.lightbox-close::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 28px;
    height: 3px;
    background: #fff;
    border-radius: 2px;
}

.lightbox-close::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.lightbox-close::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.lightbox-close:hover::before,
.lightbox-close:hover::after {
    background: #cc0000;
}

/* Navigation arrows */
.lightbox-prev,
.lightbox-next {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 70px;
    cursor: pointer;
    z-index: 10002;
    background: none;
    border: none;
    padding: 0;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    opacity: 1;
}

.lightbox-prev {
    left: 12px;
}

.lightbox-next {
    right: 12px;
}

.lightbox-prev::before,
.lightbox-next::before {
    content: '';
    position: absolute;
    top: 50%;
    width: 20px;
    height: 20px;
    border-top: 3px solid #fff;
    border-left: 3px solid #fff;
}

.lightbox-prev::before {
    left: 16px;
    transform: translateY(-50%) rotate(-45deg);
}

.lightbox-next::before {
    right: 16px;
    transform: translateY(-50%) rotate(135deg);
}

/* Caption */
.lightbox-caption {
    position: fixed;
    bottom: 38px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 15px;
    font-family: Arial, Helvetica, sans-serif;
    text-align: center;
    max-width: 80vw;
    z-index: 10002;
    pointer-events: none;
}

/* Counter */
.lightbox-counter {
    position: fixed;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    color: #ccc;
    font-size: 14px;
    font-family: Arial, Helvetica, sans-serif;
    z-index: 10002;
    pointer-events: none;
}

/* ── Mobile adjustments ──────────────────────────────────────────── */
@media (max-width: 768px) {
    .lightbox-image-wrap img {
        max-width: 96vw;
        max-height: 80vh;
    }

    .lightbox-prev,
    .lightbox-next {
        width: 40px;
        height: 50px;
    }

    .lightbox-prev { left: 4px; }
    .lightbox-next { right: 4px; }

    .lightbox-prev::before,
    .lightbox-next::before {
        width: 14px;
        height: 14px;
        border-width: 2px;
    }

    .lightbox-close {
        top: 10px;
        right: 10px;
    }
}
