/* ==========================
   GALERIE-SECTION
========================== */
.galeriboersefritz {
    max-width: 1400px;
    margin: 80px auto 0 auto;
    padding-left: 0;
    padding-right: 0;
}

/* Galerie Grid */
.gallery-grid {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    background: transparent;
    padding: 0;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    background: #f3f3f3;
    border: none;
    border-radius: 0;
    aspect-ratio: 16 / 9;
    cursor: pointer;
    transition: transform 0.25s ease;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease;
    position: relative;
    z-index: 0;
}

.gallery-item::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.08) 0%, rgba(0, 0, 0, 0.35) 100%);
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
    z-index: 1;
}

.gallery-item::after {
    content: "";
    position: absolute;
    right: 18px;
    bottom: 18px;
    width: 56px;
    height: 56px;
    border-radius: 999px;
    transform: scale(0.9);
    opacity: 0;
    background: #2f6fe0;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 24px 24px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='7 17 17 7'/%3E%3Cpolyline points='10 7 17 7 17 14'/%3E%3C/svg%3E");
    transition: opacity 0.25s ease, transform 0.25s ease;
    pointer-events: none;
    z-index: 2;
}

.gallery-item:hover::before {
    opacity: 0.9;
}

.gallery-item:hover::after {
    opacity: 1;
    transform: scale(1);
}

.gallery-item:hover img {
    transform: scale(1.02);
}

.gallery-item:hover {
    transform: translateY(-2px);
}

.gallery-item:hover,
.gallery-item:focus-within {
    cursor: zoom-in;
}

.gallery-info {
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
}

.gallery-info-icon {
    position: absolute;
    right: 8px;
    bottom: 8px;
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(47, 111, 224, 0.75);
    color: transparent;
    font-size: 0;
    font-weight: 700;
    line-height: 1;
    text-transform: uppercase;
    pointer-events: auto;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cline x1='12' y1='11' x2='12' y2='16'/%3E%3Ccircle cx='12' cy='8' r='1' fill='%23ffffff' stroke='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 16px 16px;
}

.gallery-info-text {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 10px 14px;
    background: rgba(110, 104, 95, 0.85);
    color: #ffffff;
    font-size: 0.7rem;
    line-height: 1.4;
    text-align: center;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}

.gallery-info-icon:hover + .gallery-info-text,
.gallery-info-icon:focus-visible + .gallery-info-text {
    opacity: 1;
    transform: translateY(0);
}

/* Lightbox */
/* Lightbox Overlay */
#lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10050;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
}

#lightbox-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.lightbox-img {
    position: absolute;
    left: 50%;
    top: 50%;
    max-width: 88%;
    max-height: 82%;
    border: none;
    outline: none;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.98);
    transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.20, 0.5, 0.2, 1);
    z-index: 1;
}

#lightbox-overlay img.image-loading,
#lightbox-overlay img.image-error {
    background: transparent;
    border: none;
}

.lightbox-img.next {
    z-index: 2;
}

.lightbox-img.active {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.lightbox-img.no-anim {
    transition: none !important;
}
#lightbox-close {
    position: absolute;
    top: 28px;
    right: 40px;
    font-size: 0;
    color: transparent;
    background-color: transparent;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='18' y1='6' x2='6' y2='18'/%3E%3Cline x1='6' y1='6' x2='18' y2='18'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 28px 28px;
    cursor: pointer;
    z-index: 10060;
    animation: lightbox-close-spin 0.4s ease-out 1;
    opacity: 0.8;
    transition: opacity 0.2s ease, filter 0.2s ease;
}

#lightbox-close:hover {
    opacity: 1;
    filter: brightness(1.15);
}

.lightbox-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0;
    color: transparent;
    opacity: 1;
    background-color: transparent;
    width: 72px;
    height: 72px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 10060;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 36px 36px;
}

.lightbox-arrow:hover {
    transform: translateY(-50%) scale(1.03);
    opacity: 0.7;
}

#lightbox-prev {
    left: 60px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='15 18 9 12 15 6'/%3E%3C/svg%3E");
}

#lightbox-prev:hover {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23bfc5cc' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='15 18 9 12 15 6'/%3E%3C/svg%3E");
}

#lightbox-next {
    right: 60px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='9 18 15 12 9 6'/%3E%3C/svg%3E");
}

#lightbox-next:hover {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23bfc5cc' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='9 18 15 12 9 6'/%3E%3C/svg%3E");
}

body.lightbox-open {
    overflow: hidden !important;
}

#lightbox-image.fade-out {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.98);
}

/* Tablet */
@media (max-width: 1024px) {
    .gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
    }

    .gallery-item {
        aspect-ratio: 4 / 3;
    }
}

/* Mobile */
@media (max-width: 600px) {
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 0 12px;
    }

    .gallery-item {
        aspect-ratio: 4 / 3;
    }

    .lightbox-arrow {
        width: 56px;
        height: 56px;
        background-size: 28px 28px;
    }

    #lightbox-prev { left: 16px; }
    #lightbox-next { right: 16px; }

    #lightbox-close {
        top: 16px;
        right: 18px;
        font-size: 48px;
    }
}

@keyframes lightbox-close-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
