/* Content that would otherwise overflow the text column: long display
   equations, unbreakable bibliography URLs, and the data and frequency
   tables, including the dice and modal-row variants.

   Split out of site-theme.css; loaded in order from _quarto.yml. */

/* Long display equations scroll sideways, like responsive tables. Overflow
   that widens the layout viewport past the visual viewport detaches the
   fixed-position navigation on mobile browsers. */
mjx-container[display="true"] {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding-block: 0.15rem;
}

/* Last-resort guard for the same failure: the value propagates to the
   viewport, so stray wide content clips instead of expanding the page. */
body {
  overflow-x: hidden;
}

/* Bibliography DOI/URL strings are unbreakable by default and widen the
   page on narrow screens. */
.csl-entry {
  overflow-wrap: anywhere;
}

main table,
main table.table,
.sfs-data-table,
.sfs-frequency-table {
  width: auto;
  max-width: 100%;
  margin: 1rem auto;
  font-variant-numeric: tabular-nums;
  /* font-family: MathJax; */
}

main table caption,
.sfs-data-table caption,
.sfs-frequency-table caption {
  caption-side: top;
  color: var(--sfs-text);
  font-weight: 700;
  text-align: left;
}

main table,
main table.table,
.sfs-data-table,
.sfs-frequency-table {
  border-collapse: collapse;
  border-top: 2px solid var(--sfs-table-rule-color);
  border-bottom: 2px solid var(--sfs-table-rule-color);
}

main table th,
main table td,
.sfs-data-table th,
.sfs-data-table td,
.sfs-frequency-table th,
.sfs-frequency-table td {
  border: 0;
  vertical-align: middle;
}

main table thead,
main table.table thead,
.sfs-data-table thead,
.sfs-frequency-table thead {
  border-bottom: 2px solid var(--sfs-table-rule-color);
}

main table.table > :not(caption) > * > *,
.sfs-data-table.table > :not(caption) > * > *,
.sfs-frequency-table.table > :not(caption) > * > * {
  border-width: 0;
}

main table th,
.sfs-data-table th {
  font-weight: 700;
}

.sfs-table-summary-row td {
  color: var(--sfs-muted);
}

/* Match the row and column dice in Chapter 6. These are the same red and blue
   used by the first two dice on the chapter cover. */
#tbl-dice-sums {
  --sfs-die-red-text: rgb(209 64 79);
  --sfs-die-blue-text: rgb(51 120 176);
}

#tbl-dice-sums thead th:not(:first-child) {
  color: var(--sfs-die-blue-text);
}

#tbl-dice-sums tbody td:first-child {
  color: var(--sfs-die-red-text);
}

body.quarto-dark #tbl-dice-sums {
  --sfs-die-red-text: color-mix(in srgb, rgb(209 64 79) 72%, white);
  --sfs-die-blue-text: color-mix(in srgb, rgb(51 120 176) 72%, white);
}

/* Mark a modal row in static frequency tables without coupling the styling
   to a particular row number. The heavier type keeps the cue from relying on
   color alone. */
.sfs-mode-table tbody tr:has(.sfs-mode-marker) > * {
  background: var(--sfs-highlight-bg);
  font-weight: 700;
}

/* The two-by-two table of hypothesis-test decisions against the actual
   situation in Chapter 9. Errors use the critical-region red so they match
   the power figures. */
.sfs-decision-table {
  --sfs-decision-correct-color: #2e8b57;
}

body.quarto-dark .sfs-decision-table {
  --sfs-decision-correct-color: #6fcf97;
}

.sfs-decision-table th,
.sfs-decision-table td {
  text-align: center;
}

.sfs-decision-table tbody th:not(.sfs-decision-side) {
  text-align: right;
}

.sfs-decision-table .sfs-decision-side {
  writing-mode: vertical-rl;
  text-orientation: sideways;
  transform: rotate(180deg);
}

.sfs-decision-table .sfs-decision-error {
  color: var(--sfs-critical-color);
}

.sfs-decision-table .sfs-decision-correct {
  color: var(--sfs-decision-correct-color);
}

/* Shade the H0-false column: its header and the last cell of each row. */
.sfs-decision-highlight-h1 thead tr:last-child > :last-child,
.sfs-decision-highlight-h1 tbody tr > :last-child {
  background: var(--sfs-highlight-bg);
}

