/* Main image Grid Styling */
.image-grid {
    display: flex; /* Use flexbox to handle centering */
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center; /* Center the items in the grid */
    margin: 60px auto;
    padding: 0 20px;
    width: 90%; /* Slightly narrower for balance */
}

/* Styling for the Back button positioned in the top left corner of the viewport */
.back-button {
    background-color: #6c757d;
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border: none;
    border-radius: 5px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
    
    /* Position in top left corner of the viewport */
    position: absolute;
    top: 450px;
    left: 120px;
}

/* Darker background color on hover */
.back-button:hover {
    background-color: #5a6268;
}

/* Individual image Container Styling */
.image-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px; /* Increased padding for more breathing room */
    width: 220px; /* Fixed width to ensure consistent size */
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
    background-color: white;
    border-radius: 12px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.image-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

/* Title Container Styling */
.image-title-container {
    text-align: center;
    margin-bottom: 12px;
}

/* Title Styling */
.image-title {
    font-size: 1.3em;
    color: #444;
    font-weight: 600;
}

/* Image Styling */
.image-container img {
    width: 100%;
    height: 250px; /* Increased height for a larger image display */
    border-radius: 8px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.image-container:hover img {
    transform: scale(1.05);
    transform: translateY(-2px);
}

/* Modal Styling */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    padding-top: 60px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.8);
}

.modal-content {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
    border-radius: 8px;
}

.close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.close:hover,
.close:focus {
    color: #bbb;
}

/* Responsive Adjustments */
@media (min-width: 600px) {
    .image-grid {
        width: 90%;
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); /* Adjusts column width for smaller screens */
    }
}

@media (min-width: 900px) {
    .image-grid {
        width: 85%;
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); /* Adjusts for medium screens */
    }
}

@media (min-width: 1200px) {
    .image-grid {
        width: 75%;
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); /* Larger columns for larger screens */
    }
}
