.gallery-section {
    padding: 72px 0 96px;
    background: var(--black);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 280px;
    grid-auto-flow: dense;
    gap: 10px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius);
    background: #1c1c1c;
    transition: opacity 0.55s ease, transform 0.55s ease;
    transition-delay: var(--gallery-delay, 0s);
}

.js .gallery-item {
    opacity: 0;
    transform: translateY(36px);
}

.js .gallery-item.is-visible {
    opacity: 1;
    transform: none;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.45s ease;
}

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

.gallery-item:nth-child(1) {
    grid-column: span 2;
    grid-row: span 2;
}

.gallery-item:nth-child(5)  { grid-column: span 2; }
.gallery-item:nth-child(12) { grid-column: span 2; }
.gallery-item:nth-child(19) { grid-column: span 2; }
.gallery-item:nth-child(23) { grid-column: span 2; }

.gallery-item:nth-child(8)  { grid-row: span 2; }
.gallery-item:nth-child(15) { grid-row: span 2; }
.gallery-item:nth-child(21) { grid-row: span 2; }

.site-footer{
    margin-top: 0;
}

@media (max-width: 960px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
        grid-auto-rows: 240px;
        grid-auto-flow: dense;
    }

    .gallery-item:nth-child(1) {
        grid-column: span 2;
        grid-row: span 2;
    }

    .gallery-item:nth-child(5),
    .gallery-item:nth-child(12),
    .gallery-item:nth-child(19),
    .gallery-item:nth-child(23) { grid-column: span 2; }

    .gallery-item:nth-child(8),
    .gallery-item:nth-child(15),
    .gallery-item:nth-child(21) { grid-row: span 2; }
}

@media (max-width: 600px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 180px;
        grid-auto-flow: dense;
        gap: 8px;
        padding: 0 14px;
    }

    .gallery-item:nth-child(n) {
        grid-column: span 1;
        grid-row:    span 1;
    }

    .gallery-item:nth-child(1)  { grid-column: span 2; grid-row: span 2; }
    .gallery-item:nth-child(6)  { grid-column: span 2; }
    .gallery-item:nth-child(13) { grid-column: span 2; }
    .gallery-item:nth-child(20) { grid-column: span 2; }
}
