/* Attaya V51 — fully dynamic homepage sections */

.dynamic-home-section{
    padding-top:var(--section-padding-top,72px)!important;
    padding-bottom:var(--section-padding-bottom,72px)!important;
    background:var(--section-bg,#fff)!important;
    color:var(--section-text,#14392f);
}

.dynamic-home-section>.container{
    width:min(var(--section-container-width,1240px),calc(100% - 48px));
}

.dynamic-home-section .section-title,
.dynamic-home-section h2,
.dynamic-home-section h3{
    color:var(--section-heading,#0d513d);
}

.dynamic-home-section .section-copy,
.dynamic-home-section p{
    color:var(--section-muted,#6f7b76);
}

.dynamic-home-section .eyebrow{
    color:var(--section-accent,#a4cf47);
}

.dynamic-home-section .btn-primary{
    background:var(--section-button-bg,var(--green));
    color:var(--section-button-text,#fff);
}

.dynamic-home-section .btn-primary:hover{
    background:var(--section-button-hover-bg,var(--green-2));
    color:var(--section-button-text,#fff);
}

.centered-head{
    justify-content:center!important;
    text-align:center;
}

.centered-head>div{
    max-width:800px;
}

/* Values / trust */
.values-wrap.dynamic-home-section{
    margin-top:-28px;
    position:relative;
    z-index:12;
}

.values-wrap.dynamic-home-section .values-card{
    grid-template-columns:repeat(var(--section-columns,4),minmax(0,1fr));
    background:var(--section-surface,#fff);
    border:1px solid var(--section-border,#d8e8dd);
    border-radius:var(--section-card-radius,22px);
}

.values-wrap.dynamic-home-section .value-item h3{
    color:var(--section-heading,#0d513d);
}

.values-wrap.dynamic-home-section .value-item p{
    color:var(--section-muted,#6f7b76);
}

.values-wrap.dynamic-home-section .value-icon,
.values-wrap.dynamic-home-section .value-fa-icon{
    color:var(--section-accent,#a4cf47);
}

.value-fa-icon{
    font-size:36px;
    margin-bottom:12px;
    display:inline-block;
}

/* Projects */
.projects.dynamic-home-section .project-card{
    background:var(--section-surface,#fff);
    border-color:var(--section-border,#d8e8dd);
    border-radius:var(--section-card-radius,22px);
}

.projects.dynamic-home-section .project-card .project-body{
    background:var(--section-surface,#fff);
    border-radius:0 0 var(--section-card-radius,22px) var(--section-card-radius,22px);
}

.projects.dynamic-home-section .project-card h3{
    color:var(--section-heading,#0d513d);
}

.projects.dynamic-home-section .project-card p,
.projects.dynamic-home-section .project-funding-panel{
    color:var(--section-muted,#6f7b76);
}

.projects.dynamic-home-section .project-progress{
    background:color-mix(in srgb,var(--section-border,#d8e8dd) 72%,#fff);
}

.projects.dynamic-home-section .project-progress span{
    background:linear-gradient(90deg,var(--section-progress-start,#17b978),var(--section-progress-end,#d8b313));
}

.project-carousel{
    --effective-columns:var(--project-columns,3);
}

.project-carousel-track .project-card{
    flex:0 0 calc((100% - (22px * (var(--effective-columns) - 1))) / var(--effective-columns));
}

/* Urgent appeals */
.urgent-projects{
    position:relative;
    overflow:hidden;
}

.urgent-projects .urgent-head{
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    align-items:center;
    gap:28px;
    margin-bottom:32px;
}

.urgent-projects .urgent-kicker{
    display:inline-flex;
    align-items:center;
    gap:8px;
    color:var(--section-badge,#c81e1e);
    font-weight:900;
    font-size:14px;
    margin-bottom:5px;
}

.urgent-projects .urgent-header-button{
    align-self:center;
    min-width:220px;
    min-height:52px;
    background:transparent;
    color:var(--section-badge,#c81e1e);
    border:1px solid color-mix(in srgb,var(--section-badge,#c81e1e) 30%,#fff);
    box-shadow:0 10px 30px color-mix(in srgb,var(--section-badge,#c81e1e) 10%,transparent);
}

.urgent-projects .urgent-header-button:hover{
    background:var(--section-badge,#c81e1e);
    color:var(--section-badge-text,#fff);
    border-color:var(--section-badge,#c81e1e);
}

.urgent-grid{
    display:grid;
    grid-template-columns:repeat(var(--urgent-columns,3),minmax(0,1fr));
    gap:22px;
    align-items:stretch;
}

.urgent-projects[data-count="1"] .urgent-grid{
    grid-template-columns:minmax(320px,560px);
    justify-content:center;
}

.urgent-projects[data-count="2"] .urgent-grid{
    grid-template-columns:repeat(2,minmax(0,500px));
    justify-content:center;
}

.urgent-card{
    display:flex;
    flex-direction:column;
    background:var(--section-surface,#0d513d);
    border:1px solid var(--section-border,#1f684f);
    border-radius:var(--section-card-radius,24px);
    overflow:hidden;
    box-shadow:0 18px 45px rgba(8,47,40,.16);
    min-width:0;
}

.urgent-card-media{
    height:250px;
    position:relative;
    display:block;
    overflow:hidden;
}

.urgent-card-media img{
    width:100%;
    height:100%;
    object-fit:cover;
    transition:transform .35s ease;
}

.urgent-card:hover .urgent-card-media img{
    transform:scale(1.035);
}

.urgent-overlay{
    position:absolute;
    inset:0;
    background:linear-gradient(180deg,transparent 18%,rgba(8,47,40,.75));
}

.urgent-badge{
    position:absolute;
    top:16px;
    inset-inline-start:16px;
    background:var(--section-badge,#c81e1e);
    color:var(--section-badge-text,#fff);
    padding:9px 14px;
    border-radius:999px;
    font-weight:900;
    box-shadow:0 8px 22px color-mix(in srgb,var(--section-badge,#c81e1e) 28%,transparent);
}

.urgent-card-body{
    padding:22px;
    display:flex;
    flex-direction:column;
    flex:1;
    background:var(--section-surface,#0d513d);
}

.urgent-card-body h3{
    font-size:20px;
    line-height:1.45;
    margin:0 0 8px;
    color:var(--section-text,#fff);
}

.urgent-card-body>p{
    color:var(--section-muted,#dce9e3);
    line-height:1.8;
    margin:0 0 18px;
    min-height:50px;
}

.urgent-progress-meta{
    display:flex;
    justify-content:space-between;
    gap:18px;
    align-items:center;
    font-size:12px;
    margin-top:auto;
    color:var(--section-text,#fff);
}

.urgent-progress-meta>span:last-child{
    direction:ltr;
}

.urgent-progress{
    height:10px;
    background:color-mix(in srgb,var(--section-border,#1f684f) 55%,transparent);
    border-radius:999px;
    overflow:hidden;
    margin:10px 0 14px;
}

.urgent-progress span{
    display:block;
    height:100%;
    background:linear-gradient(90deg,var(--section-progress-start,#dc2626),var(--section-progress-end,#f97316));
}

.urgent-countdown{
    font-size:12px;
    color:var(--section-muted,#dce9e3);
    margin-bottom:14px;
}

.urgent-actions{
    display:flex;
    gap:10px;
    margin-top:auto;
}

.urgent-actions>*{
    flex:1;
}

.urgent-donate-button{
    background:var(--section-button-bg,#2f7439)!important;
    color:var(--section-button-text,#fff)!important;
    border-color:transparent!important;
}

.urgent-donate-button:hover{
    background:var(--section-button-hover-bg,#155c48)!important;
}

.urgent-details-button{
    background:transparent;
    color:var(--section-text,#fff);
    border:1px solid color-mix(in srgb,var(--section-text,#fff) 55%,transparent);
}

.urgent-details-button:hover{
    background:var(--section-text,#fff);
    color:var(--section-surface,#0d513d);
}

/* Stats */
.stats.dynamic-home-section{
    margin-top:0!important;
    background:var(--section-bg,#0d513d)!important;
}

.stats.dynamic-home-section .stats-grid{
    grid-template-columns:repeat(var(--section-columns,5),minmax(0,1fr));
}

.stats.dynamic-home-section .stat strong{
    color:var(--section-accent,#c7ef45);
}

.stats.dynamic-home-section .stat span,
.stats.dynamic-home-section .stat svg{
    color:var(--section-text,#fff);
}

/* Donation */
.donation-section.dynamic-home-section{
    margin-top:0!important;
    z-index:auto!important;
}

.donation-section.dynamic-home-section .donation-card{
    background:var(--section-surface,#f6faf7);
    border:1px solid var(--section-border,#d8e8dd);
    border-radius:var(--section-card-radius,24px);
    overflow:hidden;
}

.donation-section.dynamic-home-section .donation-copy h2{
    color:var(--section-heading,#0d513d);
}

.donation-section.dynamic-home-section .donation-copy p{
    color:var(--section-muted,#6f7b76);
}

.donation-section.dynamic-home-section .amount{
    border-color:var(--section-border,#d8e8dd);
    color:var(--section-heading,#0d513d);
}

.donation-section.dynamic-home-section .amount.active{
    border-color:var(--section-accent,#a4cf47);
    background:color-mix(in srgb,var(--section-accent,#a4cf47) 11%,#fff);
}

/* News */
.news.dynamic-home-section .news-grid{
    grid-template-columns:repeat(var(--section-columns,3),minmax(0,1fr));
}

.news.dynamic-home-section .news-card{
    background:var(--section-surface,#fff);
    border-color:var(--section-border,#d8e8dd);
    border-radius:var(--section-card-radius,22px);
}

.news.dynamic-home-section .news-card h3{
    color:var(--section-heading,#0d513d);
}

.news.dynamic-home-section .news-card p{
    color:var(--section-muted,#6f7b76);
}

@media(max-width:1100px){
    .project-carousel-track .project-card{
        flex-basis:calc((100% - 22px) / 2);
    }

    .urgent-grid{
        grid-template-columns:repeat(2,minmax(0,1fr));
    }

    .stats.dynamic-home-section .stats-grid{
        grid-template-columns:repeat(3,minmax(0,1fr));
    }

    .news.dynamic-home-section .news-grid{
        grid-template-columns:repeat(2,minmax(0,1fr));
    }
}

@media(max-width:700px){
    .dynamic-home-section>.container{
        width:min(100% - 28px,var(--section-container-width,1240px));
    }

    .values-wrap.dynamic-home-section{
        margin-top:0;
    }

    .values-wrap.dynamic-home-section .values-card{
        grid-template-columns:1fr;
    }

    .project-carousel-track .project-card{
        flex-basis:100%;
    }

    .urgent-projects .urgent-head{
        grid-template-columns:1fr;
        align-items:start;
    }

    .urgent-projects .urgent-header-button{
        min-width:0;
        width:100%;
    }

    .urgent-grid,
    .urgent-projects[data-count="1"] .urgent-grid,
    .urgent-projects[data-count="2"] .urgent-grid{
        grid-template-columns:1fr;
    }

    .urgent-card-media{
        height:225px;
    }

    .urgent-actions{
        flex-direction:column;
    }

    .stats.dynamic-home-section .stats-grid,
    .news.dynamic-home-section .news-grid{
        grid-template-columns:1fr;
    }
}
