/* A list's heading row stays in view while its rows scroll under it, on both
 * interfaces, until the whole table has scrolled past. list_head.js sets what
 * a stylesheet cannot work out for itself; a rule only one interface needs
 * belongs in that interface's own stylesheet instead.
 *
 * --lms-sticky-top is the height of any bar fixed at the top of the screen,
 * which the heading stops below. --lms-list-head-row-top places each row of
 * the heading under the one before it, allowing for the borders the table
 * keeps behind. */
.lms-list-head > tr > th {
    position: sticky;
    top: calc(var(--lms-sticky-top, 0px) + var(--lms-list-head-row-top, 0px));
    z-index: 2;
}

/* A sticky cell holds to the nearest box that scrolls, and the box that
 * scrolls a wide table sideways never scrolls down, so it stops scrolling
 * while its table fits. It still keeps its margins apart from the table's. */
.table-container.table-container-fits {
    display: flow-root;
    overflow: visible;
}

/* A collapsed border stays behind with the table when its cell sticks, so a
 * stuck heading draws its own underline in the same colour, with a shadow
 * to lift it off the rows. */
.lms-list-head-stuck > .lms-list-head > tr > th {
    box-shadow:
        inset 0 calc(-1 * var(--lms-list-head-edge-width, 1px)) 0 var(--lms-list-head-edge, #ddd),
        0 3px 4px -2px rgba(0, 0, 0, 0.25);
}
