/* Specific styles for the gallery page */

.content-wrapper-gallery {
    /* Override the main content wrapper for full width */
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px;
}

.gallery-container {
    display: grid;
    /* Create responsive columns: they will be at least 280px wide, 
       and the browser will fit as many as possible per row. */
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px; /* Uniform spacing between grid items */
    margin-top: 2em;
}

.gallery-item {
    border: 1px solid #ccc;
    border-radius: 8px;
    background-color: #fffaf0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    overflow: hidden; /* Ensures the image corners are rounded if they overflow */
    display: flex;
    flex-direction: column;
}

.gallery-item a {
    display: block; /* Makes the link area cover the image */
    line-height: 0; /* Removes extra space below the image */
}

.gallery-item img {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3; /* Enforces a uniform aspect ratio */
    object-fit: cover; /* Covers the area, cropping if necessary */
    transition: transform 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.05); /* Slight zoom on hover */
}

.gallery-item .caption {
    padding: 15px;
    font-size: 0.85em;
    color: #333;
    line-height: 1.4;
    text-align: left;
    margin: 0;
    flex-grow: 1; /* Allows caption area to fill remaining space */
}
