/* CSS untuk Display Gambar di Halaman Publik (Bootstrap Compatible) */
/* Hanya untuk menampilkan gambar dengan ukuran yang sudah diatur dari admin */

/* Wrapper untuk gambar hasil editor admin */
.image-wrapper {
    margin: 1.5rem 0;
    display: block;
    position: relative;
}

.image-wrapper img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
    box-shadow: 0 8px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
}

.image-wrapper img:hover {
    box-shadow: 0 12px 35px -5px rgba(0, 0, 0, 0.15), 0 15px 15px -5px rgba(0, 0, 0, 0.06);
    transform: translateY(-2px);
}

/* Alignment classes sesuai Bootstrap */
.image-wrapper.text-center {
    text-align: center;
}

.image-wrapper.text-center img {
    margin-left: auto;
    margin-right: auto;
}

.image-wrapper.text-end {
    text-align: right;
}

.image-wrapper.text-end img {
    margin-left: auto;
    margin-right: 0;
}

.image-wrapper.text-start {
    text-align: left;
}

.image-wrapper.text-start img {
    margin-left: 0;
    margin-right: auto;
}

/* Size classes yang ditetapkan dari admin */
.image-wrapper.img-size-small img {
    max-width: 300px;
}

.image-wrapper.img-size-medium img {
    max-width: 500px;
}

.image-wrapper.img-size-normal img {
    max-width: 100%;
}

.image-wrapper.img-size-large img {
    max-width: 800px;
}

/* Content area styling */
.post-content .image-wrapper,
.prose .image-wrapper,
article .image-wrapper {
    margin: 2rem 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .image-wrapper {
        margin: 1rem 0;
    }
    
    .image-wrapper.img-size-small img {
        max-width: 250px;
    }
    
    .image-wrapper.img-size-medium img {
        max-width: 100%;
    }
    
    .image-wrapper.img-size-large img {
        max-width: 100%;
    }
}

/* Fallback untuk gambar tanpa wrapper */
.post-content img:not(.image-wrapper img),
.prose img:not(.image-wrapper img),
article img:not(.image-wrapper img) {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    margin: 1rem 0;
    display: block;
}

/* Support untuk alignment gambar via inline style di paragraf */
.post-content p[style*="text-align: center"] img,
.post-content p[style*="text-align:center"] img,
.prose p[style*="text-align: center"] img,
.prose p[style*="text-align:center"] img,
article p[style*="text-align: center"] img,
article p[style*="text-align:center"] img {
    margin-left: auto;
    margin-right: auto;
    display: block;
}

.post-content p[style*="text-align: right"] img,
.post-content p[style*="text-align:right"] img,
.prose p[style*="text-align: right"] img,
.prose p[style*="text-align:right"] img,
article p[style*="text-align: right"] img,
article p[style*="text-align:right"] img {
    margin-left: auto;
    margin-right: 0;
    display: block;
}

.post-content p[style*="text-align: left"] img,
.post-content p[style*="text-align:left"] img,
.prose p[style*="text-align: left"] img,
.prose p[style*="text-align:left"] img,
article p[style*="text-align: left"] img,
article p[style*="text-align:left"] img {
    margin-left: 0;
    margin-right: auto;
    display: block;
}

/* Support untuk ukuran gambar via inline style max-width */
.post-content p img[style*="max-width: 300px"],
.prose p img[style*="max-width: 300px"],
article p img[style*="max-width: 300px"] {
    max-width: 300px !important;
}

.post-content p img[style*="max-width: 500px"],
.prose p img[style*="max-width: 500px"],
article p img[style*="max-width: 500px"] {
    max-width: 500px !important;
}

.post-content p img[style*="max-width: 800px"],
.prose p img[style*="max-width: 800px"],
article p img[style*="max-width: 800px"] {
    max-width: 800px !important;
}