[data-sdc-component="arts_components:single-image-block"],
.single-image-block {
    img {
        display: block;
        max-width: 100%;
        height: auto;
    }
    
    > div > div {
        line-height: 0;
        font-size: 0;
    }
    
    .image-placeholder {
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 200px;
        background: #f5f5f5;
        border: 2px dashed #ccc;
        border-radius: 8px;
        color: #666;
        font-size: 16px;
        line-height: 1.4;
        padding: 20px;
        text-align: center;
    }
    
    .single-image-link {
        display: inline-block;
        line-height: 0;
        
        &:hover img {
            opacity: 0.9;
            transition: opacity 0.2s ease;
        }
    }
}

.bordered {
    border-radius: 20px;
    border: 10px solid #f5f3f2;
    overflow: hidden;
    background: #f5f3f2;
    display: inline-block;
    width: fit-content;
    max-width: 100%;
    line-height: 0;
    
    img {
        display: block;
        max-width: 100%;
        height: auto;
    }
    
    > div {
        display: block;
        line-height: 0;
    }
}

/* Alignment options */
.single-image-block--center {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.single-image-block--center > div:first-child {
    display: inline-block;
    text-align: left; /* Reset text-align for content inside */
}

.single-image-block--center .bordered {
    display: inline-block;
}

.single-image-block--left {
    display: flex;
    justify-content: flex-start;
    text-align: left;
}

.single-image-block--left > div:first-child {
    display: inline-block;
}

.single-image-block--right {
    display: flex;
    justify-content: flex-end;
    text-align: right;
}

.single-image-block--right > div:first-child {
    display: inline-block;
}

/* Ensure centering works in editing mode (block-wrapper) */
.block-wrapper:has(.single-image-block--center),
.block-wrapper .single-image-block--center {
    display: flex;
    justify-content: center;
}

.block-wrapper:has(.single-image-block--center) {
    width: auto !important;
    margin-left: auto !important;
    margin-right: auto !important;
    display: flex !important;
    justify-content: center !important;
}

/* Fallback for browsers that don't support :has() */
.block-wrapper[style*="width: auto"] .single-image-block--center {
    display: flex;
    justify-content: center;
}