/* ============================================================
   Key figures — the container owns the grid and the gap; the cards carry no
   margin. Ported from the mockup's .metrics / .metric (styles/lithography.css
   + the light treatment in styles/product.css).

   Deltas from the mockup, deliberate:
     · the default grid FITS the number of cards (auto-fit) instead of always
       cutting four tracks, so three cards fill the row instead of leaving a
       hole. The mockup's fixed four is still available as columns: 4;
     · the label is --color-text-muted, not --color-text-subtle. The mockup's
       own product.css already made that fix (5.7:1 vs 2.8:1 against the card);
       the hero copy of the row had been left behind on the failing value.
   ============================================================ */
.vt-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 18px;
  margin: 0;
  /* The row spans its column. Not optional: a section's content stack is a
     flex column with align-items: flex-start (that is how the atoms above stay
     shrink-to-fit and follow --vt-align), so without this the grid collapses to
     one 160px track and four cards stack into a 1164px-tall hero. */
  width: 100%;
}
.vt-metrics--cols-2 { grid-template-columns: repeat(2, 1fr); }
.vt-metrics--cols-3 { grid-template-columns: repeat(3, 1fr); }
.vt-metrics--cols-4 { grid-template-columns: repeat(4, 1fr); }

/* ---- the card edge: the ROW decides, the card reads ----
   inc/card-border.php carries the full argument. In short: the edge lives on an
   inherited custom property so the `Card border` toggle can reach the cards
   from the container — a .vt-metric is a DIFFERENT block rendering its own
   wrapper, so the row cannot put a class on it. :where() drops the dark
   restatement to (0,1,0), which leaves the bare rule at (0,2,0) winning in any
   source order rather than by luck of the load order (trap 2). */
.vt-metrics                             { --vt-card-edge: var(--color-border); }
:where(.vt-section.is-dark) .vt-metrics { --vt-card-edge: color-mix(in srgb, #ffffff 14%, transparent); }
.vt-metrics.vt-cards-bare               { --vt-card-edge: transparent; }

.vt-metric {
  /* the value reads first and the label sits under it, but the DOM order is
     label then value — a <dt> must precede its <dd>, and "True-4K pixels:
     8.85 MP" is also the more useful reading order out loud */
  display: grid;
  grid-template-rows: auto auto;
  gap: 6px;
  margin: 0;
  padding: 18px 16px;
  /* the fallback keeps a card rendered outside its row on the mockup's hairline */
  border: 1px solid var(--vt-card-edge, var(--color-border));
  border-radius: var(--radius-lg);
  background: var(--color-bg-subtle);
}
.vt-metric__value {
  grid-row: 1;
  margin: 0;                        /* <dd> carries a UA margin-inline-start */
  font-family: var(--font-display);
  font-weight: var(--fw-medium);
  font-size: clamp(18px, 2cqi, 22px);
  letter-spacing: -0.01em;
  color: var(--vt-fg, var(--color-text));
}
.vt-metric__label {
  grid-row: 2;
  margin: 0;
  font-family: var(--font-body);
  font-size: max(11px, var(--fs-floor, 0px));
  font-weight: var(--fw-bold);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--vt-fg-muted, var(--color-text-muted));
}

/* On a dark section the card is a whisper of white instead of a grey panel.
   Written here rather than in the theme because the element is the block's own;
   `.vt-section.is-dark .vt-metric` (0,3,0) out-specifies `.vt-metric` (0,1,0),
   so it wins whatever order WordPress inlines these sheets in. The EDGE is not
   here — it comes down from the row above, so the toggle governs both bands. */
.vt-section.is-dark .vt-metric {
  background: color-mix(in srgb, #ffffff 4%, transparent);
}

/* Phones: four tracks become two, whatever was asked for. Last, so it beats
   the --cols-* modifiers on equal specificity. */
@container vt-section (max-width: 980px) {
  .vt-metrics,
  .vt-metrics--cols-3,
  .vt-metrics--cols-4 { grid-template-columns: repeat(2, 1fr); }
}
