/* Basic Page Styles */
body {
    font-family: sans-serif;
    background-color: #f0f2f5;
    margin: 0;
    padding: 2rem;
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 2rem;
}

/* Gallery Grid Container */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 columns on desktop */
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* Gallery Item Styling */
.gallery-item {
    margin: 0;
    position: relative;
    overflow: hidden; /* This is key for the zoom effect */
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    cursor: pointer;
}

.gallery-item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover; /* Ensures images fill the container without distortion */
    transition: transform 0.4s ease-in-out;
}

.gallery-item figcaption {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 100%);
    color: white;
    padding: 2rem 1rem 1rem;
    font-size: 1.1rem;
    font-weight: bold;
    transform: translateY(100%); /* Start hidden below the item */
    transition: transform 0.4s ease-in-out, opacity 0.4s ease-in-out;
    opacity: 0;
}

/* Hover Effects */
.gallery-item:hover img {
    transform: scale(1.1); /* Zoom in effect */
}

.gallery-item:hover figcaption {
    transform: translateY(0); /* Slide caption up */
    opacity: 1;
}

/* Responsive Adjustments */
@media (max-width: 992px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 columns on tablets */
    }
}

@media (max-width: 576px) {
    .gallery-grid {
        grid-template-columns: 1fr; /* 1 column on mobile */
    }
    body {
        padding: 1rem;
    }
}