/* Portfolio Filter Buttons */
.portfolio-filter {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
}

.portfolio-filter button {
    padding: 8px 20px;
    border: 1px solid #c0392b!important;
    background: transparent!important;
    color: #c0392b!important;
    cursor: pointer;
    font-size: 14px;
    border-radius: 4px!important;
    transition: all 0.3s ease;
}

.portfolio-filter button:hover,
.portfolio-filter button.active {
    border: 1px solid #c0392b!important;
    background: #c0392b!important;
    color: #fff!important;
}

/* Portfolio Grid */
.portfolio-grid {
    display: block;
}

.portfolio-grid-item {
    width: calc(33.333% - 14px);
    margin-bottom: 20px;
    /* margin-right is handled by Isotope fitRows gutter — do NOT add it here */
    overflow: hidden;
    border-radius: 5px;
    box-sizing: border-box;
    /* No float, no display:none — Isotope uses position:absolute and manages visibility */
}

.portfolio-grid-item a {
    display: block;
    position: relative;
    width: 100%;
    height: 280px; /* Set card height */
    overflow: hidden;
    border-radius: 5px;
    text-decoration: none;
    color: #ffffff;
    background-color: #2c3e50; /* Fallback background color */
    border-bottom: 4px solid #c0392b; /* Line on the bottom of every card */
}

/* Gradient overlay */
.portfolio-grid-item a::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, 0.75) 100%);
    z-index: 2;
    transition: background 0.3s ease;
}

.portfolio-grid-item:hover a::after {
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 30%, rgba(0, 0, 0, 0.85) 100%);
}

.portfolio-grid-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    overflow: hidden;
}

.portfolio-grid-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.portfolio-grid-item:hover .portfolio-grid-image img {
    transform: scale(1.05);
}

.portfolio-grid-info {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    box-sizing: border-box;
    z-index: 3;
}

.portfolio-grid-title {
    font-size: 22px !important;
    color: #ffffff !important;
    margin: 0 0 4px;
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

.portfolio-grid-cat {
    font-size: 13px;
    color: #e0e0e0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    display: block;
}

/* Single portfolio gallery style */
.portfolio-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.portfolio-gallery-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
    border-radius: 0px;
    transition: opacity 0.3s ease;
}

.portfolio-gallery-item a:hover img {
    opacity: 0.85;
}

/* Forces the title to be white */
.portfolio-title {
    color: #ffffff !important; 
}

/* Inside single portfolio client styling */
.portfolio-client {
    color: var(--e-global-color-primary);
}

/* Responsive Grid and Gallery styles */
@media ( max-width: 1024px ) {
    .portfolio-grid-item {
        width: calc(50% - 10px);
        /* margin-right handled by Isotope gutter */
    }

    .portfolio-gallery {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media ( max-width: 600px ) {
    .portfolio-grid-item {
        width: 100%;
        /* single column — gutter irrelevant */
    }

    .portfolio-gallery {
        grid-template-columns: 1fr;
    }
}
