/* Container Lightbox Utama (Overlay Gelap) */
.image-lightbox {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background-color: rgba(0, 0, 0, 0.75);
}

.image-lightbox.is-open {
    display: flex;
}

/* Card Lightbox Putih dengan Border Radius Besar */
.lightbox-card {
    position: relative;
    background: #ffffff;
    border-radius: 16px;
    /* Hilangkan overflow: hidden pada card agar border-radius dikontrol masing-masing elemen */
    overflow: visible; 
    display: table;
    width: auto;
    max-width: 90vw;
    max-height: 90vh;
    margin: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* Tombol Close */
.lightbox-close {
    position: absolute;
    top: 12px;
    right: 16px;
    z-index: 10;
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    color: #ffffff;
    font-size: .85rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s ease;
    display: none;
}

.lightbox-close:hover {
    background: #e51d27;
    display: none;
}

/* Area Gambar - Menyesuaikan Otomatis Tanpa Terpotong */
.lightbox-figure {
    margin: 0;
    padding: 0;
    width: 100%;
    background: transparent;
    display: block;
    line-height: 0; /* Menghilangkan gap bawah gambar */
}

/* Gambar Utuh 100% Sesuai Aspect Ratio (TIDAK TERPOTONG) */
.lightbox-figure img {
    display: block;
    max-width: 90vw;
    max-height: calc(85vh - 70px);
    width: auto;
    height: auto;
    
    /* Lengkungan: [Atas-Kiri] [Atas-Kanan] [Bawah-Kanan] [Bawah-Kiri] */
    border-radius: 16px 16px 0 0;
}

/* Footer Navigasi Bawah */
.lightbox-footer {
    position: relative;
    display: table-caption;
    caption-side: bottom;
    padding: 10px 16px;
    background: #ffffff;
    box-sizing: border-box;
    
    /* Lengkungan: [Atas-Kiri] [Atas-Kanan] [Bawah-Kanan] [Bawah-Kiri] */
    border-radius: 0 0 16px 16px;
    overflow: hidden;
}

.lightbox-footer-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

/* Ornamen Stroke / Pattern di Sebelah Kanan */
.lightbox-footer::before {
    content: "";
    position: absolute;
    top: 50%;
    right: 0; /* Sesuaikan agar tetap berada di batas dalam footer */
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    background-image: url("/assets/global/images/stroke2.webp");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center right;
    pointer-events: none;
    z-index: 1;
}

/* Wrapper Caption & Garis Merah */
.lightbox-caption-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 0 12px;
    flex: 1;
    min-width: 0; /* Memaksa teks bungkus/wrap ke bawah jika panjang */
}

.caption-divider {
    width: 36px;
    height: 3px;
    background-color: #e51d27; /* Garis merah indikator */
    border-radius: 2px;
}

.lightbox-caption {
    color: #333333;
    font-size: 0.8rem;
    font-weight: 700;
    text-align: center;
    width: 100%;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
}
.lightbox-caption p {
    margin: 0;
    display: inline;
}

/* Tombol Navigasi Bulat Abu-Abu */
.lightbox-btn {
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: #e0e0e0;
    color: #ffffff;
    font-size: 0.8rem;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.lightbox-btn:hover {
    background: #e51d27;
    color: #ffffff;
}


/* Pastikan konten di dalam footer berada di atas ornamen (z-index lebih tinggi) */
.lightbox-btn,
.lightbox-caption-wrapper {
    position: relative;
    z-index: 2;
}

/* Responsif untuk Layar Seluler / HP */
@media (max-width: 576px) {
    .lightbox-card {
        border-radius: 16px;
        max-width: 95vw;
    }

    .lightbox-figure img {
        max-height: calc(75vh - 60px);
    }

    .lightbox-footer {
        padding: 5px 14px;
    }

    .lightbox-caption {
        font-size: 0.75rem;
    }
}