/* Dynamic display-only watermark overlay. Original gallery image files are never modified. */
.gallery-watermark-media {
    position: relative;
    overflow: hidden;
    display: block;
}

/* Full-photo viewer: this wrapper shrink-wraps the rendered image itself.
   The watermark is therefore positioned against the visible image bounds,
   not against the larger lightbox stage around it. */
.gallery-watermark-photo-frame {
    display: inline-block;
    position: relative;
    max-width: 100%;
    max-height: 100%;
    line-height: 0;
    vertical-align: middle;
}

.gallery-watermark-photo-frame > img {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 70vh;
    margin: 0;
}

.gallery-site-watermark {
    position: absolute;
    z-index: 3;
    width: var(--gallery-watermark-size, 50%);
    opacity: var(--gallery-watermark-opacity, .5);
    pointer-events: none;
    user-select: none;
    line-height: 0;
}

.gallery-site-watermark img {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    max-width: 100% !important;
    max-height: none !important;
    aspect-ratio: auto !important;
    object-fit: contain !important;
    margin: 0 !important;
    transform: none !important;
}

.gallery-site-watermark.is-top-left { top: 4%; left: 4%; }
.gallery-site-watermark.is-top-right { top: 4%; right: 4%; }
.gallery-site-watermark.is-center { top: 50%; left: 50%; transform: translate(-50%, -50%); }
.gallery-site-watermark.is-bottom-left { bottom: 4%; left: 4%; }
.gallery-site-watermark.is-bottom-right { right: 4%; bottom: 4%; }

.gallery-photo-card:hover .gallery-site-watermark img,
.gallery-photo-card:focus-visible .gallery-site-watermark img {
    transform: none !important;
}

.gallery-photo-download {
    display: inline-block;
    margin-top: .5rem;
}

@media (max-width: 720px) {
    .gallery-watermark-photo-frame > img {
        max-height: 62vh;
    }
}
