/* Homepage "Nos projets agricoles" section: same card design as the
 * "Projets" listing page (see projects-listing.css), scoped by class instead
 * of body.page-id-* so it can't leak onto other pages. */

body.home .sf-home-projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    width: 100%;
    padding: 1rem 0 0;
}

body.home .sf-home-projects-grid .sf-project-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(20, 40, 20, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

body.home .sf-home-projects-grid .sf-project-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(20, 40, 20, 0.16);
}

body.home .sf-home-projects-grid .elementor-image-box-wrapper {
    display: flex !important;
    flex-direction: column !important;
    text-align: left !important;
    flex: 1 1 auto;
}

body.home .sf-home-projects-grid .elementor-image-box-img {
    position: relative;
    margin: 0 !important;
    width: 100% !important;
    aspect-ratio: 16 / 11;
    overflow: hidden;
}

body.home .sf-home-projects-grid .elementor-image-box-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

body.home .sf-home-projects-grid .sf-project-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    background: #2f9e44;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    padding: 5px 12px;
    border-radius: 999px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}

/* "Campaign is currently open" marker — opposite corner from the category badge. */
body.home .sf-home-projects-grid .sf-project-status {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.95);
    color: #1f6b2f;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    padding: 5px 11px 5px 9px;
    border-radius: 999px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}

body.home .sf-home-projects-grid .sf-project-status::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #2f9e44;
    animation: sf-project-status-pulse 1.8s ease-out infinite;
}

@keyframes sf-project-status-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(47, 158, 68, 0.55);
    }
    70% {
        box-shadow: 0 0 0 6px rgba(47, 158, 68, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(47, 158, 68, 0);
    }
}

body.home .sf-home-projects-grid .elementor-image-box-content {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    padding: 1.25rem 1.4rem 1.4rem;
}

body.home .sf-home-projects-grid .elementor-image-box-title {
    margin: 0 0 0.6rem;
    font-size: 1.15rem;
    line-height: 1.35;
}

body.home .sf-home-projects-grid .elementor-image-box-title a {
    color: inherit;
}

body.home .sf-home-projects-grid .elementor-image-box-description {
    margin: 0 0 1rem;
    color: #5c6b5c;
    font-size: 0.93rem;
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

body.home .sf-home-projects-grid .sf-project-funding {
    margin-top: auto;
    padding-top: 0.9rem;
    border-top: 1px solid #eef1ee;
}

body.home .sf-home-projects-grid .sf-project-progress-track {
    width: 100%;
    height: 8px;
    border-radius: 999px;
    background: #e7ede6;
    overflow: hidden;
}

body.home .sf-home-projects-grid .sf-project-progress-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #4caf50, #2f9e44);
}

body.home .sf-home-projects-grid .sf-project-funding-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-top: 0.5rem;
    font-size: 0.88rem;
}

body.home .sf-home-projects-grid .sf-project-raised {
    font-weight: 700;
    color: #1f3d1f;
}

body.home .sf-home-projects-grid .sf-project-raised small {
    font-weight: 400;
    color: #7a8a7a;
}

body.home .sf-home-projects-grid .sf-project-percent {
    font-weight: 700;
    color: #2f9e44;
}

body.home .sf-home-projects-grid .sf-project-goal {
    margin-top: 0.25rem;
    font-size: 0.8rem;
    color: #8a978a;
}

body.home .sf-home-projects-grid .elementor-widget-button {
    margin: 0 !important;
    padding: 1rem 1.4rem 1.4rem !important;
    flex-shrink: 0;
}

body.home .sf-home-projects-grid .elementor-widget-button .elementor-button {
    display: flex !important;
    width: 100%;
    justify-content: center;
    align-items: center;
    gap: 0.4rem;
    background: #2f9e44;
    color: #fff;
    border-radius: 8px;
    padding: 0.7rem 1rem;
    font-weight: 600;
    transition: background 0.2s ease;
}

body.home .sf-home-projects-grid .elementor-widget-button .elementor-button:hover {
    background: #26833a;
    color: #fff;
}

body.home .sf-home-projects-grid .elementor-widget-button .elementor-button-text::after {
    content: "\2192";
    margin-left: 0.3rem;
}

/* The old image carousel (4 projects, links only to /projets, no funding
 * info) is replaced by the card grid above — hide it rather than removing
 * its markup, so the swiper widget doesn't have to be surgically excised. */
body.home .elementor-element-292c695 {
    display: none !important;
}

@media (max-width: 767px) {
    body.home .sf-home-projects-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
}
