/* ── Image Badge Block ── */

.image-badge-block {
    margin: 0;
}

.image-badge-wrapper {
    position: relative;
    display: block;
    line-height: 0;
}

.image-badge-wrapper > img:not(.image-badge-icon) {
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;
    border-radius: 4px;
}

/* Badge icon – top-right corner, inside the image */
.image-badge-icon {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 48px;
    height: 48px;
    object-fit: contain;
    z-index: 2;
    pointer-events: none;
}

/* ── Fill container when inside a stretch-aligned column ── */
.wp-block-column.is-vertically-aligned-stretch:has(> .image-badge-block) {
    position: relative;
    min-height: 300px;
}

.wp-block-column.is-vertically-aligned-stretch > .image-badge-block {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    height: 100%;
}

.wp-block-column.is-vertically-aligned-stretch .image-badge-wrapper {
    height: 100%;
}

.wp-block-column.is-vertically-aligned-stretch .image-badge-wrapper > img:not(.image-badge-icon) {
    width: 100% !important;
    height: 100% !important;
    max-height: none !important;
    object-fit: cover !important;
}

/* Placeholder shown in editor when no image is selected */
.image-badge-placeholder {
    background: #f0f0f0;
    border: 2px dashed #ccc;
    border-radius: 4px;
    padding: 40px 20px;
    text-align: center;
    color: #888;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .image-badge-icon {
        width: 36px;
        height: 36px;
        top: 8px;
        right: 8px;
    }
}
