/* =====================================================
   FIX GALERI DESA BERANDA - FOTO TIDAK CROP
   Foto mengikuti rasio asli, khususnya saat foto hanya satu.
===================================================== */

section:has(.gallery-grid-soft) {
    text-align: center !important;
}

section:has(.gallery-grid-soft) .section-head-soft {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

section:has(.gallery-grid-soft) .section-head-soft > div {
    width: 100% !important;
    text-align: center !important;
}

section:has(.gallery-grid-soft) .home-title,
section:has(.gallery-grid-soft) .home-desc {
    text-align: center !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Tombol lihat foto lebih banyak tetap tengah */
section:has(.gallery-grid-soft) .more-soft {
    margin-left: auto !important;
    margin-right: auto !important;
    text-align: center !important;
}

/* Grid galeri */
.gallery-grid-soft {
    display: grid !important;
    justify-content: center !important;
    align-items: start !important;
    gap: 18px !important;
}

/* Kalau hanya 1 foto, posisikan di tengah */
.gallery-grid-soft:has(.gallery-card-soft:only-child) {
    grid-template-columns: minmax(300px, 640px) !important;
}

/* Foto tunggal tidak dipaksa tinggi tetap */
.gallery-grid-soft .gallery-card-soft:only-child {
    width: 100% !important;
    max-width: 640px !important;
    height: auto !important;
    min-height: unset !important;
    aspect-ratio: auto !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding: 0 !important;
    overflow: hidden !important;
    background: transparent !important;
    border-radius: 18px !important;
    box-shadow: 0 18px 45px rgba(15, 23, 42, .10) !important;
}

/* Gambar mengikuti ukuran asli, tidak crop */
.gallery-grid-soft .gallery-card-soft:only-child img {
    width: 100% !important;
    height: auto !important;
    max-height: none !important;
    min-height: unset !important;
    object-fit: contain !important;
    object-position: center center !important;
    display: block !important;
    border-radius: 18px !important;
}

/* Kalau foto lebih dari satu, tetap rapi tapi tidak terlalu crop */
.gallery-grid-soft .gallery-card-soft {
    overflow: hidden !important;
    border-radius: 18px !important;
}

.gallery-grid-soft .gallery-card-soft img {
    object-position: center center !important;
}

/* Mobile */
@media (max-width: 900px) {
    .gallery-grid-soft {
        grid-template-columns: 1fr !important;
    }

    .gallery-grid-soft .gallery-card-soft:only-child {
        max-width: 100% !important;
    }

    .gallery-grid-soft .gallery-card-soft:only-child img {
        width: 100% !important;
        height: auto !important;
    }
}