/* Global module - Stats */

/* Optional heading above the stats (title + text); hidden when both are empty. */
.el-stats-head {
    max-width: 1080px;
    margin: 0 auto clamp(32px, calc(32px + 12 * (100vw - 1280px) / 640), 44px);
    text-align: center;
}

.el-stats-head h2 {
    margin: 0 0 clamp(14px, calc(14px + 6 * (100vw - 1280px) / 640), 20px);
}

.el-stats-head p {
    margin: 0 0 12px;
    font-size: clamp(17px, calc(17px + 2 * (100vw - 1280px) / 640), 19px);
    line-height: 1.6;
    color: var(--el-color-muted);
}

.el-stats-head p:last-child {
    margin-bottom: 0;
}

.el-stats-list {
    display: grid;
    grid-template-columns: minmax(0, 432fr) minmax(0, 398fr) minmax(0, 388fr) minmax(0, 400fr) /* design column widths */;
    margin: 0;
    padding: 12px 0 44px;
    list-style: none;
    border-radius: 24px;
    background: linear-gradient(180deg, #fbfcfd, #f5f7f9);
}

.el-stats-item {
    padding: 0 clamp(12px, 2.7vw, 52px) 0 clamp(16px, 3.6vw, 70px);
}

.el-stats-item + .el-stats-item {
    border-left: 1px solid #e2e7ec;
}

.el-stats-number {
    margin: 0;
    font-family: var(--el-font-heading);
    font-size: clamp(56px, 4.6vw, 88px);
    line-height: 1;
    color: var(--el-color-navy);
}

/* Count-up (global_stats.js): the real number stays in the text, transparent; the count is drawn on top. */
.el-stats-number.is-counting {
    position: relative;
    -webkit-text-fill-color: transparent;
}

.el-stats-number.is-counting::after {
    content: attr(data-count);
    position: absolute;
    top: 0;
    left: 0;
    white-space: nowrap;
    -webkit-text-fill-color: currentColor;
}

/* Words next to the number ("38 programs"): smaller, no count-up (global_stats.php, global_stats.js). */
.el-stats-number span {
    font-size: 0.4375em;
    opacity: 0.875;
}

/* Image in the number spot: as tall as a number, keeps its own width. */
.el-stats-number.is-image {
    display: flex;
    align-items: flex-end;
    height: clamp(56px, 4.6vw, 88px);
}

.el-stats-img {
    width: auto;
    max-width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: left bottom;
}

/* Orange line under the number (a span, so it also shows when a stat has no number or title). */
.el-stats-line {
    display: block;
    width: 30px;
    height: 3px;
    margin: 20px 0;
    background: var(--el-color-orange);
}

.el-stats-line:first-child {
    margin-top: 0;
}

/* h3 in the outline; sized like the design (the h4 scale), not the h3 scale. */
.el-stats-title {
    margin: 0 0 12px;
    font-family: var(--el-font-heading);
    font-size: clamp(20px, 1.35vw, 26px);
    font-weight: 400;
    line-height: 1.2;
    color: var(--el-color-heading);
}

.el-stats-note {
    margin: 0;
    font-size: 17px;
    color: var(--el-color-muted);
}

/* Whole note as a link (Note Link field) */
.el-stats-note-link {
    color: inherit;
}

/* Links typed in the note */
.el-stats-note a:not(.el-stats-note-link) {
    font-weight: 600;
    color: var(--el-color-blue-dark);
    text-decoration: underline;
    text-decoration-color: var(--el-color-orange);
    text-underline-offset: 4px;
}

/* Fewer than 4 stats (desktop): equal columns across the full width, instead of the 4-column design widths */
@media (min-width: 992px) {
    .el-stats-list.is-cols-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .el-stats-list.is-cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .el-stats-list.is-cols-1 {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 991px) {
    .el-stats-list {
        grid-template-columns: repeat(2, 1fr);
        row-gap: 40px;
    }

    .el-stats-item:nth-child(odd) {
        border-left: 0;
    }
}

@media (max-width: 575px) {
    .el-stats-list {
        grid-template-columns: 1fr;
        row-gap: 0;
        padding: 8px 0;
    }

    .el-stats-item,
    .el-stats-item + .el-stats-item {
        padding-block: 28px;
        border-left: 0;
    }

    .el-stats-item + .el-stats-item {
        border-top: 1px solid #e2e7ec;
    }

    .el-stats-line {
        margin: 16px 0 20px;
    }

    .el-stats-line:first-child {
        margin-top: 0;
    }
}

/* Wide screens: the card runs past the content edge, as in the design. */
@media (min-width: 1600px) {
    .el-stats-list {
        margin-inline: -80px -48px; /* design card: 134px to 1752px at 1920 */
    }
}
