/* Masonry */
.masonry {
    columns: 3;
    column-gap: 1rem;
}

@media(max-width:900px) {
    .masonry {
        columns: 2;
    }
}

@media(max-width:520px) {
    .masonry {
        columns: 1;
    }
}

.masonry-item {
    break-inside: avoid;
    margin-bottom: 1rem;
    border-radius: 14px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
}

.masonry-item img,
.masonry-item .img-placeholder {
    display: block;
    width: 100%;
    transition: transform .5s ease;
}

.masonry-item:hover .img-placeholder,
.masonry-item:hover img {
    transform: scale(1.05);
}

.masonry-item .overlay {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity .3s;
    background: linear-gradient(to top, rgba(58, 46, 30, .85) 0%, transparent 55%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1.25rem;
}

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

.masonry-item.hidden-item {
    display: none;
}

/* Lightbox */
#lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999;
    background: rgba(18, 10, 4, .94);
    backdrop-filter: blur(16px);
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 1rem;
}

#lightbox.open {
    display: flex;
}

#lightbox .lb-img-wrap {
    position: relative;
    max-width: 90vw;
    max-height: 80vh;
}

#lightbox .lb-img-wrap .placeholder-view {
    max-width: 90vw;
    max-height: 80vh;
    min-width: 320px;
    min-height: 220px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Playfair Display', serif;
    font-size: 5rem;
    font-weight: 800;
}

#lightbox .lb-caption {
    text-align: center;
}

#lb-prev,
#lb-next {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(217, 170, 114, .3);
    background: rgba(250, 246, 239, .08);
    backdrop-filter: blur(8px);
    color: #f4ede0;
    cursor: pointer;
    font-size: 1rem;
    display: grid;
    place-items: center;
    z-index: 1000;
}

#lb-prev {
    left: 1.5rem;
}

#lb-next {
    right: 1.5rem;
}

#lb-close {
    position: fixed;
    top: 1.25rem;
    right: 1.5rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(217, 170, 114, .25);
    background: rgba(250, 246, 239, .08);
    color: #f4ede0;
    cursor: pointer;
    font-size: 1rem;
    display: grid;
    place-items: center;
    z-index: 1000;
}

/* Filter pills */
.filter-btn {
    transition: all .2s;
}

.filter-btn.active {
    background: #b8652a;
    color: #ffffff;
    border-color: #b8652a;
}

/* Fade in */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity .6s ease, transform .6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: none;
}