/* ============================================================
   TERMS TABLE  ·  .terms
   Franchise fees and terms (sections/terms.php). Copy on the left,
   a ruled table on a paper sheet on the right. Tokens only.
   On phones each row stacks: the term, then its values side by
   side under their column names. The roles in the markup keep the
   table semantics when the display changes.
   ============================================================ */

.terms__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-l);
  align-items: start;
}

.terms__body {
  display: flex;
  flex-direction: column;
  gap: var(--space-s);
}

.terms__table {
  width: 100%;
  border: var(--border);
  border-radius: var(--radius-l);
  border-collapse: separate;
  border-spacing: 0;
  background: var(--bg-ultra-light);
  overflow: hidden;
}

.terms__label {
  display: block;
  font-weight: 600;
  color: var(--text-dark);
}

.terms__note {
  display: block;
  font-size: var(--text-s);
  font-weight: 400;
  color: var(--text-dark-muted);
}

.terms__value {
  font-family: var(--font-display);
  font-size: var(--h4);
  font-weight: 600;
  font-variant-numeric: lining-nums tabular-nums;
  line-height: var(--heading-line-height);
  color: var(--secondary);
}

.terms__footnote {
  max-width: none;
  font-size: var(--text-s);
  color: var(--text-dark-muted);
}

/* Phones: stacked rows. */
@media (max-width: 575px) {
  .terms__table,
  .terms__table tbody {
    display: block;
  }

  .terms__table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .terms__table tbody tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-xs) var(--space-s);
    padding: var(--space-s);
    border-block-start: var(--border);
  }

  .terms__table tbody tr:first-child {
    border-block-start: 0;
  }

  .terms__table tbody th {
    grid-column: 1 / -1;
    text-align: start;
  }

  .terms__value {
    display: flex;
    flex-direction: column;
  }

  .terms__value[colspan] {
    grid-column: 1 / -1;
  }

  .terms__value[data-col]::before {
    content: attr(data-col);
    font-family: var(--font-body);
    font-size: var(--text-xs);
    font-weight: 600;
    letter-spacing: 0.08em;
    line-height: var(--text-line-height);
    text-transform: uppercase;
    color: var(--text-dark-muted);
  }
}

/* From 576px: a real table. */
@media (min-width: 576px) {
  .terms__table th,
  .terms__table td {
    padding: var(--space-s) var(--space-m);
    border-block-start: var(--border);
    text-align: start;
    vertical-align: middle;
  }

  .terms__table thead th {
    border-block-start: 0;
    background: var(--bg-semi-light);
    font-size: var(--text-xs);
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-dark-muted);
  }
}

@media (min-width: 992px) {
  .terms__grid {
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
    gap: var(--space-xl);
  }
}
