.elementor-widget-image:has(.mp-photo-credit--overlay),
.elementor-widget-image > .elementor-widget-container:has(.mp-photo-credit--overlay),
.gallery-item:has(.mp-photo-credit--gallery),
.gallery-icon[data-mp-gallery-credit],
.swiper-zoom-container:has(> .mp-photo-credit--band),
.swiper-slide-inner:has(.mp-photo-credit--overlay),
.e-con[data-mp-photo-credit] {
    position: relative;
}

.mp-photo-credit,
.gallery-icon[data-mp-gallery-credit]::after,
.e-con[data-mp-photo-credit]::after {
    position: absolute;
    inset-inline-end: .5rem;
    bottom: .4rem;
    z-index: 4;
    max-width: calc(100% - 1rem);
    margin: 0;
    padding: .15rem .42rem;
    border-radius: 2px;
    color: #fff;
    background: rgb(20 20 18 / 82%);
    font-family: inherit;
    font-size: .75rem;
    font-weight: 600;
    line-height: 1.35;
    text-align: end;
    pointer-events: none;
    visibility: hidden;
    opacity: 0;
    transition: opacity .15s ease;
}

.e-con[data-mp-photo-credit]::after {
    content: attr(data-mp-photo-credit);
}

.mp-photo-credit--lightbox {
    inset-inline-end: var(--mp-credit-right, .5rem);
    bottom: var(--mp-credit-bottom, .4rem);
}

.gallery-icon[data-mp-gallery-credit]::after,
.mp-photo-credit--lightbox.mp-photo-credit--band {
    inset-inline: 0;
    bottom: 0;
    max-width: none;
    box-sizing: border-box;
    padding: .42rem .85rem;
    border-radius: 0;
}

.gallery-icon[data-mp-gallery-credit]::after {
    content: attr(data-mp-gallery-credit);
}

.mp-photo-credit--lightbox.mp-photo-credit--band {
    inset-inline-start: var(--mp-credit-left, 0px);
    inset-inline-end: var(--mp-credit-right, 0px);
    bottom: var(--mp-credit-bottom, 0px);
}

@media (any-hover: hover) {
    .elementor-widget-image:has(img:hover) .mp-photo-credit--overlay,
    .gallery-item:has(.gallery-icon img:hover) > .mp-photo-credit--gallery,
    .gallery-icon[data-mp-gallery-credit]:has(img:hover)::after,
    .swiper-slide-inner:has(.swiper-slide-image:hover) > .mp-photo-credit--overlay,
    .e-con[data-mp-photo-credit]:hover::after,
    .elementor-lightbox-image:hover + .mp-photo-credit--lightbox {
        visibility: visible;
        opacity: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mp-photo-credit,
    .gallery-icon[data-mp-gallery-credit]::after,
    .e-con[data-mp-photo-credit]::after {
        transition: none;
    }
}

