/* Blaufabrik Masonry Gallery - Frontend Styles */

.bf-masonry-gallery {
    width: 100%;
    padding: 20px 0;
}

.bf-gallery-grid {
    margin: 0 -10px;
}

.bf-gallery-item {
    width: calc(33.333% - 20px);
    margin: 10px;
    float: left;
    position: left;
    overflow: hidden;
    background: #f5f5f5;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.bf-gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.bf-gallery-item a {
    display: block;
    position: relative;
    text-decoration: none;
}

.bf-gallery-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

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

.bf-gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0) 100%);
    color: #fff;
    padding: 30px 15px 15px;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.bf-gallery-item:hover .bf-gallery-caption {
    opacity: 1;
}

/* Responsive Grid */
@media screen and (max-width: 1024) {
    .bf-gallery-item {
        width: calc(50% - 20px);
    }
}

@media screen and (max-width: 768px) {
    .bf-gallery-item {
        width: calc(50% - 20px);
    }
    
    .bf-masonry-gallery {
        padding: 10px 0;
    }
    
    .bf-gallery-item {
        margin: 5px;
        width: calc(50% - 10px);
    }
}

@media screen and (max-width: 480px) {
    .bf-gallery-item {
        width: calc(100% - 20px);
    }
}

/* PhotoSwipe Custom Styles */
.pswp {
    --pswp-bg: rgba(0, 0, 0, 0.95);
}

.pswp__button {
    background-color: rgba(0, 0, 0, 0.3);
    transition: background-color 0.2s ease;
}

.pswp__button:hover {
    background-color: rgba(0, 0, 0, 0.6);
}

/* Loading Animation */
.bf-gallery-item img {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Masonry-Layout spezifische Stile */
.bf-gallery-grid:after {
    content: '';
    display: block;
    clear: both;
}

/* Variationen für Masonry-Höhen */
.bf-gallery-item:nth-child(3n+1) {
    /* Normale Höhe */
}

.bf-gallery-item:nth-child(3n+2) {
    /* Etwas höher - für Masonry-Effekt */
}

.bf-gallery-item:nth-child(3n+3) {
    /* Standard */
}

/* Overlay-Effekt beim Hover */
.bf-gallery-item a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 91, 187, 0.1);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.bf-gallery-item:hover a::before {
    opacity: 1;
}

/* Zoom-Icon beim Hover */
.bf-gallery-item a::after {
    content: '\f179';
    font-family: 'dashicons';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    color: #fff;
    font-size: 48px;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 2;
}

.bf-gallery-item:hover a::after {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}
