
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}


img {
    display: block;
}

/*.container {*/
/*    max-width: 150rem;*/
/*    margin: 0 auto;*/
/*    padding: 0 2rem;*/
/*}*/

/*.section {*/
/*    padding: 2rem 0;*/
/*}*/

.section-title {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

/* Gallery Section */

.gallery {
    display: flex;
    flex-wrap: wrap;
    /*margin: -1rem;*/
    font-size: 10px;
}

.gallery-item {
    position: relative;
    flex: 1 0 30rem; /* Increased size */
    margin: 1rem;
    cursor: pointer;
    aspect-ratio: 1 / 1; /* Ensure items are square */
}

.gallery-item:hover .gallery-item-caption,
.gallery-item:focus .gallery-item-caption {
    display: flex;
    justify-content: center;
    align-items: center;
    position: absolute;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(2, 58, 41, 0.63);
}

.gallery-item-caption {
    display: none;
    color: #fff;
    font-size: 1rem;
    font-weight: 300;
    text-align: center;
    padding: 3rem;
}

.gallery-image {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Ensure images cover the box */
    object-position: center; /* Center the image */
}

/* Media Query */

@media screen and (max-width: 40rem) {
    .gallery {
        display: block;
    }

    .gallery-item {
        width: 100%;
        margin: 0 0 2rem 0;
    }
}

/* Grid Support */

@supports (display: grid) {
    .gallery {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); /* Adjusted for larger cards */
        grid-gap: 1.3rem;
    }

    .gallery-item {
        margin: 0;
    }
}
