/* Anchor the badge to whatever container directly holds the image,
   works for FSC figures and arbitrary content block layouts alike */
:not(body):not(html):has(> .ai-label-badge),
.ai-label-video-wrapper {
    position: relative;
}

.ai-label-deepfake-warning {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 6px;
    padding: 9px 12px;
    border: 1px solid currentColor;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.45;
    width: 0;
    min-width: 100%;
}

.ai-label-deepfake-warning-icon {
    flex-shrink: 0;
    margin-top: 1px;
}

.ai-label-video-column {
    display: flex;
    flex-direction: column;
}

.ai-label-video-hidden-text {
    height: 0;
    overflow: hidden;
    opacity: 0;
}

.ai-label-video-wrapper--responsive {
    display: block;
    width: 100%;
    overflow: hidden;
}

.ai-label-video-wrapper--inline {
    display: inline-block;
    width: 100%;
}

.ai-label-video-aspect {
    aspect-ratio: 16 / 9;
}

.ai-label-video-media {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.ai-label-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 10;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    line-height: 1;
}

.ai-label-info-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    margin-bottom: 6px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 13px;
    line-height: 1;
    transition: background 0.15s;
    -webkit-appearance: none;
    appearance: none;
}

.ai-label-info-btn:hover,
.ai-label-info-btn:focus-visible {
    background: color-mix(in srgb, var(--ai-label-tooltip-bg, #0f0f0f) 92%, transparent);
}

.ai-label-info-btn:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.ai-label-tooltip {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 100;
    min-width: 240px;
    max-width: 320px;
    padding: 12px 14px;
    font-size: 13px;
    line-height: 1.55;
    border-radius: 5px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.32);
}

.ai-label-tooltip.is-visible,
.ai-label-badge:hover .ai-label-tooltip,
.ai-label-badge:focus-within .ai-label-tooltip {
    display: block;
}

.ai-label-tooltip p {
    font-size: 13px !important;
    line-height: 1.55 !important;
    margin-bottom: 0 !important;
}

.ai-label-tooltip p:last-child {
    margin-bottom: 0;
}

.ai-label-tooltip-title {
    font-weight: 700 !important;
}

.ai-label-tooltip-tool {
    opacity: 0.8;
    font-size: 12px;
}

.ai-label-tooltip-exception {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 12px;
    opacity: 0.8;
}

.ai-label-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

