/* ============================================================
   SAG — row banding (2026-10-12)

   Lists in the SAG area separated their rows by a hairline only, which in dark
   mode (and, to a lesser degree, in light mode) is imperceptible. Every other
   row now gets a faint tint of the opposite polarity: darker-than-the-card in
   light mode, lighter-than-the-card in dark mode. The tint is a translucent
   overlay, so it sits on whatever surface the list is on (page, card, accordion).

   Scope: `body.sag-area` (set by base.html for the SAG / sensitive-access
   blueprints) for tables; `.sag-rows > .sag-row` for the div-based lists, which
   the templates mark explicitly. Nothing outside the SAG area changes.
   ============================================================ */

body.sag-area {
  --sag-band: rgba(0, 0, 0, 0.045);
}
html[data-bs-theme="dark"] body.sag-area {
  --sag-band: rgba(255, 255, 255, 0.06);
}

/* --- div-based lists ------------------------------------------------- */
.sag-rows > .sag-row:nth-child(even) {
  background-image: linear-gradient(var(--sag-band, rgba(0, 0, 0, 0.045)), var(--sag-band, rgba(0, 0, 0, 0.045)));
}
.sag-rows > .sag-row {
  padding-left: .5rem;
  padding-right: .5rem;
}

/* --- tables ---------------------------------------------------------- */
/* A plain table: every second row. */
body.sag-area .table > tbody:not(:has(> tr.collapse)) > tr:nth-of-type(even) > td,
body.sag-area .table > tbody:not(:has(> tr.collapse)) > tr:nth-of-type(even) > th {
  background-image: linear-gradient(var(--sag-band), var(--sag-band));
}
/* A table whose rows expand ("+"): each main row is followed by its hidden detail
   row, so the main rows sit at 1, 3, 5, 7...; band every second main row (3, 7, 11...)
   and the detail row that follows it. */
body.sag-area .table > tbody:has(> tr.collapse) > tr:nth-of-type(4n+3) > td,
body.sag-area .table > tbody:has(> tr.collapse) > tr:nth-of-type(4n+3) > th,
body.sag-area .table > tbody:has(> tr.collapse) > tr:nth-of-type(4n+4) > td,
body.sag-area .table > tbody:has(> tr.collapse) > tr:nth-of-type(4n+4) > th {
  background-image: linear-gradient(var(--sag-band), var(--sag-band));
}
/* Nested tables (the expanded event lists) keep their own plain banding off the card. */
body.sag-area .table .table > tbody > tr > td { background-image: none; }
