/* ====== LAYANAN UMUM SECTION ====== */
.layanan-umum-container {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: flex-start;
    flex-wrap: nowrap;
    gap: 30px;
    margin: 80px auto;

    /* --- REVISI DI BAWAH --- */
    /* Kita hapus max-width & padding agar lebarnya diatur 
       oleh parent <div class="container"> di home.blade.php */
    width: 100%; 
    /* max-width: 1350px; <-- DIHAPUS (INI PENYEBAB MASALAH) */
    /* padding: 0 20px;   <-- DIHAPUS */
    /* --- AKHIR REVISI --- */

    box-sizing: border-box; 
    overflow-x: hidden; /* Tetap di sini sebagai jaring pengaman */
}

/* ====== SIDEBAR ====== */
.layanan-umum-sidebar {
    width: calc((100% - 60px) * 0.15);
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.card-layanan-umum {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
    height: 140px;
    border-bottom: 1px solid #eee;
    transition: 0.3s ease;
    cursor: pointer;
    color: #146A0E;
    background: #fff;
}

.card-layanan-umum i {
    font-size: 32px;
    margin-bottom: 10px;
    color: #00b300;
}

.card-layanan-umum:hover,
.card-layanan-umum.active {
    background-color: #146A0E;
    color: #CAF8BF;
}
.card-layanan-umum:hover i,
.card-layanan-umum.active i {
    color: #CAF8BF;
}

/* ====== VIEW ALL BUTTON ====== */
.view-all {
    background-color: #146A0E;
    color: #fff;
    padding: 12px 0;
    text-align: center;
}
.view-all a {
    color: #CAF8BF;
    text-decoration: none;
    font-weight: 600;
    transition: 0.3s;
}
.view-all:hover {
    background-color: #CAF8BF;
}
.view-all:hover a {
    color: #146A0E;
}

/* ====== CONTENT ====== */

/* Saya hapus rule .layanan-umum-content-container 
   karena sepertinya tidak terpakai dan duplikat 
   dari .layanan-umum-container 
*/

.layanan-umum-content {
    width: calc((100% - 60px) * 0.55);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 20px;
    padding: 10px 20px;
    
    /* Tambahkan transisi ke selector utama */
    transition: opacity 0.4s ease, transform 0.3s ease;
}

.layanan-umum-content h1 {
    color: #146A0E;
    font-size: 24px;
    margin-bottom: 5px;
    text-align: left;
}
.layanan-umum-content p {
    color: #146A0E;
    line-height: 1.7;
    text-align: justify;
}

/* ====== ICON DI CARD LAYANAN UMUM ====== */
.layanan-umum-icon {
    width: 48px;
    height: 48px;
    object-fit: contain;
    margin-bottom: 10px;
    transition: transform 0.2s ease;
}

.card-layanan-umum:hover .layanan-umum-icon,
.card-layanan-umum.active .layanan-umum-icon {
    transform: scale(1.1);
    /* Warna ikon saat hover (#CAF8BF) */
    filter: brightness(0) saturate(100%) invert(97%) sepia(3%) saturate(2203%) hue-rotate(33deg) brightness(100%) contrast(90%);
}


/* ====== PICTURE SECTION ====== */
.layanan-umum-picture {
    width: calc((100% - 60px) * 0.30);
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.image-container {
    position: relative;
    width: 100%;
}

.image-container img {
    width: 100%;
    height: 260px;
    object-fit: cover;
    border-radius: 8px;
    display: block;
}

.image-container::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 8px;
    background: linear-gradient(to right, #00b300 18%, #146A0E 18%, #146A0E 80%, #CAF8BF 80%);
    border-radius: 0 0 8px 8px;
}

.gallery-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.gallery-grid img {
    width: calc(33.333% - 10px);
    height: 90px;
    object-fit: cover;
    border-radius: 5px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-grid img:hover {
    transform: scale(1.05);
    box-shadow: 0 3px 10px rgba(0,0,0,0.15);
}

/* ====== RESPONSIVE ====== */
@media (max-width: 992px) {
    .layanan-umum-container {
        flex-direction: column;
        align-items: center;
        max-width: 95%; /* Ini OK karena di dalam media query */
    }
    .layanan-umum-sidebar,
    .layanan-umum-content,
    .layanan-umum-picture {
        width: 100%; /* Ini OK */
    }
    .layanan-umum-content {
        order: 3;
    }
}


/* ====== TRANSITION EFFECT (fade in / out) ====== */
.fade-out {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.fade-in {
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* ====== LOADING SPINNER DI GAMBAR ====== */
.image-container.loading::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 42px;
    height: 42px;
    border: 4px solid rgba(0, 179, 0, 0.3);
    border-top-color: #00b300;
    border-radius: 50%;
    animation: spinLayanan 1s linear infinite;
    transform: translate(-50%, -50%);
    z-index: 2;
}

@keyframes spinLayanan {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Saat gambar loading, sembunyikan dulu */
.image-container.loading img {
    opacity: 0.3;
    filter: blur(2px);
    transition: opacity 0.3s ease, filter 0.3s ease;
}

/* Saat gambar sudah tampil (fade in) */
.image-container img.visible {
    opacity: 1;
    filter: none;
    transition: opacity 0.4s ease, filter 0.4s ease;
}

/* ====== SMOOTH TRANSITION UNTUK KONTEN ====== */
.layanan-umum-content.fade-out {
    opacity: 0;
    transform: translateY(10px);
}

.layanan-umum-content.fade-in {
    opacity: 1;
    transform: translateY(0);
}

/* ===== LIGHTBOX STYLING ===== */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    overflow: hidden;
    animation: fadeIn 0.25s ease;
}

.lightbox-content img {
    max-width: 95vw;
    max-height: 95vh;
    border-radius: 10px;
    box-shadow: 0 0 25px rgba(255, 255, 255, 0.3);
    object-fit: contain;
    cursor: zoom-out;
}