/* Slice 2 register substrate. State and measure cells land in later entries. */

[data-register-root] {
  width: min(100%, var(--layout-box-page));
  margin-inline: auto;
  padding-block: var(--rhythm-section-compact);
  padding-inline: var(--layout-gutter);
  color: var(--theme-ink-primary);
}

.register-table-frame {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.register-table-scroll {
  max-width: 100%;
  overflow-x: auto;
}

.register-table-scroll:focus-visible {
  outline: 2px solid var(--theme-focus-ring);
  outline-offset: 2px;
}

.register table {
  width: 100%;
  border-collapse: collapse;
}

.register caption {
  padding-bottom: var(--rhythm-title-content);
  border-bottom: 1px solid var(--theme-rule-strong);
  color: var(--theme-ink-primary);
  font-family: var(--serif-display);
  font-size: var(--type-section-title-size);
  font-weight: var(--type-section-title-weight);
  letter-spacing: var(--type-section-title-ls);
  line-height: var(--type-section-title-lh);
  text-align: left;
}

.register thead {
  color: var(--theme-ink-muted);
  font-family: var(--mono);
  font-size: var(--type-label-size);
  font-weight: var(--type-label-weight);
  letter-spacing: var(--type-label-ls);
  line-height: var(--type-label-lh);
  text-transform: uppercase;
}

.register th,
.register td {
  min-width: 0;
  padding-block: var(--rhythm-row);
  border-bottom: 1px solid var(--theme-rule-subtle);
  overflow-wrap: anywhere;
  text-align: left;
}

.register tbody th,
.register tbody td {
  color: var(--theme-ink-primary);
  font-family: var(--mono);
  font-size: var(--type-metadata-size);
  font-weight: var(--type-metadata-weight);
  line-height: var(--type-metadata-lh);
}

/* A measure cell publishes one exact quantity. Directional change is the only cell that spends
   colour, and it spends the same two directional roles the fixing above the register already uses; there is no
   third status family and no new palette primitive here. */
.register [data-register-cell="measure"] { text-align: right; white-space: nowrap; }
.register [data-register-cell="measure"] data { color: inherit; }
.register [data-register-tone="up"] data { color: var(--theme-status-positive-ink); }
.register [data-register-tone="down"] data { color: var(--theme-status-negative-ink); }

.register [data-register-cell="date"] > [data-register-record-link] {
  display: inline-flex;
  align-items: center;
  min-width: 44px;
  min-height: 44px;
  color: inherit;
  text-decoration: underline;
  text-decoration-color: currentColor;
  text-underline-offset: 0.2em;
}

.register [data-register-cell="date"] > [data-register-record-link]:hover {
  color: inherit;
}

.register-foot {
  max-width: var(--layout-measure-reading);
  margin-top: var(--rhythm-title-content);
  color: var(--theme-ink-secondary);
  font-family: var(--mono);
  font-size: var(--type-provenance-size);
  line-height: var(--type-provenance-lh);
  overflow-wrap: anywhere;
}

.register-margin-note {
  color: var(--theme-ink-secondary);
  font-family: var(--mono);
  font-size: var(--type-provenance-size);
  line-height: var(--type-provenance-lh);
}

@media (prefers-reduced-motion: reduce) {
  [data-register-root],
  [data-register-root] * {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

@media print {
  [data-register-root] {
    break-inside: avoid;
    color: var(--theme-ink-primary);
  }

  .register-table-scroll { overflow: visible; }
}
