/**
 * @file
 * Cards: boxes with a light shadow, inserted with the editor's Card
 * button. Each card is a <div class="stats-card">. Cards that follow one
 * another in a page body sit side by side and wrap onto new rows; everything
 * else in the body keeps its full width.
 */
.stats-card {
  border: 1px solid #ddd;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.stats-card > :first-child {
  margin-top: 0;
}

.stats-card > :last-child {
  margin-bottom: 0;
}

/* Consecutive cards share a row equally (two take half each, three a third,
   four a quarter) and wrap when a card would be narrower than 11rem, so
   phones get one per row. Everything else in the body keeps a full row of
   its own. */
.field--name-body:has(> .stats-card) {
  display: flex;
  flex-wrap: wrap;
  column-gap: 1.25rem;
}

.field--name-body:has(> .stats-card) > * {
  flex: 0 0 100%;
  min-width: 0;
}

.field--name-body:has(> .stats-card) > .stats-card {
  flex: 1 1 11rem;
}

/* Above phone widths, a card left alone on a wrapped row takes half the
   width, like a pair, rather than stretching across the page. */
@media (min-width: 576px) {
  .field--name-body:has(> .stats-card) > .stats-card {
    max-width: calc(50% - 0.625rem);
  }
}
