/* Summary list — key/value pairs, one row per pair, as in the Figma
   check-your-answers block: bold key in a fixed column, plain value beside it,
   16px gaps, no dividers. Built on a <dl>. Mobile-first: rows stack the key
   above the value; from tablet up they lay out as two grid columns. */

.govbb-summary-list {
  display: flex;
  flex-direction: column;
  gap: var(--govbb-space-s);
  margin: 0;
  font-size: var(--govbb-font-size-body);
  line-height: var(--govbb-line-height-base);
}

.govbb-summary-list__row {
  display: flex;
  flex-direction: column;
  gap: var(--govbb-space-xxs);
}

.govbb-summary-list__key {
  font-weight: 700;
}

/* Keys and values carry what users typed (emails, references): break rather
   than overflow the column. The columns are fixed tracks, so this is enough. */
.govbb-summary-list__key,
.govbb-summary-list__value {
  overflow-wrap: break-word;
}

/* <dd> carries a default indent — remove it. */
.govbb-summary-list__value,
.govbb-summary-list__actions {
  margin: 0;
}

.govbb-summary-list__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--govbb-space-s);
}

@media (--tablet) {
  /* Fixed key column width from the Figma check-answers block; in a column
     narrower than ~600px it falls back to a share of the width. The value
     track has a zero minimum so an unbreakable value wraps inside it rather
     than widening the row. */
  .govbb-summary-list__row {
    display: grid;

    /* 15.125rem = the comp's 242px, in rem so it tracks text zoom */
    grid-template-columns: min(15.125rem, 40%) minmax(0, 1fr);
    gap: var(--govbb-space-s);
    align-items: start;
  }

  /* Rows with actions gain a third column at the right edge, capped at a
     fifth of the row so a long action label wraps instead of starving the
     value. */
  .govbb-summary-list__row:has(> .govbb-summary-list__actions) {
    grid-template-columns: min(15.125rem, 40%) minmax(0, 1fr) fit-content(20%);
  }
}
