.wp-popup-bild {
    position: relative;
    z-index: 999999;
}

.wp-popup-bild__thumb {
    position: fixed;
    left: 18px;
    bottom: 18px;
    width: 76px;
    height: 76px;
    padding: 0;
    border: 0;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 4px 18px rgba(0,0,0,.25);
    cursor: pointer;
    z-index: 1000000;
}

.wp-popup-bild__thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wp-popup-bild__overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
    background: rgba(0,0,0,.78);
    z-index: 1000001;
    box-sizing: border-box;
}

.wp-popup-bild__overlay[hidden] {
    display: none;
}

.wp-popup-bild__content {
    position: relative;
    max-width: min(1200px, 94vw);
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.wp-popup-bild__content img {
    display: block;
    max-width: 100%;
    max-height: calc(92vh - 70px);
    width: auto;
    height: auto;
    object-fit: contain;
    box-shadow: 0 8px 35px rgba(0,0,0,.4);
}

.wp-popup-bild__info {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 22px;
    border-radius: 6px;
    background: #fff;
    color: #111;
    text-decoration: none;
    font-weight: 600;
    line-height: 1.2;
    box-sizing: border-box;
    transition: transform .2s ease, opacity .2s ease;
}

.wp-popup-bild__info:hover {
    transform: translateY(-1px);
    opacity: .92;
}

.wp-popup-bild__info:focus-visible,
.wp-popup-bild__close:focus-visible,
.wp-popup-bild__thumb:focus-visible {
    outline: 3px solid currentColor;
    outline-offset: 3px;
}

.wp-popup-bild__close {
    position: fixed;
    top: 18px;
    right: 22px;
    width: 46px;
    height: 46px;
    border: 0;
    border-radius: 50%;
    background: rgba(255,255,255,.95);
    color: #111;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
    z-index: 1000002;
}

.wp-popup-bild--open .wp-popup-bild__thumb {
    display: none;
}

html.wp-popup-bild-lock,
body.wp-popup-bild-lock {
    overflow: hidden;
}

@media (max-width: 600px) {
    .wp-popup-bild__thumb {
        left: 12px;
        bottom: 12px;
        width: 62px;
        height: 62px;
        border-radius: 8px;
    }

    .wp-popup-bild__overlay {
        padding: 15px;
    }

    .wp-popup-bild__close {
        top: 10px;
        right: 10px;
        width: 42px;
        height: 42px;
        font-size: 28px;
    }

    .wp-popup-bild__content {
        max-width: 96vw;
        max-height: 90vh;
        gap: 12px;
    }

    .wp-popup-bild__content img {
        max-height: calc(90vh - 65px);
    }

    .wp-popup-bild__info {
        width: min(100%, 320px);
    }
}

.wp-popup-bild__thumb {
    opacity: 0;
    transform: translate(-18px, 12px) scale(.65);
    transition:
        opacity .35s ease,
        transform .4s cubic-bezier(.22, 1, .36, 1),
        box-shadow .25s ease;
    pointer-events: none;
}

.wp-popup-bild__thumb:hover {
    transform: translate(0, 0) scale(1.04);
}

.wp-popup-bild--minimized .wp-popup-bild__thumb {
    opacity: 1;
    transform: translate(0, 0) scale(1);
    pointer-events: auto;
    animation: wp-popup-bild-thumb-in .5s cubic-bezier(.22, 1, .36, 1) both;
}

.wp-popup-bild__thumb:active {
    transform: translate(0, 0) scale(.94);
}

@keyframes wp-popup-bild-thumb-in {
    0% {
        opacity: 0;
        transform: translate(-24px, 18px) scale(.55);
    }
    65% {
        opacity: 1;
        transform: translate(4px, -2px) scale(1.06);
    }
    100% {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }
}

.wp-popup-bild__overlay {
    animation: wp-popup-bild-overlay-in .28s ease both;
}

.wp-popup-bild__content {
    animation: wp-popup-bild-image-in .38s cubic-bezier(.22, 1, .36, 1) both;
}

@keyframes wp-popup-bild-overlay-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes wp-popup-bild-image-in {
    from {
        opacity: 0;
        transform: scale(.94);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.wp-popup-bild--open .wp-popup-bild__thumb {
    opacity: 0;
    transform: translate(-18px, 12px) scale(.65);
    pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
    .wp-popup-bild__thumb,
    .wp-popup-bild__overlay,
    .wp-popup-bild__content,
    .wp-popup-bild__info {
        animation: none;
        transition: none;
    }
}
