body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f5f5f5;
}

.gallery {
    column-count: 5; /* Set a maximum of 5 columns */
    column-gap: 1em;
    margin: 20px;
    padding: 0;
    list-style: none;
}

.gallery-item {
    break-inside: avoid;
    margin-bottom: 1em;
}

.gallery-item img {
    width: 100%;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s;
}

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

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

.lightbox img {
    max-width: 80%;
    max-height: 80%;
    margin: auto;
    display: block;
    margin-top: 5%;
}

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

.lightbox .prev, .lightbox .next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    padding: 16px;
    margin-top: -22px;
    color: white;
    font-weight: bold;
    font-size: 40px;
    transition: 0.6s ease;
    user-select: none;
}

.lightbox .prev {
    left: 0;
}

.lightbox .next {
    right: 0;
}

@media (max-width: 1200px) {
    .gallery {
        column-count: 4;
    }
}

@media (max-width: 900px) {
    .gallery {
        column-count: 3;
    }
}

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

    .lightbox img {
        margin-top: 55%;
    }
}
