.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin: 1em 0;
}

.gallery-cols-1 {
    grid-template-columns: 1fr;
    justify-items: center;
}

.gallery-cols-1 .gallery-item {
    max-width: 60%;
}

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

.gallery-item img {
    width: auto;
    max-width: 100%;
    height: auto;
    display: block;
    border: 1px solid #ccc;
    cursor: pointer;
}

.gallery-item img:hover {
    border-color: #777;
}

@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 500px) {
    .gallery-grid {
        grid-template-columns: 1fr;
    }
}

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

.lightbox:target {
    display: flex;
}

.lightbox img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
}

p > img {
    display: block;
    margin-left: auto;
    margin-right: auto;
}
