/* Layout Justified / Flex Masonry */
.aikg-justified-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.aikg-gallery-item {
    /* Menerima tinggi dari shortcode, jika tidak diisi otomatis 250px */
    height: var(--row-height, 250px); 
    flex-grow: 1;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    border-radius: 4px;
}

.aikg-gallery-item img {
    max-width: 100%;
    min-width: 100%;
    height: 100%;
    object-fit: cover;
    vertical-align: bottom;
    transition: transform 0.3s ease;
}

.aikg-gallery-item:hover img {
    transform: scale(1.05);
}

/* Caption (Poin 4) */
.aikg-caption {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    background: rgba(0,0,0,0.5);
    color: #fff;
    padding: 15px 10px 10px 10px;
    font-size: 14px;
    font-weight: bold;
}

/* Modal Popup (Poin 3) */
.aikg-modal {
    position: fixed;
    z-index: 99999;
    left: 0; top: 0; width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.aikg-modal-content {
    width: 80%;
    max-width: 800px;
}

.aikg-modal-content #aikg-modal-title {
    font-size: 2rem;
}

.aikg-close {
    position: absolute;
    top: 20px; right: 35px;
    color: #f1f1f1; font-size: 40px; font-weight: bold;
    cursor: pointer;
}

/* Carousel Media Sizing */
.aikg-media-box {
    width: 100%;
    height: 450px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.aikg-media-box img, .aikg-media-box video {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Khusus Layar HP / Mobile */
@media screen and (max-width: 480px) {
    .aikg-gallery-item {
        /* Memaksa tinggi gambar menjadi maksimal 180px di HP agar tidak terlalu jangkung */
        height: 180px !important; 
    }
    .aikg-modal-content {
        width: 95%; /* Memperlebar area carousel popup di HP agar lebih puas dilihat */
    }
	.aikg-modal-content #aikg-modal-title {
		font-size: 90%;
	}
    .aikg-media-box {
        height: 300px; /* Menyesuaikan tinggi box carousel di layar HP */
    }
}