.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, 170px);
    grid-auto-rows: 200px; /* Set a fixed height for the rows */
    gap: 0; /* Remove gap between grid items */
}

.grid-item {
    display: flex;
    flex-direction: column; /* Ensure text is below the image */
    align-items: center; /* Center the content */
    margin: 10px; /* Add some spacing between items */
    color: #000;
}

    .grid-item img {
        width: auto;
        height: auto;
        object-fit: none;
        cursor: pointer;
        flex-grow: 1; /* Allow image to grow and take up space */
    }

    .grid-item photo-text {
        margin: 0; /* Remove margin to reduce space */
        padding: 5px 0; /* Add padding if needed for spacing */
        font-size: x-small;
        text-align: center;
        flex-shrink: 0; /* Prevent text from shrinking */
    }

    .photo-text {
        margin: 0; /* Remove margin to reduce space */
        padding: 5px 0; /* Add padding if needed for spacing */
        font-size: x-small;
        text-align: center;
        flex-shrink: 0; /* Prevent text from shrinking */
    }

@media (max-width: 400px) {
    .grid-container {
        grid-template-columns: 1fr;
    }
}