.gallery-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px;
}

.gallery-grid {
    column-count: 4;
    column-gap: 15px;
}

.gallery-item {
    position: relative;
    margin-bottom: 15px;
    break-inside: avoid;
    border-radius: 8px;
    overflow: hidden;
    background-color: #f0f0f0;
    contain: paint;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease, opacity 0.5s ease;
    opacity: 0; /* Start invisible for loading animation */
}

.gallery-item img.loaded {
    opacity: 1;
}

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

.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 15px;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        rgba(0, 0, 0, 0.1) 40%,
        rgba(0, 0, 0, 0.6) 80%
    );
    color: white;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.overlay-title {
    font-size: 1rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.overlay-category {
    font-size: 0.9rem;
    opacity: 0.8;
}

.gallery-item.small {
    height: 200px;
}
.gallery-item.medium {
    height: 300px;
}
.gallery-item.large {
    height: 400px;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    padding-top: 60px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
}

.modal-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 80%;
}

#caption {
    margin: auto;
    display: block;
    width: 80%;
    text-align: center;
    color: #ccc;
    padding: 10px;
}

.close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
}

.close:hover,
.close:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

/* Responsive masonry layout */
@media (max-width: 1200px) {
    .gallery-grid {
        column-count: 3;
    }
}

@media (max-width: 800px) {
    .gallery-grid {
        column-count: 2;
    }
}

@media (max-width: 500px) {
    .gallery-grid {
        column-count: 1;
    }
}

/* Mobile modal adjustments */
@media (max-width: 480px) {
    .modal-content {
        max-width: 95%;
        max-height: 80%;
    }
}

/* Navbar overrides */
.page-light .navbar-nav .nav-link {
    color: #611919;
}

.no-scroll-navbar .my-navbar.scrolled {
    background-color: transparent !important;
    backdrop-filter: none !important;
    box-shadow: none !important;
}

.no-scroll-navbar .my-navbar.scrolled .nav-link {
    color: #611919 !important;
}

/* nabar khusus */
/* Navbar khusus warna cokelat */
.navbar-coklat .brand-text {
  color: #4F1212 !important;
}

.navbar-coklat .nav-link {
  color:#4F1212!important;
}


.navbar-coklat .nav-link:hover {
  opacity: 0.8;
}