/* ==============================================
   WP Bildergalerie – Frontend Styles
   ============================================== */

/* Filter-Buttons */
.wpbg-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

.wpbg-filter-btn {
    padding: 7px 18px;
    border: 2px solid #333;
    background: transparent;
    color: #333;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all .22s ease;
    letter-spacing: .03em;
}

.wpbg-filter-btn:hover,
.wpbg-filter-btn.active {
    background: #333;
    color: #fff;
}

/* Grid */
.wpbg-grid {
    --wpbg-cols: 3;
    display: grid;
    grid-template-columns: repeat(var(--wpbg-cols), 1fr);
    gap: 12px;
}

@media (max-width: 900px) {
    .wpbg-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 540px) {
    .wpbg-grid { grid-template-columns: 1fr; }
}

/* Galerie-Item */
.wpbg-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    background: #f0f0f0;
    aspect-ratio: 4 / 3;
    transition: transform .25s ease, box-shadow .25s ease;
}

.wpbg-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0,0,0,.18);
}

.wpbg-item a {
    display: block;
    width: 100%;
    height: 100%;
}

.wpbg-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .35s ease;
}

.wpbg-item:hover img {
    transform: scale(1.06);
}

/* Hover-Overlay */
.wpbg-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,.65) 0%, transparent 55%);
    display: flex;
    align-items: flex-end;
    padding: 14px;
    opacity: 0;
    transition: opacity .28s ease;
}

.wpbg-item:hover .wpbg-overlay {
    opacity: 1;
}

.wpbg-overlay span {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    text-shadow: 0 1px 3px rgba(0,0,0,.5);
}

/* Leer-Meldung */
.wpbg-leer {
    color: #888;
    font-style: italic;
}

/* Hidden items (Filter) */
.wpbg-item.wpbg-hidden {
    display: none;
}

/* ==============================================
   Lightbox
   ============================================== */
.wpbg-lb-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.92);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 24px;
    animation: wpbgFadeIn .2s ease;
}

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

.wpbg-lb-inner {
    position: relative;
    max-width: min(90vw, 1100px);
    max-height: 80vh;
}

.wpbg-lb-inner img {
    display: block;
    max-width: 100%;
    max-height: 80vh;
    border-radius: 6px;
    box-shadow: 0 20px 60px rgba(0,0,0,.6);
    animation: wpbgZoomIn .2s ease;
}

@keyframes wpbgZoomIn {
    from { transform: scale(.94); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}

.wpbg-lb-caption {
    color: rgba(255,255,255,.8);
    font-size: 14px;
    margin-top: 14px;
    text-align: center;
    max-width: 600px;
}

.wpbg-lb-close {
    position: fixed;
    top: 20px;
    right: 24px;
    color: #fff;
    font-size: 32px;
    cursor: pointer;
    line-height: 1;
    opacity: .7;
    transition: opacity .2s;
    background: none;
    border: none;
    padding: 0;
}
.wpbg-lb-close:hover { opacity: 1; }

.wpbg-lb-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    color: #fff;
    font-size: 40px;
    cursor: pointer;
    background: none;
    border: none;
    opacity: .6;
    transition: opacity .2s;
    padding: 0 12px;
    user-select: none;
}
.wpbg-lb-nav:hover { opacity: 1; }
.wpbg-lb-prev { left: 12px; }
.wpbg-lb-next { right: 12px; }
