/* my-gui table virtual scrolling (MG4). Behaviour: js/table-virtual.js. */

/* the script keeps the place itself: the browser's own anchoring would move it twice */
.m-table--virtual, .m-table-scroll--virtual { overflow-anchor: none; }

/* one line per cell: every row is as tall as the next */
.m-table.m-table--virtual:not(.is-cards) tbody tr:not(.m-empty-row) td { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 320px; }
.m-table--virtual tbody .m-tcell-tags { flex-wrap: nowrap; max-width: 100%; min-height: 22px; overflow: hidden; }
@media (pointer: coarse) { .m-table--virtual tbody .m-tcell-tags { min-height: 28px; } }
.m-table.m-table--virtual.m-table--locked { table-layout: fixed; }
.m-table.m-table--virtual.m-table--locked th { overflow: hidden; text-overflow: ellipsis; }

/* cards: the same fields, one line each */
.m-table.m-table--virtual.is-cards tbody tr:not(.m-empty-row) td:nth-child(n) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; overflow-wrap: normal; }
.m-table.m-table--virtual.is-cards tbody tr:not(.m-empty-row) td:empty::after { content: "\00a0"; }

/* the room of the rows that are not laid out; .is-pending: rows still on their way from the server */
.m-table tbody tr.m-vspace, .m-table tbody tr.m-vspace:hover { background: transparent; }
.m-table tbody tr.m-vspace td { padding: 0; border: 0; }
.m-table tbody tr.m-vspace.is-pending td { background: repeating-linear-gradient(transparent 0 calc(var(--m-vrow, 36px) - 1px), var(--m-line) 0 var(--m-vrow, 36px)); }
.m-table.is-cards tbody tr.m-empty-row.m-vspace:not([hidden]) { display: block; margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; }

@media print { .m-table tr.m-vspace { display: none; } }
