.gallery {
    padding: 10px 20px;
    max-width: 1200px;
    margin: auto;
}

.gallery h1 {
    font-size: 2em;
    margin-bottom: 20px;
    border-bottom: 1px solid #444;
    padding-bottom: 10px;
    color: white;
    text-align: center;
}

/* Collage-style layout (desktop/tablet) */
.gallery-scroll {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.gallery-scroll img {
    border-radius: 8px;
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s ease;
    flex-grow: 1;
}

/* Collage variation */
.gallery-scroll img:nth-child(3n) {
    width: 48%;
    height: 250px;
}
.gallery-scroll img:nth-child(4n) {
    width: 30%;
    height: 180px;
}
.gallery-scroll img:nth-child(5n) {
    width: 60%;
    height: 300px;
}
.gallery-scroll img:not(:nth-child(3n), :nth-child(4n), :nth-child(5n)) {
    width: 32%;
    height: 200px;
}

/* Hover effect */
.gallery-scroll img:hover {
    transform: scale(1.03);
}

/* Responsive layout: Mobile phones */
@media (max-width: 768px) {
    .gallery-scroll {
        flex-wrap: wrap-reverse;         /* stack images vertically */
        flex-direction: column;  /* vertical stacking */
        gap: 10px;
        overflow-x: hidden;      /* prevent horizontal scroll */
        justify-content: center; /* center images horizontally */
    }

    .gallery-scroll img {
        width: 90% !important;   /* almost full width */
        height: auto !important; /* maintain aspect ratio */
        flex: 0 0 auto;
        display: block;
        margin: 0 auto;          /* center each image */
    }
}
