.poesibao-framing-fit {
    position: absolute;
    inset: 0;
    overflow: hidden;
    container-type: size;
    background: var(--wp--preset--color--contrast, #262626);
}

.uagb-post__image .poesibao-framing-fit {
    /* Teinte du voile de la grille historique. */
    background-color: #303d30;
}

.wp-block-cover .poesibao-framing-fit {
    background-color: inherit;
}

:is(.uagb-post__image, .wp-block-cover, .poesibao-framing-sample) .poesibao-framing-fit > img[data-poesibao-fit-photo] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    max-width: none;
    max-height: none;
    object-fit: contain;
    object-position: var(--poesibao-x) var(--poesibao-y);
    transform: none;
}

@supports (width: 1cqw) and (container-type: size) {
    :is(.uagb-post__image, .wp-block-cover, .poesibao-framing-sample) .poesibao-framing-fit > img[data-poesibao-fit-photo="sized"] {
        /* Blend the two native scales using the card's actual width and height. */
        --poesibao-width-at-card-height: calc(100cqh * var(--poesibao-ratio));
        --poesibao-contain: min(100cqw, var(--poesibao-width-at-card-height));
        --poesibao-cover: max(100cqw, var(--poesibao-width-at-card-height), var(--poesibao-native-width, 0px));
        --poesibao-width: calc(var(--poesibao-contain) * (1 - min(1, var(--poesibao-fit))) + var(--poesibao-cover) * var(--poesibao-fit));
        inset: var(--poesibao-y) auto auto var(--poesibao-x);
        width: var(--poesibao-width);
        height: calc(var(--poesibao-width) / var(--poesibao-ratio));
        transform: translate(calc(-1 * var(--poesibao-x)), calc(-1 * var(--poesibao-y)));
    }
}
