.ew-watermark-wrap {
    position: relative;
    display: block;
    width: 100%;
}

.ew-watermark-wrap > * {
    display: block;
}

/* Resized/repositioned by assets/js/watermark.js to match the actual visible
   rectangle of the content image (handles object-fit: contain/cover and any
   letterboxing). Falls back to the full wrap box until the script runs. */
.ew-watermark-fit {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* !important overrides are required here: Elementor widgets commonly
   generate a plain "img" selector scoped to the widget wrapper (e.g.
   ".elementor-element-XXXX img { height: ...; object-fit: contain; }")
   which matches this watermark <img> too since it's nested inside the
   same wrapper, and forces a near-full-height box that neutralizes the
   position offsets below. */
.ew-watermark-mark {
    position: absolute !important;
    z-index: 2;
    height: auto !important;
    max-width: 90%;
    max-height: 90%;
    object-fit: contain !important;
    object-position: center center !important;
    pointer-events: none;
    user-select: none;
}

/* object-position is repeated per position class (matching the same
   corner as top/left/right/bottom below): even with height:auto above,
   some themes/widgets force a fixed height on any descendant img with
   higher specificity than a bare ".ew-watermark-mark" rule, which turns
   this img's box back into a tall box the logo floats inside of. Setting
   object-position here keeps the logo pinned to the right corner of that
   box as a fallback, regardless of whether the box itself is compact. */
.ew-watermark-mark.ew-watermark-pos-center {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    object-position: center center !important;
}

.ew-watermark-mark.ew-watermark-pos-top-left {
    top: 5%;
    left: 5%;
    object-position: top left !important;
}

.ew-watermark-mark.ew-watermark-pos-top-right {
    top: 5%;
    right: 5%;
    object-position: top right !important;
}

.ew-watermark-mark.ew-watermark-pos-bottom-left {
    bottom: 5%;
    left: 5%;
    object-position: bottom left !important;
}

.ew-watermark-mark.ew-watermark-pos-bottom-right {
    bottom: 5%;
    right: 5%;
    object-position: bottom right !important;
}

.ew-watermark-mark.ew-watermark-white {
    filter: brightness(0) invert(1);
}
