/* Blog: the post pages and their hub only. This sheet is linked from
   page-post*.hbs and page-posts*.hbs, never from default.hbs, because every
   globally loaded stylesheet counts against the home payload ratchet
   (scripts/audit-web.mjs).
   The doc stack (support.css) already owns the prose, the headings and the rail;
   this file adds only what a data page needs: numbered findings, a scrollable
   table, the citation card and a readable dateline. */

.rd-dateline {
  margin: 0 0 var(--space-lg);
  color: var(--color-muted);
}

.rd-findings {
  counter-reset: rd-finding;
  margin: var(--space-sm) 0 0;
  padding: 0;
  list-style: none;
}

.doc-content .rd-findings > li {
  counter-increment: rd-finding;
  position: relative;
  margin: 0 0 var(--space-lg);
  padding-left: var(--space-2xl);
}

.doc-content .rd-findings > li::before {
  content: counter(rd-finding);
  position: absolute;
  inset-inline-start: 0;
  color: var(--color-muted);
  font-weight: var(--fw-bold);
  font-variant-numeric: tabular-nums;
}

.doc-content .rd-findings p {
  margin: 0;
  font-size: var(--fs-lead);
  line-height: var(--lh-body);
  color: var(--color-heading);
  text-wrap: pretty;
}

/* The anchor rides the shared text paint as a word at the end of the finding,
   like any link in copy; the caption step is what keeps it from competing with
   the sentence it cites. It stays an inline box on purpose: a padded 44px box
   moves the paint's dotted baseline ~20px under the label. */
.rd-anchor {
  font-size: var(--fs-caption);
  white-space: nowrap;
}

.rd-table-wrap {
  overflow-x: auto;
  margin: var(--space-md) 0 var(--space-xl);
}

/* Six numeric columns cannot fit a phone, so the table scrolls; the fade is what
   says so, because a row cut mid-header reads as a broken layout. */
@media (max-width: 760px) {
  .rd-table-wrap {
    mask-image: linear-gradient(90deg, #000 86%, transparent);
  }
}

.rd-table {
  width: 100%;
  min-width: 32rem;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.rd-table th,
.rd-table td {
  padding: var(--space-xs) var(--space-sm);
  border-bottom: 1px solid var(--color-border);
  text-align: end;
  white-space: nowrap;
}

.rd-table thead th {
  color: var(--color-muted);
  font-size: var(--fs-caption);
  font-weight: var(--fw-bold);
  text-align: end;
}

/* The label column aligns with the rows under it, not with the figures. */
.rd-table thead th:first-child {
  text-align: start;
}

.rd-table th[scope="row"] {
  text-align: start;
  color: var(--color-heading);
  font-weight: var(--fw-regular);
}

.rd-flag {
  margin-inline-end: var(--space-xs);
}

/* The citation is a frame, so it wears the ring: the soft face reads as a card in
   light and the hairline is what separates it from the page in dark, where the
   surface token sits a few points off the background. */
.rd-cite {
  --ring-face: var(--surface-soft);
  margin: var(--space-md) 0 var(--space-2xl);
}

.rd-cite > .ring-face {
  padding: var(--space-lg) var(--space-xl);
}

.doc-content .rd-cite p:last-child {
  margin-bottom: 0;
}

.rd-cite-line {
  overflow-wrap: anywhere;
}

.rd-cite-meta {
  margin: var(--space-xs) 0 0;
}

/* The close of the series. Three columns so the hub keeps the middle whether
   the post opens the series, closes it, or sits between two others; each side
   names its column, because auto-placement would give a missing previous to the
   hub. The hairline is the same one the tables use to separate, not a frame. */
.rd-series {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  gap: var(--space-lg);
  margin: var(--space-2xl) 0 0;
  padding-top: var(--space-lg);
  border-top: 1px solid var(--color-border);
}

.rd-series-link {
  display: flex;
  flex-direction: column;
  gap: var(--space-3xs);
  min-height: 44px;
  text-decoration: none;
}

.rd-series-prev {
  grid-column: 1;
}

.rd-series-hub {
  grid-column: 2;
  justify-content: center;
  text-align: center;
}

.rd-series-next {
  grid-column: 3;
  align-items: flex-end;
  text-align: end;
}

.rd-series-caption {
  color: var(--color-muted);
}

.rd-series-title {
  color: var(--color-heading);
  text-wrap: balance;
}

.rd-series-link:hover .rd-series-title {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

@media (max-width: 760px) {
  .rd-series {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }

  .rd-series-prev,
  .rd-series-hub,
  .rd-series-next {
    grid-column: 1;
    align-items: flex-start;
    justify-content: flex-start;
    text-align: start;
  }
}
