/* =========================================================================
   Component — fact rows
   A <dl> whose dt/dd pairs are each wrapped in a <div> — valid HTML, and the
   only way to make a pair one grid item.
   ========================================================================= */

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
  margin: 0;
}

.facts dt {
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--sd-secondary);
}

.facts dd {
  margin: 0;
  font-size: 14px;
  color: var(--doc-ink-soft);
}

/* Three facts close as 3 or 1, four as 4, 2+2 or 1 (U-1954): a count of columns
   from a minimum width put three beside a lone fourth, and two beside a lone third.
   Two keep the auto-fit; six have their own columns below. */
.facts:has(> :nth-child(3):last-child),
.facts:has(> :nth-child(4):last-child) {
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .facts:has(> :nth-child(4):last-child) {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 800px) {
  .facts:has(> :nth-child(3):last-child) {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1200px) {
  .facts:has(> :nth-child(4):last-child) {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Six facts close as 3+3, 2+2+2 or 1. The auto-fit put five beside a lone
   sixth once the public measure widened to 1200 px (U-2277). */
.facts:has(> :nth-child(6):last-child) {
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .facts:has(> :nth-child(6):last-child) {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .facts:has(> :nth-child(6):last-child) {
    grid-template-columns: repeat(3, 1fr);
  }
}
