.gallery-section {
    padding: 4rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
}
.section-title {
    width: 100%;
    font-size: 3rem;
    font-weight: 300;
    letter-spacing: 0.1em;
    text-align: center;
    margin: 0;
}

.gallery-header {
    text-align: center;
    margin-bottom: 60px;
}

    .gallery-header h2 {
        font-size: 3rem;
        font-weight: 300;
        letter-spacing: 2px;
        margin-bottom: 15px;
    }

    .gallery-header p {
        font-size: 1.1rem;
        color: #999;
        font-weight: 300;
    }

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    grid-auto-rows: 250px;
    gap: 20px;
    grid-auto-flow: dense;
    width: 100%;
    margin: 0 auto;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    border-radius: 4px;
    box-shadow: 8px 8px 10px rgba(0, 0, 0, 0.40);
}

    .gallery-item::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,.9) 75%);
        opacity: 0;
        transition: opacity 0.4s ease;
        z-index: 1;
    }

    .gallery-item:hover::before {
        opacity: 1;
    }

    .gallery-item img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: transform 0.6s ease, filter 0.6s ease;
    }

.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2rem;
    transform: translateY(100%);
    transition: transform 0.4s ease;
    z-index: 2;
}

.gallery-item:hover .gallery-overlay {
    transform: translateY(0);
}

.gallery-overlay h3 {
    font-size: 1.5rem;
    font-weight: 400;
    margin-bottom: 8px;
}

.gallery-overlay p {
    font-size: 0.95rem;
    color: #ccc;
    font-weight: 300;
}

/* Mosaic sizing based on aspect ratio */
.gallery-item[data-aspect-ratio] {
    grid-row-end: auto;
}

/* Taller images (portrait) */
.gallery-item[data-aspect-ratio="portrait"] {
    grid-row-end: span 2;
}

/* Wider images (landscape) */
.gallery-item[data-aspect-ratio="landscape"] {
    grid-column-end: span 2;
}

/* Square images */
.gallery-item[data-aspect-ratio="square"] {
    grid-column-end: span 1;
}

@media (max-width: 1024px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        grid-auto-rows: 200px;
    }

    .gallery-item[data-aspect-ratio="landscape"] {
        grid-column-end: span 1;
    }
}

@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: auto;
    }

    .gallery-item {
        grid-row-end: auto !important;
        grid-column-end: auto !important;
    }

    .gallery-header h2 {
        font-size: 2rem;
    }
}
