/* Сетка галереи */
.nes-gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.2rem;
    margin-top: 1.5rem;
}

.nes-gallery-grid-item {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.nes-gallery-grid-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
}

.nes-gallery-grid-item img,
.nes-gallery-grid-item video {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    background: #f0f0f0;
}

.nes-gallery-grid-item video {
    background: #222;
}

.nes-gallery-grid-caption {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    color: #444;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: #fafafa;
    border-top: 1px solid #f0f0f0;
}

/* Адаптивность сетки */
@media (max-width: 1199px) {
    .nes-gallery-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }
    .nes-gallery-grid-item img,
    .nes-gallery-grid-item video {
        height: 180px;
    }
}
@media (max-width: 767px) {
    .nes-gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
    }
    .nes-gallery-grid-item img,
    .nes-gallery-grid-item video {
        height: 160px;
    }
}
@media (max-width: 479px) {
    .nes-gallery-grid {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }
    .nes-gallery-grid-item img,
    .nes-gallery-grid-item video {
        height: 200px;
    }
}