/*
|--------------------------------------------------------------------------
| Gallery Wrapper
|--------------------------------------------------------------------------
*/

.npg-gallery {
    position: relative;
    width: 100%;
    margin: 0 auto;
}

.npg-gallery * {
    box-sizing: border-box;
}

/*
|--------------------------------------------------------------------------
| Main Slider & Container Setup
|--------------------------------------------------------------------------
*/

.npg-main-slider {
    position: relative;
    overflow: visible; /* Diubah ke visible agar tombol segitiga di luar tidak terpotong */
    padding: 0 60px;   /* Memberikan ruang kosong di kiri & kanan untuk tombol luar */
	width: 110%;
    margin-left: -60px;
}

/* Membatasi swiper agar gambar slider tetap rapi di dalam area padding */
.npg-main-slider .swiper {
    width: 100%;
    overflow: hidden;
    border-radius: 12px;
}

.npg-main-slider .swiper-slide {
    overflow: hidden;
}

.npg-main-slider .swiper-slide a {
    display: block;
    text-decoration: none;
}

.npg-main-slider .swiper-slide img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
}

/*
|--------------------------------------------------------------------------
| Fixed Ratio Option
|--------------------------------------------------------------------------
*/

.npg-ratio-16-9 .swiper-slide img {
    aspect-ratio: 16/9;
}

.npg-ratio-4-3 .swiper-slide img {
    aspect-ratio: 4/3;
}

.npg-ratio-square .swiper-slide img {
    aspect-ratio: 1/1;
}

/*
|--------------------------------------------------------------------------
| Navigation (Pure Triangle Buttons Outside Image)
|--------------------------------------------------------------------------
*/

.npg-prev,
.npg-next,
[class*="npg-prev-"],
[class*="npg-next-"] {
    position: absolute;
    top: 50%;
    z-index: 20;
    width: 20px;       /* Lebar basis segitiga */
    height: 30px;      /* Tinggi segitiga */
    margin-top: -15px; /* Setengah dari tinggi agar pas lurus di tengah vertikal */
    background: white;  /* Warna utama segitiga */
    border: none;
    border-radius: 0;  /* Memastikan bentuk kotak murni sebelum dipotong */
    cursor: pointer;
    transition: all .25s ease;
}

/* Menghapus total simbol panah/karakter bawaan template lama */
.npg-prev:before,
.npg-next:before,
[class*="npg-prev-"]:before,
[class*="npg-next-"]:before {
    display: none !important;
}

/* Memotong elemen menjadi Segitiga Menghadap Kiri (Prev) */
.npg-prev,
[class*="npg-prev-"] {
    left: 15px; /* Jarak dari sisi luar gallery */
    clip-path: polygon(100% 0, 0 50%, 100% 100%);
}

/* Memotong elemen menjadi Segitiga Menghadap Kanan (Next / Seperti Button Play) */
.npg-next,
[class*="npg-next-"] {
    right: 15px; /* Jarak dari sisi luar gallery */
    clip-path: polygon(0 0, 100% 50%, 0 100%);
}

/* Efek Hover (Berubah warna saat disorot kursor) */
.npg-prev:hover,
.npg-next:hover,
[class*="npg-prev-"]:hover,
[class*="npg-next-"]:hover {
    background: #555; /* Warna abu-abu saat di-hover */
}

/*
|--------------------------------------------------------------------------
| Thumbnail Slider
|--------------------------------------------------------------------------
*/

.npg-thumbs {
    margin-top: 15px;
}

.npg-thumbs .swiper-slide {
    cursor: pointer;
    opacity: .5;
    transition: all .25s ease;
}

.npg-thumbs .swiper-slide-thumb-active {
    opacity: 1;
}

.npg-thumbs img {
    width: 100%;
    display: block;
    border-radius: 6px;
    aspect-ratio: 4/3;
    object-fit: cover;
}

/*
|--------------------------------------------------------------------------
| Caption
|--------------------------------------------------------------------------
*/

.npg-caption {
    margin-top: 12px;
    font-size: 14px;
    line-height: 1.6;
}

.npg-caption-title {
    font-weight: 600;
    margin-bottom: 5px;
}

.npg-caption-text {
    opacity: .8;
}

