/* Figures at the top of the list pages (the metrics section).
   A grid that fits as many cards as the width allows: one per row on the
   phones, four on a wide screen. The cards stretch to the height of the
   row, so a figure with a note doesn't leave a hole next to the ones
   without it. */

.metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
    gap: .5rem;
    margin-bottom: 1rem;
}

.metrics > .card {
    height: 100%;
    margin: 0;
}

/* Inside the card: the icon, the name with its number, and the note on the
   right. The card is read from left to right and the space of a wide card
   is used instead of being left empty. */
.metrics__body {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.metrics__text {
    flex: 1 1 auto;
    min-width: 0;
}

.metrics__detail {
    flex: 0 0 auto;
    margin-left: auto;
    text-align: right;
    max-width: 45%;
    /* The note sits at the height of the number, not in the middle of the
       card: it reads as a caption of the figure. */
    align-self: flex-end;
}

/* The number keeps its line even when the label above wraps. */
.metrics__value {
    line-height: 1.2;
}

/* On the phones the figures take less room: a smaller icon and number, and
   the note goes to its own line (there is no room beside the number). */
@media (max-width: 575.98px) {
    .metrics .avatar {
        width: 2rem;
        height: 2rem;
    }

    .metrics .avatar i {
        font-size: 1.25rem !important;
    }

    .metrics__value {
        font-size: 1.35rem;
    }

    .metrics__body {
        flex-wrap: wrap;
    }

    .metrics__detail {
        flex: 1 0 100%;
        margin-left: 0;
        text-align: left;
        max-width: none;
    }
}
