/* ==========================================================================
   ESG ODS — Grid dos Objetivos de Desenvolvimento Sustentável
   ========================================================================== */

.esg-ods {
    /* padding-top zerado: a .esg-compromisso (acima, também branca) já dá o
       respiro pelo seu padding-bottom. Evita o "buraco" do respiro dobrado. */
    padding: 0 0 clamp(69px, 5.42vw, 104px);
    background-color: var(--color-white);
}

/* ===== Header centralizado ===== */
.esg-ods__header {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: stretch;
    margin-bottom: 32px;
}

.esg-ods__label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-family: var(--font-text);
    font-weight: 400;
    font-size: var(--fs-label);
    line-height: 1.7;
    letter-spacing: -0.01em;
    color: #252B37;
    margin: 0 auto;
}

.esg-ods__line {
    display: inline-block;
    width: 71px;
    height: 0;
    border-top: 1px solid var(--color-primary);
    flex-shrink: 0;
}

.esg-ods__title {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: var(--fs-section-lg);
    line-height: normal;
    color: #252B37;
    text-align: center;
    margin: 0;
}

.esg-ods__description {
    font-family: var(--font-text);
    font-weight: 400;
    font-size: var(--fs-body);
    line-height: 1.7;
    letter-spacing: -0.01em;
    color: #414651;
    text-align: center;
    margin: 0;
}

/* ===== CTA (mesmo visual do botão "Ir para o Blog") ===== */
.esg-ods__cta-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 64px;
}

.esg-ods__cta-border {
    padding: 8px;
    border-radius: 16px;
    border: 1px solid transparent;
    background:
        linear-gradient(#FFFFFF, #FFFFFF) padding-box,
        linear-gradient(302.1deg, rgba(21, 94, 239, 0.39) 24.57%, rgba(21, 94, 239, 0) 70.33%) border-box;
}

.esg-ods__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: clamp(10px, 0.63vw, 12px);
    padding: var(--cta-pad-y) var(--cta-pad-x);
    background: #1F3A5F;
    color: var(--color-white);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: var(--cta-font);
    line-height: 1.33;
    border-radius: 12px;
    text-decoration: none;
    transition: background var(--transition-fast);
    white-space: nowrap;
}

.esg-ods__cta:hover {
    background: #2a4f7a;
}

@media (max-width: 768px) {
    .esg-ods__cta {
        padding: 16px 24px;
    }

    .esg-ods__cta-wrapper {
        margin-top: 40px;
    }
}

@media (max-width: 480px) {
    .esg-ods__cta-wrapper {
        margin-top: 32px;
    }
}

/* ===== Grid de cards ===== */
.esg-ods__grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px 13px;
    justify-content: center;
    align-items: center;
    width: 984px;
    max-width: calc(100% - 32px);
    margin: 0 auto;
}

/* ===== Card ===== */
.esg-ods__card {
    position: relative;
    flex-shrink: 0;
    width: 153px;
    height: 142px;
    border: 1px solid rgba(255, 255, 255, 0.30);
    border-radius: 8px;
    overflow: hidden;
    color: var(--color-white);
    font-family: 'Barlow Condensed', 'Inter', sans-serif;
}

/* Topo do card: número + título lado a lado (flex) */
.esg-ods__card-top {
    position: absolute;
    top: 10px;
    left: 14px;
    right: 9px;
    display: flex;
    align-items: flex-start;
    gap: 6px;
    z-index: 2;
}

.esg-ods__card-number {
    font-family: 'Barlow Condensed', 'Inter', sans-serif;
    font-weight: 600;
    font-size: var(--fs-heading-xl);
    line-height: 0.85;
    color: var(--color-white);
    letter-spacing: -0.03em;
    font-feature-settings: 'lnum' 1;
    flex-shrink: 0;
}

.esg-ods__card-title {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
    padding-top: 1px;
}

.esg-ods__card-title span {
    font-family: 'Barlow Condensed', 'Inter', sans-serif;
    font-weight: 600;
    line-height: 1;
    color: var(--color-white);
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: clip;
}

/* Variação tamanho médio (cards com texto curto/médio) */
.esg-ods__card--md .esg-ods__card-title span {
    font-size: var(--fs-caption);
    letter-spacing: -0.03em;
}

/* Variação tamanho pequeno (cards com texto longo) */
.esg-ods__card--sm .esg-ods__card-title span {
    font-size: var(--fs-caption-sm);
    letter-spacing: -0.05em;
}

/* Ícone — posicionamento absoluto na metade inferior */
.esg-ods__card-icon {
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    height: 74px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    z-index: 1;
}

.esg-ods__card-icon img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* ===== Responsivo ===== */

@media (max-width: 1024px) {
    .esg-ods {
        padding: 0 0 100px;
    }

    .esg-ods__grid {
        width: 100%;
        gap: 16px 12px;
    }

    .esg-ods__card {
        width: calc((100% - 60px) / 5);
        max-width: 153px;
        height: 142px;
    }
}

@media (max-width: 768px) {
    .esg-ods {
        padding: 0 0 80px;
    }

    .esg-ods__grid {
        gap: 12px;
    }

    /* Cards 20% menores no mobile (box, fontes, ícone e posições × 0.8) */
    .esg-ods__card {
        width: calc((100% - 24px) / 3);
        max-width: 122px; /* 153 * 0.8 */
        height: auto;
        aspect-ratio: 153 / 142;
    }

    .esg-ods__card-number {
        top: 5px;   /* 6 * 0.8 */
        left: 10px; /* 12 * 0.8 */
        font-size: calc(var(--fs-heading-xl) * 0.96); /* box 0.8, fonte +20% */
    }

    .esg-ods__card-top {
        top: 6px;   /* 8 * 0.8 */
        right: 6px; /* 8 * 0.8 */
        gap: 4px;
        width: calc(100% - 32px); /* área do texto alargada p/ caber a fonte +20% */
    }

    .esg-ods__card--md .esg-ods__card-title span {
        font-size: calc(var(--fs-caption) * 0.96); /* box 0.8, fonte +20% */
    }

    .esg-ods__card--sm .esg-ods__card-title span {
        font-size: calc(var(--fs-caption-sm) * 0.96); /* box 0.8, fonte +20% */
    }

    .esg-ods__card-icon {
        height: 48px; /* 60 * 0.8 */
        bottom: 3px;  /* 4 * 0.8 */
    }
}

@media (max-width: 480px) {
    .esg-ods {
        padding: 0 0 64px;
    }

    .esg-ods__card {
        width: calc((100% - 12px) / 2);
    }
}
