/* AI BADGE - "KI" notice on an image whose file metadata has tx_abcfinance_ai_generated.
   Rendered by <abc:aiBadge> (AiBadgeViewHelper): as a direct child of the element that wraps the image, or with its image in an .AiBadgeFrame. */

/* the wrapping element becomes the positioning context; :where() keeps this at zero specificity, so an element that is already positioned keeps its position */
:where(:has(> .AiBadge)) {
    position: relative;
}

/* shrink-to-fit frame around an image that is narrower than its parent (e.g. a centered image in a text/image element) */
.AiBadgeFrame {
    position: relative;
    display: inline-block;
    max-width: 100%;
}

.AiBadge {
    position: absolute;
    z-index: var(--z-ai-badge);
    top: 8px;
    right: 8px;
    padding: 0 4px;
    border-radius: var(--bs-border-radius-sm);
    /* light frosted chip: blends into the image, the blur keeps the text readable on busy areas */
    background-color: rgb(255 255 255 / 60%);
    backdrop-filter: blur(4px);
    color: rgb(0 0 0 / 70%);
    font-size: 12px;
    line-height: 1.5;
    pointer-events: none;
}

/* Person profile, variant imgbg: the picture fades out over its right 28% (PersonProfile.css), so the badge sits where the fade starts */
.person-profile.imgbg:not(.reverse) .picture > .AiBadge {
    right: calc(28% + 8px);
}
