/* ==========================================================================
   Downloads — every published version, one row each.
   See docs/pages/downloads.md.
   ========================================================================== */

/* --------------------------------------------------------------- rhythm -- */

/* The page is one column of blocks, so the spacing lives here rather than on
   each block. The table is the exception: it sits tighter to the filter. */
.downloads> *+* {
    margin-block-start: var(--space-6);
}

.downloads>.table-scroll {
    margin-block-start: var(--space-4);
}

/* --------------------------------------------------------------- table -- */

/* Eight columns and 74 rows. Everything below trades width for legibility:
   nothing gets smaller than 16px, and every download stays a real target. */

.downloads__table :is(th, td) {
    padding-block: var(--space-2);
    white-space: nowrap;
}

/* The platform columns are a grid of figures — centred, so the eye reads down
   one column instead of tracking a ragged left edge. The body cells take
   `.is-center` from site.css; only the headings need a rule of their own. */
.downloads__table thead th:not(:first-child) {
    text-align: center;
}

.downloads__table thead th {
    font-size: var(--text-dense);
}

/* "32-bit", "x86_64 (deb)" — the half of the heading that separates two columns
   with the same name. It is read, so it stays at 16px on the 4.5:1 label floor
   rather than dropping to the 13px the old markup used. */
.downloads__details {
    display: block;
    margin-block-start: 2px;
    font-family: var(--font-body);
    font-size: var(--text-dense);
    font-weight: 400;
    letter-spacing: 0;
    color: var(--ice-ink-soft);
}

/* ---------------------------------------------------------- row markers -- */

/* Three signals for one fact — a wash, a brand edge and the word itself —
   because the row that matters must not be found by colour alone. The edge is
   an inset shadow: a collapsed table drops a cell's own left border, and a
   border would also shift the text by its own width. */
.downloads__table .is-current {
    background-color: var(--ice-blue-wash);
}

.downloads__table .is-current th:first-child {
    box-shadow: inset 4px 0 0 var(--ice-blue);
}

/* The beta row is marked by its pill alone — no wash, no edge. The current
   row is the one a reader is looking for and gets three signals; the beta is
   the one they should think twice about, and the word is the whole of it, on a
   page whose audience typed the URL. */

/* `.pill--brand` and `.pill--warning` carry the shape and the colour; this is
   the gap between either and the version number it follows. Never both on one
   row — `get_all_downloads()` sees to that. */
.downloads__current,
.downloads__beta {
    margin-inline-start: var(--space-2);
}

/* ----------------------------------------------------------- file links -- */

/* A cell is not a sentence, so the exemption for inline links does not apply:
   these are 46px targets, and the cell padding keeps 32px between neighbours
   across and 16px down. */
/* `.file-link` carries the shape; the padding is this table's, where a cell
   is narrow enough that the target needs widening beyond the text. */
.downloads__file {
    padding-inline: var(--space-3);
    border-radius: var(--radius-sm);
}

/* The em dash for a build that was never published. It is the quietest thing
   in the table on purpose, but it is still text on the page ground. */
.downloads__none {
    color: var(--ice-muted);
}

/* ---------------------------------------------------------- empty state -- */

/* `tbody tr:last-child` in site.css draws no bottom rule, but the last child
   here is the permanently present empty-state row — so the last row a reader
   can actually see would keep a rule that doubles the wrapper's own border.
   Two selectors for the same job: `nth-last-child(2)` is the unfiltered table,
   and holds with no JS at all; `.is-last` is whichever row the filter left at
   the bottom, and the script moves it. */
.downloads__table tbody tr:nth-last-child(2) :is(th, td),
.downloads__table tbody tr.is-last :is(th, td) {
    border-block-end: 0;
}

.downloads__empty {
    padding-block: var(--space-6);
    white-space: normal;
    color: var(--ice-muted);
}
