/* ===== PROJECTS SECTION ===== */
.projects-section {
    padding-top: 2.5rem;
    padding-bottom: 2.5rem;
    background-color: transparent;
}

.projects-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-top: 2.5rem;
}

@media (min-width: 768px) {
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1280px) {
    .projects-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.project-card {
    background: #fff;
    border-radius: 1rem;
    border: 1px solid rgba(229, 231, 235, 0.5);
    overflow: hidden;
    transition: var(--transition-fast);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    height: 100%;
    min-height: 320px;
    position: relative;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.project-card:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    transform: translateY(-5px);
}

.project-img-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    background-color: var(--soft-white, #f9fafb);
}

.project-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease, filter 0.5s ease;
    filter: blur(2px) brightness(0.9);
    transform: scale(1.05);
    /* hide blurred edges */
}

.project-card:hover .project-img {
    transform: scale(1.1);
    /* Slight zoom on hover */
    filter: blur(2px) brightness(0.8);
}

/* Title overlay in the top half */
.project-title-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 45%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1;
    transition: background 0.3s ease;
}

.project-card:hover .project-title-overlay {
    background: rgba(0, 0, 0, 0.5);
}

.project-title-overlay .project-title {
    color: #ffffff;
    font-size: 1.3rem;
    font-weight: 700;
    text-align: left;
    margin: 0;
    padding: 0;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
    transition: transform 0.3s ease;
}

.project-card:hover .project-title-overlay .project-title {
    transform: translateY(-2px);
}

/* Solid white content overlay */
.project-content {
    position: relative;
    z-index: 2;
    /* Ensure it stays above the overlay */
    height: 55%;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-top: 1px solid #e5e7eb;
    box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.05);
}

@media (min-width: 363px) {
    .project-content {
        padding: 1.5rem 2rem;
    }
}

.project-desc {
    color: var(--gray-800);
    font-size: 0.875rem;
    line-height: 1.5;
    margin-bottom: 1.25rem;
    font-weight: 500;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (min-width: 340px) {
    .project-desc {
        font-size: 0.95rem;
    }
}

.project-footer {
    display: flex;
    align-items: center;
    margin-top: auto;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(0, 0, 0, 0.15);
}

.project-tech {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tech-tag {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--picto-primary-dark);
    background: var(--gray-100);
    padding: 0.25rem 0.6rem;
    border-radius: 0.25rem;
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: color 0.2s ease, opacity 0.2s ease;
    align-self: flex-end;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
    opacity: 0.85;
}

.project-link:hover {
    color: #ffffff;
    opacity: 1;
}

.project-link i {
    font-size: 0.8rem;
}