/* --- Gallery Section Styles --- */
.gallery-section {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    width: 100%;
}

/* Gallery Container using CSS Grid */
.gallery-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 200px;
    gap: 10px;
    width: 100%;
    max-width: 1200px;
}

/* Base styles for grid items */
.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 4px;
    background-color: #222;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* --- ORIENTATION STYLES (Desktop / Default) --- */

/* Horizontal items span 2 columns and 1 row */
.gallery-item.horizontal {
    grid-column: span 2;
    grid-row: span 2;
}

/* Vertical items span 1 column and 2 rows */
.gallery-item.vertical {
    grid-column: span 1;
    grid-row: span 2;
}

/* --- RESPONSIVE MOBILE VIEW --- */
@media screen and (max-width: 768px) {
    .gallery-container {
        grid-template-columns: repeat(2, 1fr); /* 2 columns on tablets/large phones */
        grid-auto-rows: 180px;
    }

    /* Adjust spans for mobile layout flow */
    .gallery-item.horizontal {
        grid-column: span 2; /* Full width for horizontal items on mobile */
        grid-row: span 2;
    }

    .gallery-item.vertical {
        grid-column: span 1; 
        grid-row: span 2;
    }
}

@media screen and (max-width: 480px) {
    .gallery-container {
        grid-template-columns: 1fr; /* Single column on small mobile screens */
        grid-auto-rows: 220px;
    }

    /* On small mobile, everything flows in a single stack */
    .gallery-item.horizontal,
    .gallery-item.vertical {
        grid-column: span 2 !important;
        grid-row: span 2 !important;
    }
}