.gallery {
    column-count: var(--gallery-columns, 3);
    column-gap: var(--gallery-gap, 20px);
}

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

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

.gallery-item {
    width: 100%;
    display: inline-block;
    border: 0;
    padding: 0;
    margin: 0 0 var(--gallery-gap, 20px);
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.gallery-item img,
.gallery-item video {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 16px;
    box-shadow: rgba(0, 0, 0, 0.35) 0 8px 20px;
    transition: transform 0.2s ease;
}

.gallery-item:hover img,
.gallery-item:hover video {
    transform: scale(1.01);
}

.gallery-modal__media {
    width: 100%;
    height: auto;
    display: block;
}

.gallery-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999;
    background-color: rgba(0, 0, 0, 0.8);
    padding: 5vh 1.5rem;
}

.gallery-modal.is-open {
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-modal__content {
    background-color: #fefefe;
    padding: 20px;
    border: 1px solid #888;
    width: min(900px, 95vw);
    max-height: 90vh;
    overflow: auto;
    border-radius: 18px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.25);
    animation: show-in 0.3s cubic-bezier(0.19, 1, 0.22, 1) forwards;
}

@keyframes show-in {
    from {
        transform: translateY(50px) scale(0.9);
        opacity: 0;
    }
    to {
        transform: translateY(0px) scale(1);
        opacity: 1;
    }
}

.gallery-modal__close {
    color: #555;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    border: 0;
    background: transparent;
    float: right;
}

.gallery-modal__close:hover,
.gallery-modal__close:focus {
    color: #000;
}
