/* --- Page Title --- */
.page-title {
    text-align: center;
    margin-top: 120px; /* Pushes content below the fixed header */
    color: #4a3f35;
    font-size: 2.5rem;
    font-weight: 300;
}

/* --- Category Navigation (Subtle) --- */
.category-grid {
    display: flex;
    justify-content: center;
    align-items: flex-end; /* Aligns the X icon with the SVGs */
    gap: 2rem;
    padding: 1rem 2rem 2rem 2rem;
    flex-wrap: wrap;
    background: transparent; /* Removed heavy background */
}

.cat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #a09385; /* Very subtle text color */
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 1px;
    opacity: 0.6;
    transition: all 0.3s ease;
}

.cat-item:hover, 
.cat-item.active {
    opacity: 1;
    color: #4a3f35;
    transform: translateY(-3px);
}

.cat-item img {
    width: 35px; /* Scaled down */
    height: 35px;
    margin-bottom: 0.5rem;
    filter: brightness(0) saturate(100%) invert(26%) sepia(13%) saturate(769%) hue-rotate(344deg) brightness(97%) contrast(88%); /* Forces SVG to match #4a3f35 */
}

/* Clear Filter 'X' */
.cat-item i.fa-x {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    height: 35px;
    display: flex;
    align-items: center;
    transition: color 0.3s ease;
}

#filter-all:hover i.fa-x {
    color: #c96b6b; /* Subtle red on hover to indicate reset */
}

/* --- Masonry Grid --- */
.masonry-grid {
    column-count: 3;
    column-gap: 1.5rem;
    padding: 0 2rem 4rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

@media (max-width: 900px) { .masonry-grid { column-count: 2; } }
@media (max-width: 600px) { .masonry-grid { column-count: 1; } }

.masonry-item {
    position: relative;
    break-inside: avoid;
    margin-bottom: 1.5rem;
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    background-color: #eae3db;
}

.masonry-item img {
    width: 100%;
    display: block;
    height: auto;
    transition: transform 0.4s ease;
}

.masonry-item:hover img {
    transform: scale(1.03);
}

/* Name Overlay on Grid */
.pet-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to top, rgba(30, 26, 22, 0.8) 0%, transparent 100%);
    color: #fff;
    padding: 2rem 1rem 1rem 1rem;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    font-size: 1.2rem;
    font-weight: 500;
    text-align: center;
}

.masonry-item:hover .pet-overlay {
    transform: translateY(0);
}

/* --- Modal / Carousel --- */
.modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(30, 26, 22, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.carousel-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 95%;
    max-height: 75vh;
}

#carousel-image {
    max-width: 80%;
    max-height: 75vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.modal-btn {
    background: none;
    border: none;
    color: #f8f5f2;
    font-size: 3rem;
    cursor: pointer;
    transition: color 0.2s;
    padding: 1rem;
}

.modal-btn:hover {
    color: #d1bfae;
}

.modal-btn.close {
    position: absolute;
    top: 20px;
    right: 30px;
}

.carousel-caption {
    color: #f8f5f2;
    margin-top: 1.5rem;
    text-align: center;
    max-width: 800px;
}

#carousel-title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #d1bfae;
}

#carousel-description {
    font-size: 1.1rem;
    line-height: 1.4;
}