/* Plate supplement, the honest parts: a condition report (what is sound, pending, untested) and a
   footnote set apart from the page (the † note on how a demo runs). Generic: any plate may use them. */
@layer supplement {
  /* Known gaps (the condition report): a lede, a state table, and the repository link */
  .condition { grid-column: 4 / span 7; min-inline-size: 0; display: grid; gap: 1.25rem; align-content: start; }
  .condition__lede { font-size: var(--fs-body); line-height: 1.35; color: var(--ink-2); text-wrap: pretty; max-inline-size: 44em; }
  .condition__table {
    inline-size: 100%;
    & th, & td { padding: 0.8rem 0 0.9rem; text-align: start; vertical-align: top; border-top: 1px solid var(--hair); }
    & th {
      inline-size: 9.5rem; padding-inline-end: 1rem;
      font: 500 var(--fs-label) / 1.5 var(--mono); letter-spacing: var(--track-label); text-transform: uppercase; color: var(--ink);
      /* The state's mark: filled for sound, open otherwise, so state never rests on colour alone */
      &::before {
        content: ''; display: inline-block; inline-size: 0.6rem; block-size: 0.6rem; margin-inline-end: 0.55rem;
        border: 1.5px solid currentColor; border-radius: 50%; vertical-align: -0.02rem;
      }
    }
    & td { font: 400 var(--fs-mono) / 1.6 var(--mono); color: var(--ink-2); text-wrap: pretty; }
    & [data-state="sound"] th::before { background: currentColor; }
    & [data-state="pending"] th { color: var(--accent-text); }
    & [data-state="gap"] th { color: var(--ink-2); }
  }
  .condition__repo {
    justify-self: start; display: inline-flex; align-items: center; min-block-size: 44px;
    font: 400 var(--fs-mono) / 1.3 var(--mono); overflow-wrap: anywhere;
  }

  /* Footnote: small, honest, set apart by a dashed rule; the title carries the mark (†, ‡) */
  .footnote {
    display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--col-gap); row-gap: 1rem;
    margin-block-start: var(--section); padding-block: 1.5rem 0;
    border-top: 1px dashed var(--hair-strong);
    font: 400 var(--fs-mono) / 1.65 var(--mono); color: var(--ink-2);

    & p { grid-column: 5 / -1; max-inline-size: 78ch; text-wrap: pretty; }
  }
  .footnote__title {
    grid-column: 1 / span 4; grid-row: 1 / span 2;
    font: 400 1.6rem / 1.05 var(--serif); letter-spacing: -0.015em; color: var(--ink); text-wrap: balance;
    & i { color: var(--accent); }
  }

  @media (width < 64rem) {
    .condition { grid-column: 1 / -1; }
    .footnote__title, .footnote p { grid-column: 1 / -1; grid-row: auto; }
  }
  @media (width < 30rem) {
    .condition__table :is(tr, th, td) { display: block; }
    .condition__table th { inline-size: auto; padding-block-end: 0; }
    .condition__table td { border-top: 0; padding-block-start: 0.35rem; }
  }
}
