/* Portfolio Section */
.portfolio {

    background: #fff;
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-header::before {
    content: '';
    display: block;
    width: 100px;
    height: 3px;
    background: #ff6b35;
    margin: 0 auto 20px;
}

.section-header h2 {
    font-size: 2.5rem;
    color: #222;
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    /* gap: 30px; */
}

.portfolio-item1 {
    background-size: cover;
    background-position: center;
    height: 400px;
    /* border-radius: 10px; */
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease;
    cursor: pointer;
}

.portfolio-item1:hover {
    /* transform: translateY(-10px); */
}

.portfolio-item1::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.portfolio-item1:hover::before {
    opacity: 1;
}

.item-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    /* Centers it */
    color: #fff;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
    text-align: center;
    width: 100%;
    padding: 0 20px;
    /* optional */
}


.portfolio-item1:hover .item-content {
    opacity: 1;
}

.item-content h3 {
    font-size: 25px;
    margin-bottom: 10px;
    font-weight: 600;
}

.item-content h4 {
    font-size: 35px;
    margin-bottom: 15px;
    font-weight: 400;
}


/* Mobile Responsive: Always show overlay and text */
@media (max-width: 768px) {

    .portfolio {
        padding: 60px 5%;
    }

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

    .portfolio-item1 {
        height: 300px;
        position: relative;

        display: flex;
        align-items: center;
        justify-content: center;
        /* Ensures content stays centered */
    }

    .portfolio-item1::before {
        opacity: 1 !important;
    }

    /* CENTER THE TEXT PERFECTLY */
    .item-content {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);

        width: 80%;
        text-align: center;

        opacity: 1 !important;
        z-index: 3;
    }

    .item-content h4 {
        font-size: 1.3rem;
        margin-bottom: 5px;
    }

    .item-content h3 {
        font-size: 1.1rem;
        margin-bottom: 10px;
    }

    .item-content .btn {
        padding: 8px 20px;
        font-size: 0.9rem;
    }

    /* Remove hover effects for mobile */
    .portfolio-item1:hover {
        transform: none !important;
    }

    .section-header h2 {
        font-size: 2rem;
    }
}


/* Smaller Mobile Devices */
@media (max-width: 480px) {

    .portfolio {
        padding: 40px 5%;
    }

    .portfolio-item1 {
        height: 250px;
    }

    .item-content {
        width: 85%;
    }

    .item-content h4 {
        font-size: 1.2rem;
    }

    .section-header h2 {
        font-size: 1.8rem;
    }
}