/*
|--------------------------------------------------------------------------
| Counter
|--------------------------------------------------------------------------
*/

.npg-counter {
    position: absolute;
    bottom: 15px;
    right: 65px;
    z-index: 20;
    padding: 8px 14px;
    border-radius: 20px;
    background: rgba(0,0,0,.7);
    color: #fff;
    font-size: 12px;
}

/*
|--------------------------------------------------------------------------
| Grid Gallery
|--------------------------------------------------------------------------
*/

.npg-grid {
    display: grid;
    gap: 15px;
}

.npg-grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.npg-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.npg-grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

.npg-grid img {
    width: 100%;
    display: block;
    border-radius: 10px;
}

/*
|--------------------------------------------------------------------------
| Masonry Gallery
|--------------------------------------------------------------------------
*/

.npg-masonry {
    column-gap: 15px;
}

.npg-masonry-2 {
    columns: 2;
}

.npg-masonry-3 {
    columns: 3;
}

.npg-masonry-4 {
    columns: 4;
}

.npg-masonry-item {
    break-inside: avoid;
    margin-bottom: 15px;
}

.npg-masonry img {
    width: 100%;
    display: block;
    border-radius: 10px;
}

/*
|--------------------------------------------------------------------------
| Property Filter
|--------------------------------------------------------------------------
*/

.npg-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 25px;
}

.npg-filter button {
    border: 1px solid #ddd;
    background: #fff;
    padding: 8px 16px;
    border-radius: 30px;
    cursor: pointer;
    transition: .25s ease;
}

.npg-filter button:hover,
.npg-filter button.active {
    border-color: #111;
}

/*
|--------------------------------------------------------------------------
| Loading
|--------------------------------------------------------------------------
*/

.npg-loading {
    position: relative;
}

.npg-loading:after {
    content: "";
    width: 40px;
    height: 40px;
    border: 3px solid rgba(0,0,0,.15);
    border-top-color: rgba(0,0,0,.8);
    border-radius: 50%;
    animation: npgSpin 1s linear infinite;

    position: absolute;
    left: 50%;
    top: 50%;
    margin-left: -20px;
    margin-top: -20px;
}

@keyframes npgSpin {
    to {
        transform: rotate(360deg);
    }
}

/*
|--------------------------------------------------------------------------
| Mobile & Responsiveness
|--------------------------------------------------------------------------
*/

@media (max-width: 991px) {
    .npg-grid-4 {
        grid-template-columns: repeat(3, 1fr);
    }

    .npg-masonry-4 {
        columns: 3;
    }
}

@media (max-width: 767px) {
    /* Mengurangi ukuran padding & tombol luar pada perangkat mobile/tablet */
    .npg-main-slider {
        padding: 0 45px;
    }

    .npg-prev,
    .npg-next,
    [class*="npg-prev-"],
    [class*="npg-next-"] {
        width: 14px;
        height: 20px;
        margin-top: -10px;
    }

    .npg-prev,
    [class*="npg-prev-"] {
        left: 15px;
    }

    .npg-next,
    [class*="npg-next-"] {
        right: 15px;
    }

    .npg-grid-4,
    .npg-grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }

    .npg-masonry-4,
    .npg-masonry-3 {
        columns: 2;
    }

    .npg-thumbs {
        margin-top: 10px;
    }
}

@media (max-width: 480px) {
    .npg-grid-4,
    .npg-grid-3,
    .npg-grid-2 {
        grid-template-columns: 1fr;
    }

    .npg-masonry-4,
    .npg-masonry-3,
    .npg-masonry-2 {
        columns: 1;
    }

    .npg-counter {
        font-size: 11px;
        padding: 6px 10px;
    }
}

/*
|--------------------------------------------------------------------------
| Custom Hover Lightbox Popup Style
|--------------------------------------------------------------------------
*/
.npg-hover-popup {
	
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 999999 !important;
    display: non !important;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease-in-out;
}
.npg-hover-popup.is-active {
    opacity: 1;
    pointer-events: auto;
}
.npg-popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
}
.npg-popup-img {
    position: relative;
    max-width: 85%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.9);
    transform: scale(0.97);
    transition: transform 0.2s ease-in-out;
}
.npg-hover-popup.is-active .npg-popup-img {
    transform: scale(1);
}