/* ==========================================================================
   Módulo Fundos Comunitários
   ========================================================================== */

/* ── Listagem agrupada por programa ─────────────────────────────────────── */
.fundos-intro {
    margin-bottom: var(--core-gap, 24px);
}

.fundos-grupos {
    display: flex;
    flex-direction: column;
    gap: calc(var(--core-gap, 24px) * 2);
}

.fundos-grupo__header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 20px;
    margin-bottom: var(--core-gap, 24px);
    padding-bottom: 12px;
    border-bottom: 1px solid var(--core-border-color, #767676); /* 4.5:1 sobre branco — limite de componente ≥ 3:1 */
}

.fundos-grupo__logo,
.fundos-programa__logo,
.fundo-detalhe__logo {
    display: block;
    width: auto;
    max-width: 220px;
    max-height: 64px;
    object-fit: contain;
}

.fundos-grupo__title {
    margin: 0;
}

.fundos-grupo__count {
    margin-left: auto;
    font-size: var(--core-font-size-base, 1rem);
    color: #595959; /* 7:1 sobre branco */
}

.fundos-programa {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--core-gap, 24px);
    margin-bottom: var(--core-gap, 24px);
}

/* ── Cards ──────────────────────────────────────────────────────────────── */

/* Logótipo do programa como imagem do card: contido, não recortado. */
.fundo-card--logo [class*="-card__img"] {
    object-fit: contain;
    padding: 12%;
    background: #fff;
}

.fundo-card__label {
    font-weight: 600;
}

/* Estado calculado (por iniciar / em execução / concluída) — texto branco ≥ 7:1 */
.fundo-estado {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: var(--core-font-size-base, 1rem);
    font-weight: 600;
    line-height: 1.6;
    color: #fff;
    background: #003764; /* azul escuro — 12.6:1 */
}

.fundo-estado--em-execucao { background: #155724; } /* verde escuro — 7.4:1 */
.fundo-estado--concluida   { background: #4a4a4a; } /* cinza — 8.9:1 */

/* ── Detalhe ────────────────────────────────────────────────────────────── */
.fundo-detalhe > * + * {
    margin-top: var(--core-gap, 24px);
}

.fundo-detalhe__objetivo {
    font-size: var(--core-font-size-lg, 1.125rem);
    line-height: 1.6;
}

.fundo-ficha {
    width: 100%;
    border-collapse: collapse;
}

.fundo-ficha th,
.fundo-ficha td {
    padding: 10px 12px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid #d0d0d0;
}

.fundo-ficha th {
    width: 40%;
    font-weight: 600;
}

@media (max-width: 600px) {
    .fundo-ficha,
    .fundo-ficha tbody,
    .fundo-ficha tr,
    .fundo-ficha th,
    .fundo-ficha td {
        display: block;
        width: 100%;
    }

    .fundo-ficha th {
        padding-bottom: 0;
        border-bottom: 0;
    }
}
