h1 {
    text-align: center;
    margin-bottom: 20px;
    font-size: 2.5rem;
}

/* Project Showcase Grid */
.project-showcase {
    padding: 40px;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(600px, 1fr)); /* Adjusts for screen size */
    gap: 20px;
}

/* Limit to 4 columns on larger screens */
@media (min-width: 1600px) {
    .project-grid {
        grid-template-columns: repeat(3, 1fr)!important; /* Max 2 columns */
    }
}

.project-item {
    position: relative;
    border-radius: 4px;
    overflow: hidden;
}

.project-item img {
    width: 100%; /* Ensures the image takes up the full width of the grid item */
    height: 100%; /* Set a height constraint */
    object-fit: cover; /* This ensures the image maintains aspect ratio and fits within the grid cell */
    max-height: 400px; /* You can adjust this value depending on your grid */
    display: block;
    transition: transform 0.3s ease;
    /* Image optimization */
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    /* Prevent layout shift during loading */
    aspect-ratio: 16/9;
    background-color: #f0f0f0; /* Placeholder color */
    /* Performance optimization */
    will-change: transform;
    backface-visibility: hidden;
}

/* Hover Effect to slightly zoom in the image */
.project-item:hover img {
    transform: scale(1.05);
}

/* Overlay with Location Text */
.overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 45px;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.7) 30%, rgba(0, 0, 0, 0) 100%);
    display: flex;
    align-items: center;
    padding-left: 10px;
}

.location {
    color: #fff;
    font-size: 1.2rem;
}

/* Responsive Breakpoints */
@media (max-width: 768px) {
    .project-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .project-grid {
        grid-template-columns: 1fr;
    }

    .location {
        font-size: 1rem;
    }
}