/*
 * AI Act (Art. 50) transparency badge — AI Content Labelling plugin.
 *
 * Rendered as a DOM overlay by ai_label_the_badge() so the disclosure survives
 * object-fit cropping, clip-path corner chamfers and image-behind-text layouts
 * that would hide a label baked into the image pixels.
 *
 * Default corner is bottom-right. Per-placement overrides pass a different
 * ai-badge--<pos> modifier.
 */

/*
 * Guarantee the badge's immediate wrapper is a positioning context, without
 * having to add `relative` to every template. Wrappers that are already
 * positioned (absolute/relative) keep their value and still anchor the badge.
 */
:has(> .ai-badge) {
  position: relative;
}

.ai-badge {
  --ai-badge-inset: clamp(0.5rem, 1.4vw, 1rem);

  position: absolute;
  z-index: 20;
  /* Let clicks reach links that wrap the image (e.g. teaser-link). */
  pointer-events: none;
  display: block;
  width: clamp(84px, 12vw, 128px);
  max-width: 45%;
  /* Lift the pill off same-toned backgrounds regardless of the chosen variant. */
  filter: drop-shadow(0 1px 3px rgb(0 0 0 / 0.45));
}

.ai-badge__img {
  display: block;
  width: 100%;
  height: auto;
}

/* Wrapper added by the optional auto-injection so the badge has a frame. */
.ai-badge-frame {
  position: relative;
  display: inline-block;
  max-width: 100%;
}

.ai-badge-frame > img {
  display: block;
  max-width: 100%;
  height: auto;
}

.ai-badge--bottom-left {
  bottom: var(--ai-badge-inset);
  left: var(--ai-badge-inset);
}

.ai-badge--bottom-right {
  bottom: var(--ai-badge-inset);
  right: var(--ai-badge-inset);
}

.ai-badge--top-left {
  top: var(--ai-badge-inset);
  left: var(--ai-badge-inset);
}

.ai-badge--top-right {
  top: var(--ai-badge-inset);
  right: var(--ai-badge-inset);
}
