/*
 * AI Act labelling.
 *
 * Offsets and width are custom properties, so the project CSS can override them per content
 * element, for example where a container clips its content with overflow: hidden.
 */
/*.ne-ai-label {*/
/*    position: relative;*/
/*    display: block;*/
/*}*/

.ne-ai-label svg {
    position: absolute;
    right: var(--ne-ai-label-offset-x, -15px);
    bottom: var(--ne-ai-label-offset-y, -15px);
    width: var(--ne-ai-label-width, 120px);
    height: auto;
    /* Must stay hit-testable, otherwise the hover falls through to the image and the
       browser shows the image title instead of the <title> of the badge. */
    pointer-events: auto;
    z-index: 2;
}

@media (max-width: 767px) {
    .ne-ai-label svg {
        width: var(--ne-ai-label-width-mobile, 90px);
    }
}

/*
 * Standalone badge from <neai:label>, e.g. next to a headline or on a record. It has no
 * wrapper and therefore flows inline; overlaying a medium is up to the project CSS.
 */
.ne-ai-label__icon {
    display: inline-block;
    width: var(--ne-ai-label-width, 120px);
    height: auto;
    vertical-align: middle;
}

@media (max-width: 767px) {
    .ne-ai-label__icon {
        width: var(--ne-ai-label-width-mobile, 90px);
    }
}

/*
 * The generic badge is a circle, the other two are wide pills, so the same width would
 * make it roughly three times as tall.
 */
.ne-ai-label__icon[data-ai-label-type="generic"],
.ne-ai-label svg[data-ai-label-type="generic"] {
    width: var(--ne-ai-label-width-generic, 45px);
}

@media (max-width: 767px) {
    .ne-ai-label__icon[data-ai-label-type="generic"],
    .ne-ai-label svg[data-ai-label-type="generic"] {
        width: var(--ne-ai-label-width-generic-mobile, 35px);
    }
}

/* Only clickable once the JavaScript enhancement is in place. */
.ne-ai-label-interactive .ne-ai-label__icon {
    cursor: pointer;
}

.ne-ai-label__icon:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/*
 * Explanation block, rendered through lib.aiLabelNotice. Only layout basics live here,
 * the visual design belongs to the project stylesheet.
 */
.ne-ai-label-notice {
    /* The jump target must not disappear behind a fixed header. */
    scroll-margin-top: var(--ne-ai-label-notice-scroll-margin, 100px);
}

.ne-ai-label-notice:focus {
    outline: none;
}

/* The JavaScript hides what is not on the page; project layout rules must not win here. */
.ne-ai-label-notice[hidden],
.ne-ai-label-notice__item[hidden] {
    display: none;
}

.ne-ai-label-notice__badge {
    width: var(--ne-ai-label-notice-badge-width, 90px);
    height: auto;
}

.ne-ai-label-notice__item[data-ai-label-type="generic"] .ne-ai-label-notice__badge {
    width: var(--ne-ai-label-notice-badge-width-generic, 34px);
}
