/* tables.css — tabular data presentations: definition lists (.kv),
   ledger tables (.ledger) used on every listing page, finding triage
   cards (federation feed / moderation queue), and one-off cell tweaks. */

/* key/value: a two-column dt/dd block for compact metadata */
.kv { display: grid; grid-template-columns: auto 1fr; gap: 0.1rem 0.9rem; margin: 0.3rem 0 0; }
.kv dt { color: var(--grey); font-size: 12px; }
.kv dd { margin: 0; font-size: 12px; }

/* ledger: the project's listing table style — tight, uppercase headers,
   monospace numerals, hover striping. */
table.ledger {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  margin: 1rem 0;
}
.ledger th, .ledger td {
  text-align: left;
  padding: 0.3rem 0.6rem;
  border-bottom: 1px solid var(--hair);
  white-space: nowrap;
}
.ledger th {
  border-bottom: 1px solid var(--ink);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 10.5px;
  color: var(--grey);
}
.ledger tr:hover td { background: var(--surface-2); }
/* purls/identifiers have no spaces, so allow a break anywhere rather than let a
   long one (a deb NVRA, a sha256 digest) force the table wide and scroll. */
.ledger td.purl { font-weight: 600; white-space: normal; overflow-wrap: anywhere; }
/* Checksums/digests (sha512 SRI, sha256 hex) are long unbreakable tokens; let
   them wrap rather than force the table wider than the sheet and scroll the page
   (which also desyncs the fixed detail-map tree). */
.ledger td.hash { white-space: normal; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.ledger td.num { text-align: right; font-variant-numeric: tabular-nums; }
/* Cells holding long prose or identifiers: wrap instead of forcing the table
   wide, and top-align so multi-line rows read cleanly. */
.ledger td.wrap, .ledger td.advisory, .ledger td.comp { white-space: normal; overflow-wrap: anywhere; vertical-align: top; }
.ledger td.advisory { max-width: 34rem; line-height: 1.45; padding-top: 0.45rem; padding-bottom: 0.45rem; }
.ledger td.comp { max-width: 22rem; }
/* leads table: let the message column wrap */
.ledger td.lead-msg { white-space: normal; max-width: 28rem; color: var(--grey); }

/* action cell: keep multiple inline-forms (e.g. trust + delete) on one row with
   compact, content-width buttons. button.more is width:100% for full-width form
   contexts (the token/signup forms); in a table cell that would stack the
   buttons vertically and blow out the column — override it back to auto here. */
.ledger td.actions { white-space: nowrap; }
.ledger td.actions .inline-form { display: inline-flex; gap: 0.3rem; margin: 0; }
.ledger td.actions .inline-form + .inline-form { margin-left: 0.3rem; }
.ledger td.actions button.more { width: auto; }

/* license cell: a compound SPDX expression (esp. rpm — "GPL-2.0-or-later AND
   LGPL-2.1-or-later AND …") is long and has no spaces to break on cleanly, so it
   blows out the column. Cap the width, break anywhere, and clamp the chip to two
   lines with an ellipsis; the full expression is in the title on hover. */
.ledger td.lic { max-width: 16rem; }
.ledger td.lic .chip {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: normal;
  overflow-wrap: anywhere;
  max-width: 100%;
  vertical-align: bottom;
}

/* admin finding triage cards: a readable per-finding list (federation feed,
   community moderation queue, embargo console) instead of a cramped table. */
.findings { margin-top: 1rem; }
.finding { border-top: 1px solid var(--hair); padding: 0.85rem 0; }
.finding:first-child { border-top: none; }
.finding-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.45rem; }
.finding-head .purl { font-weight: 600; overflow-wrap: anywhere; }
.finding-meta { margin-left: auto; font-size: 11px; color: var(--grey); }
.finding-body { margin: 0.45rem 0 0; max-width: 74ch; line-height: 1.5; overflow-wrap: anywhere; }
.finding-actions { margin-top: 0.55rem; display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: stretch; }
.finding-actions .inline-form { margin: 0; display: inline-flex; align-items: stretch; gap: 0.3rem; }
.finding-actions .inline-form button { white-space: nowrap; }
.finding-actions input[type=text] { font-family: inherit; font-size: 12px; padding: 2px 7px; line-height: 1.2; }

/* advisory "more"/"less" inline disclosure toggle (htmx-expanded summary cell):
   the house button idiom (mono, hair border, ink-on-hover inversion, dimmed
   while the htmx request is in flight), compacted for inline use next to text. */
.adv-toggle {
  font-family: inherit; font-variation-settings: var(--mono); font-size: 11px;
  color: var(--ink); background: var(--paper); border: 1px solid var(--hair);
  padding: 0.05rem 0.4rem; cursor: pointer; white-space: nowrap;
  vertical-align: baseline; margin-left: 0.25rem;
}
.adv-toggle:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.htmx-request .adv-toggle { opacity: 0.5; }

/* inherited-advisories expand: the per-dependency advisory list lazy-loaded under
   a row of the compressed inherited table. Indented, hairline-separated entries
   so a dependency's CVEs read as a sub-list, not another full table. */
.inh-detail:not(:empty) { margin-top: 0.45rem; }
ul.inh-cves { list-style: none; margin: 0; padding: 0; }
ul.inh-cves li { padding: 0.35rem 0; border-top: 1px solid var(--hair); }
ul.inh-cves li:first-child { border-top: none; }
.inh-cve-summary { margin-top: 0.2rem; line-height: 1.45; max-width: 60ch; }

/* table-controls: the filter-chip row + search box above a paged table
   (advisories, contents). Filter chips reuse .chip (the active one is
   .chip-strong); the search input is a compact mono field that hx-swaps the
   tbody as you type. */
.table-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin: 0.6rem 0 0.2rem; }
.filter-chips { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.table-controls input[type=search] {
  margin-left: auto; font-family: inherit; font-variation-settings: var(--mono);
  font-size: 12px; padding: 0.15rem 0.5rem; border: 1px solid var(--hair);
  background: var(--paper); color: var(--ink); min-width: 14rem;
}
.table-controls input[type=search]:focus { outline: none; border-color: var(--ink); }

/* "show more" pager row: the house mono toggle (.adv-toggle) centered in a
   table-footer row. Shared by the keyset load-more partial and the per-section
   paged tables, so pagination reads the same everywhere. */
.pager-row td { text-align: center; padding: 0.5rem 0.6rem; }
.pager-row:hover td { background: none; }
