/* --- Gallery Filter Buttons --- */
.gallery-filters {
    margin-bottom: 40px;
    text-align: center;
    flex-wrap: wrap;
    display: flex;
    justify-content: center;
}

.filter-btn {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 10px 20px;
    margin: 5px;
    cursor: pointer;
    font-weight: 700;
    border-radius: 50px;
    transition: all 0.3s ease;
    font-size: 14px;
}

.filter-btn:hover {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    color: #fff;
}

.filter-btn.is-checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

/* --- Gallery Table Layout --- */
.gallery-container {
    /* Isotope will manage the layout of the direct children */
}

.gallery-category-table {
    width: 100%;
    margin-bottom: 50px;
    /* border: 1px solid var(--border-color); */ /* Border is now removed */
    border-radius: 8px;
    padding: 0; /* Padding removed to let images define the space */
}
.category-title {
    width: 100%;
    text-align: left;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
}

.image-table {
    display: grid;
    /* Create 4 equal columns on desktop */
    grid-template-columns: repeat(4, 1fr);
    gap: 15px; /* Space between images */
}

.image-cell a {
    display: block;
    overflow: hidden;
    border-radius: 12px; /* Slightly more rounded corners */
    aspect-ratio: 4 / 3;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    
    /* STRONGER FLOATING SHADOW */
    box-shadow: 0 20px 35px rgba(0, 0, 0, 0.12); 
}

.image-cell a:hover {
    transform: translateY(-8px); /* Lift the image a bit more */
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2); /* A more noticeable shadow on hover */
}

.image-cell img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover; /* Scale and crop image */
    transition: transform 0.3s ease;
}

.image-cell a:hover img {
    transform: scale(1.05);
}

/* --- NEW: Before/After Labels on Hover --- */

/* Create the 'Before' label using a ::before pseudo-element */
.image-cell a[href*="before"]::before {
    content: 'Before';
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 700;
    border-radius: 4px;
    line-height: 1.2;
    opacity: 0; /* Hidden by default */
    transition: opacity 0.3s ease;
    z-index: 10;
}

/* Create the 'After' label using a ::before pseudo-element */
.image-cell a[href*="after"]::before,
.image-cell a[href*="cleaned"]::before {
    content: 'After';
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 700;
    border-radius: 4px;
    line-height: 1.2;
    opacity: 0; /* Hidden by default */
    transition: opacity 0.1s ease;
    z-index: 10;
}

/* Show the label when the user hovers over the link */
.image-cell a:hover::before {
    opacity: 1; /* Visible on hover */
}
/* --- Responsive for Gallery --- */

/* Tablet: 2 columns */
@media (max-width: 992px) {
    .image-table {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile: 1 column */
@media (max-width: 576px) {
    .image-table {
        grid-template-columns: 1fr; /* A single column */
    }
    .filter-btn {
        font-size: 12px;
        padding: 8px 15px;
    }
}