/* ===============================
   GRID
================================ */
.ecg-gallery.grid {
    display: grid;
    gap: var(--gap);
    grid-template-columns: repeat(var(--columns-desktop), 1fr);
}

/* Tablet */
@media (max-width:1024px){
    .ecg-gallery.grid {
        grid-template-columns: repeat(var(--columns-tablet), 1fr);
    }
}

/* Mobile */
@media (max-width:767px){
    .ecg-gallery.grid {
        grid-template-columns: repeat(var(--columns-mobile), 1fr);
    }
}

/* ===============================
   MASONRY
================================ */
.ecg-gallery.masonry {
    column-count: 3;
    column-gap: var(--gap);
}

.ecg-gallery.masonry .ecg-item {
    break-inside: avoid;
    margin-bottom: var(--gap);
}

/* ===============================
   RATIO (ADAPT KA STYLE)
================================ */
.ecg-item {
        position: relative;
    overflow: hidden;
    cursor: pointer;
    background-color: #1a1a1a;
    outline-offset: 2px;
}

/* Ratio control */
.ecg-gallery[data-ratio="1:1"] .ecg-item {
    aspect-ratio: 1 / 1;
}

.ecg-gallery[data-ratio="4:3"] .ecg-item {
    aspect-ratio: 4 / 3;
}

.ecg-gallery[data-ratio="16:9"] .ecg-item {
    aspect-ratio: 16 / 9;
}

/* ===============================
   IMAGE (KA STYLE FIX)
================================ */
.ecg-item img {
    display: block;
        width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;

    transition: opacity 0.2s ease, transform 0.3s ease;
}

/* OPTIONAL HOVER EFFECT (BIAR PREMIUM) */
.ecg-item:hover img {
    transform: scale(1.05);
}

/* ===============================
   LIGHTBOX
================================ */
.ecg-lightbox {
    display: none;
    position: fixed;
    z-index: 9999;
    inset: 0;
    background: rgba(0,0,0,0.85);
    justify-content: center;
    align-items: center;
}

.ecg-lightbox-img {
    max-width: 90%;
    max-height: 90%;
}

.ecg-close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 30px;
    color: #fff;
    cursor: pointer;
}

.ecg-prev,
.ecg-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 30px;
    color: #fff;
    cursor: pointer;
    padding: 10px;
}

.ecg-prev { left: 20px; }
.ecg-next { right: 20px; }