/* "Projets" listing page (page-id-1331): turn the plain stacked image-box
 * list into a responsive grid of crowdfunding campaign cards. Scoped under
 * body.page-id-1331 so it can never leak onto other Elementor pages that
 * reuse the same generic classes (image-box, buttons, etc.). */

body.page-id-1331 .elementor-1331 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    padding: 1rem 0 3rem;
    max-width: 1200px;
    margin: 0 auto;
}

body.page-id-1331 .elementor-1331 > .e-con.e-parent {
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    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.page-id-1331 .elementor-1331 > .e-con.e-parent:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(20, 40, 20, 0.16);
}

body.page-id-1331 .elementor-1331 .e-con-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 0 !important;
    gap: 0 !important;
}

/* Make the image+text block absorb all the extra vertical space in taller
 * cards, so the button below it always lands flush on the card's bottom
 * edge instead of floating right under the text with a gap beneath it. */
body.page-id-1331 .elementor-widget-image-box {
    display: flex;
    flex: 1 1 auto;
}

/* Image box: force a vertical layout (image on top, text below) instead of
 * Elementor's default "position-left" side-by-side layout, which crushes the
 * text into a thin column on a listing page. */
body.page-id-1331 .elementor-image-box-wrapper {
    display: flex !important;
    flex-direction: column !important;
    text-align: left !important;
    flex: 1 1 auto;
}

body.page-id-1331 .elementor-image-box-img {
    position: relative;
    margin: 0 !important;
    aspect-ratio: 16 / 11;
    overflow: hidden;
}

/* Elementor stores a per-widget image width (e.g. 30%) on some of these
 * cards individually, with a more specific selector than ours — force it
 * back to full card width regardless of that per-widget setting. */
body.page-id-1331 .elementor-image-box-img {
    width: 100% !important;
}

body.page-id-1331 .elementor-image-box-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

body.page-id-1331 .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.page-id-1331 .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.page-id-1331 .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.page-id-1331 .elementor-image-box-content {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    padding: 1.25rem 1.4rem 1.4rem;
}

body.page-id-1331 .elementor-image-box-title {
    margin: 0 0 0.6rem;
    font-size: 1.15rem;
    line-height: 1.35;
}

body.page-id-1331 .elementor-image-box-title a {
    color: inherit;
}

body.page-id-1331 .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;
}

/* Funding progress block, injected server-side for real campaigns. */
body.page-id-1331 .sf-project-funding {
    margin-top: auto;
    padding-top: 0.9rem;
    border-top: 1px solid #eef1ee;
}

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

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

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

body.page-id-1331 .sf-project-raised {
    font-weight: 700;
    color: #1f3d1f;
}

body.page-id-1331 .sf-project-raised small {
    font-weight: 400;
    color: #7a8a7a;
}

body.page-id-1331 .sf-project-percent {
    font-weight: 700;
    color: #2f9e44;
}

body.page-id-1331 .sf-project-goal {
    margin-top: 0.25rem;
    font-size: 0.8rem;
    color: #8a978a;
}

/* CTA button: pinned to the bottom, full width, styled as a real call to action. */
body.page-id-1331 .elementor-widget-button {
    margin: 0 !important;
    padding: 1rem 1.4rem 1.4rem !important;
    flex-shrink: 0;
}

body.page-id-1331 .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.page-id-1331 .elementor-widget-button .elementor-button:hover {
    background: #26833a;
    color: #fff;
}

body.page-id-1331 .elementor-widget-button .elementor-button-text::after {
    content: "\2192";
    margin-left: 0.3rem;
}

@media (max-width: 767px) {
    body.page-id-1331 .elementor-1331 {
        grid-template-columns: 1fr;
        padding: 0.5rem 1rem 2rem;
        gap: 1.25rem;
    }
}
