/* Reset & base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background: #f4f4f4;
    color: #333;
}

header {
    text-align: center;
    padding: 20px;
}

/* Filters buttons */
.filters {
    text-align: center;
    margin-bottom: 20px;
}

.filters button {
    padding: 10px 15px;
    margin: 0 5px;
    border: none;
    background: #ddd;
    cursor: pointer;
    transition: background 0.3s, color 0.3s;
}

.filters button.active,
.filters button:hover {
    background: #333;
    color: #fff;
}

/* Gallery Grid (Masonry) */
.gallery.masonry {
    column-width: 250px;
    column-gap: 15px;
    padding: 0 20px 40px;
}

.gallery-item {
    break-inside: avoid;
    margin-bottom: 15px;
    overflow: hidden;
    position: relative;
}

.gallery-item img {
    width: 100%;
    display: block;
    opacity: 0;
    transition: opacity 0.5s ease, transform 0.4s ease, filter 0.4s ease;
    cursor: pointer;
}

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

/* Hover effects */
.gallery-item img:hover {
    transform: scale(1.05);
    filter: brightness(1.1);
}

/* Lightbox styles */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.lightbox.show {
    display: flex;
}

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

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

.lightbox .nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #fff;
    font-size: 60px;
    padding: 10px 20px;
    cursor: pointer;
    user-select: none;
}

.lightbox .prev {
    left: 30px;
}

.lightbox .next {
    right: 30px;
}

/* Responsive tweaks */
@media (max-width: 600px) {
    .filters button {
        padding: 8px 12px;
        margin: 0 3px;
    }

    .lightbox .nav {
        font-size: 40px;
        padding: 8px 14px;
    }

    .lightbox .close {
        font-size: 30px;
        top: 20px;
        right: 25px;
    }
}