/* AI-label op afbeeldingen - zie inc/ai-image-label.php */

/* Wrapper die het JS rond elke <img> (of <picture>) legt.
   inline-block + line-height:0 houdt de layout zo dicht mogelijk bij de originele img. */
.ai-img-wrap {
    position: relative;
    display: inline-block;
    max-width: 100%;
    vertical-align: top;
    line-height: 0;
}

/* De chip zelf. Eigen achtergrond -> blijft altijd leesbaar op gelijk welk beeld. */
.ai-img-label {
    position: absolute;
    z-index: 5;
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 999px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 11px;
    font-weight: 500;
    line-height: 1;
    letter-spacing: 0.03em;
    color: rgba(255, 255, 255, 0.78);
    background: rgba(13, 22, 18, 0.40);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.16);
    backdrop-filter: blur(5px) saturate(1.05);
    -webkit-backdrop-filter: blur(5px) saturate(1.05);
    pointer-events: none;
    -webkit-user-select: none;
    user-select: none;
    transition: background-color 0.18s ease, color 0.18s ease;
}

/* Label met eigen tekst (gekozen in de Mediabibliotheek): mag over 2 regels, blijft binnen het beeld */
.ai-img-label.ai-img-label--tekst {
    max-width: calc(100% - 16px);
    white-space: normal;
    line-height: 1.25;
    letter-spacing: 0;
    text-align: left;
    border-radius: 10px;
    padding: 4px 9px;
}

/* Hoekposities */
.ai-img-wrap.ai-pos-br .ai-img-label { right: 8px;  bottom: 8px; }
.ai-img-wrap.ai-pos-bl .ai-img-label { left: 8px;   bottom: 8px; }
.ai-img-wrap.ai-pos-tr .ai-img-label { right: 8px;  top: 8px; }
.ai-img-wrap.ai-pos-tl .ai-img-label { left: 8px;   top: 8px; }

/* Auto-contrast: op een licht beeldgedeelte -> donkere chip op lichte pil. */
.ai-img-wrap.ai-on-light .ai-img-label {
    color: rgba(11, 26, 20, 0.68);
    background: rgba(255, 255, 255, 0.55);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.10);
}

/* Enkel voor schermlezers */
.ai-img-label .ai-img-label__sr {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

@media (prefers-reduced-motion: reduce) {
    .ai-img-label { transition: none; }
}
