/* row-click.css - the affordance for the clickable row (09/08).
 *
 * Its own file for the reason base.html documents for congress.css,
 * lifecycle.css, hover-chart.css and signal.css: the whole of "the row
 * is clickable" is one script and these few rules, so the feature is
 * reverted by deleting two files and two lines rather than by picking
 * declarations back out of a 30 KB shared stylesheet that other work is
 * in flight on.
 *
 * IT LOADS AFTER style.css AND STILL DOES NOT WIN BY DEFAULT - the trap
 * quorum.css documents at length. `table.leaderboard a` is 0-1-2 and
 * beats any bare one-class rule here whatever the load order. Nothing
 * below tries to repaint text inside a row for exactly that reason; the
 * cursor and the row background are both properties of the <tr> itself,
 * which no rule elsewhere owns.
 */

/* The pointer is the affordance. Scoped to rows that CARRY a symbol, so
 * the anonymous call-to-action row and any future full-width row are
 * untouched - they are not clickable and must not claim to be. */
tr[data-symbol] {
  cursor: pointer;
}

tr[data-symbol]:hover {
  background: var(--bg-hover, #1a1a17);
}

/* ARCHIVED ROWS GET A DIFFERENT HOVER, and the difference is the point.
 *
 * lifecycle.css already returns an archived row to full opacity on
 * hover: that state means "you are looking at this", and it existed
 * before the row was clickable. Now that hovering ALSO means "clicking
 * here navigates", the two would be indistinguishable if the row simply
 * brightened - a reader could not tell the de-emphasis lifting from the
 * click target lighting up.
 *
 * So the archived hover plate is deliberately fainter than the ordinary
 * one. Both say "this row is the target"; only one of them also has to
 * survive being read through 0.55 opacity, and a full --bg-hover plate
 * under an attenuated row reads as a different colour rather than as the
 * same highlight.
 *
 * Two class-and-attribute selectors (0-2-1) beat the rule above (0-1-1),
 * so this holds regardless of source order. */
tr.row-archived[data-symbol]:hover {
  background: rgba(255, 255, 255, 0.035);
}

/* NO :focus-visible RULE, AND NO tabindex TO GO WITH IT. The row is not
 * focusable and must not become so - see the header comment in
 * row-click.js. The symbol link inside it is focusable, leads to the
 * same URL, and already gets its outline from style.css's accessibility
 * floor. Adding a focus style here would be the first half of a change
 * whose second half doubles every tab stop in the table. */

/* A coarse pointer has no hover and no reason to be told about one. The
 * click handler still works on touch - a tap on dead space navigates,
 * which is the behaviour asked for - but the cursor and the plate are
 * pointer affordances and are simply noise without a pointer. */
@media (hover: none), (pointer: coarse) {
  tr[data-symbol] {
    cursor: auto;
  }
}
