/* ============================================================
   ai-label.css — AI disclosure badge on an image
   ============================================================
   The visible disclosure required for AI-generated or AI-edited
   photorealistic images (EU AI Act, article 50). `.ai-image` wraps
   the picture and becomes the positioning context; `.ai-label` is the
   badge in its bottom-right corner.

   Both are added automatically by inc/ai-label.php when an image is
   marked in the media library — you do not place them by hand.

   The badge is live text and a vector icon, NOT burnt into the photo.
   That keeps it crisp at any resolution, and it lets one image file
   serve every language. Full rule and wording:
   _shared/legal/ai-content-labelling.md
   Conventions: _shared/bricks-builder/css-conventions.md

   1. Wrapper
   2. Badge
   3. Icon and text
   4. Dark variant

   Last updated: 2026-10-12 (auto-stamped by the pre-commit hook)
   ============================================================ */


/* ------------------------------------------------------------
   1. Wrapper
   ------------------------------------------------------------ */

/* `container-type` lets the badge scale with the image's own width
   rather than the viewport, so one rule fits a full-width hero and a
   small card image alike. */
.ai-image {
    position: relative;
    display: block;
    container-type: inline-size;
}

.ai-image img {
    display: block;
    inline-size: 100%;
}


/* ------------------------------------------------------------
   2. Badge
   ------------------------------------------------------------
   Everything inside is sized in `em`, so the font-size scales the
   whole badge — icon, padding and corner inset together. 2.6cqi keeps
   it near 8% of image height on the usual landscape crops.

   The plate colour deliberately does NOT use a theme token: it sits on
   a photograph, not on the page, so it must stay light in dark mode
   too. A token would flip it and hide the disclosure.

   The hairline is what makes it read on a near-white backdrop, where
   the plate's edge would otherwise dissolve and the badge would look
   like floating text. Light-mode elevation alone is far too soft for
   that job. ------------------------------------------------------------ */
.ai-label {
    position: absolute;
    inset-block-end: 1.4em;
    inset-inline-end: 1.4em;
    z-index: 1;

    display: flex;
    align-items: center;
    gap: 0.55em;
    margin: 0;                       /* it is a <p> */

    font-size: clamp(0.75rem, 2.6cqi, 1rem);
    font-weight: 600;
    line-height: 1;
    color: color-mix(in srgb, black 92%, transparent);

    padding-block: 0.5em;
    padding-inline: 1em 1.1em;
    border-radius: var(--radius-full);
    background-color: color-mix(in srgb, white 92%, transparent);
    border: var(--border-width-base) solid color-mix(in srgb, black 14%, transparent);
    box-shadow: var(--elevation-2);
}


/* ------------------------------------------------------------
   3. Icon and text
   ------------------------------------------------------------ */

/* The European Commission's own artwork, unchanged. Scale it and swap
   between the official black and white versions — never recolour or
   redraw it. */
.ai-label-icon {
    inline-size: 1.7em;
    block-size: 1.7em;
    flex-shrink: 0;
    background-image: url("../../icons/eu-ai-basic-black.svg");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.ai-label-text {
    white-space: nowrap;
}


/* ------------------------------------------------------------
   4. Dark variant
   ------------------------------------------------------------
   For dark or busy pictures. Contrast decides which one you use — a
   badge that sinks into the photo has disclosed nothing. */
.ai-label--on-dark {
    color: color-mix(in srgb, white 96%, transparent);
    background-color: color-mix(in srgb, black 88%, transparent);
}

.ai-label--on-dark .ai-label-icon {
    background-image: url("../../icons/eu-ai-basic-white.svg");
}
