.figures {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    padding: 10px;
}

.figure-container p {
    text-align: center;
    justify-content: center;
}

.figure-container p a {
    font-size: 85%;
    line-height: 1.5; /* smaller line spacing */
    display: block;   /* keeps them stacked vertically */
    margin: 0;        /* remove extra vertical margins */
}

@media (min-width: 1000px) {
    .figure-container, .text-container {
        flex-basis: calc(12.5% - 20px); /* 100% / 8 = 12.5% */
    }
}