/* --- Gallery Section Container --- */
.gallery {
    padding: 60px 20px;
    background-color: var(--sage-green);
    width: 100%;
    display: flex;
    justify-content: center;
}

.gallery-content {
    max-width: 1200px;
    width: 100%;
    text-align: center;
}

/* Section Title - Reduced from 3.5rem */
.gallery-content h1 {
    font-family: 'Courier Prime', monospace;
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    color: #2D3436;
    margin-bottom: 2.5rem;
    position: relative;
    display: inline-block;
}

.gallery-content h1::after {
    content: '';
    position: absolute;
    width: 40%;
    height: 1.5px;
    background: var(--dark-gray);
    bottom: -8px;
    left: 30%;
    opacity: 0.2;
}

/* --- The Grid Layout --- */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

/* --- Gallery Item Card --- */
.gallery-item {
    position: relative;
    height: 450px;
    /* Slightly shorter for a tighter look */
    border-radius: 16px;
    overflow: hidden;
    background: var(--white);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    transition: all 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.gallery-item a {
    text-decoration: none;
    display: block;
    height: 100%;
    width: 100%;
}

.g-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.8s ease;
}

/* --- Hover Overlay & Text --- */
.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Lighter gradient for a cleaner look */
    background: linear-gradient(to top, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0) 50%);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 35px;
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 2;
}

/* Art Label - Reduced from 3.5rem to 2.2rem */
.art-type {
    color: var(--white);
    font-family: "Allison", cursive;
    font-size: 2.2rem;
    letter-spacing: 1px;
    transform: translateY(15px);
    transition: transform 0.5s ease;
    text-align: center;
    padding: 0 15px;
}

/* --- Interactions --- */
.gallery-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
}

.gallery-item:hover .g-img {
    transform: scale(1.05);
    filter: brightness(0.85);
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-item:hover .art-type {
    transform: translateY(0);
}

/* --- Mobile Fixes --- */
@media (max-width: 768px) {
    .gallery-item {
        height: 380px;
    }

    .art-type {
        font-size: 1.8rem;
        /* Even smaller for mobile screens */
    }
}

/* Container for buttons */
.category-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin: 40px auto;
    max-width: 1000px;
}

/* Base Button Style */
.filter-btn {
    background-color: transparent;
    border: 1.5px solid #2D3436;
    color: #2D3436;
    padding: 12px 24px;
    font-family: 'Courier Prime', monospace;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    border-radius: 4px;
    /* Sophisticated slight curve */
    transition: all 0.3s ease;
}

/* Hover & Active States */
.filter-btn:hover {
    background-color: #2D3436;
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.filter-btn.active {
    background-color: #7B8E7E;
    /* A subtle sage green for the active category */
    border-color: #7B8E7E;
    color: white;
}

/* Mobile Adjustments */
@media (max-width: 600px) {
    .category-nav {
        gap: 8px;
    }

    .filter-btn {
        padding: 8px 16px;
        font-size: 0.8rem;
        flex-grow: 1;
        /* Makes buttons fill the width nicely on small screens */
    }
}