/* Left align everything by default! */
.reveal .slides section {
  text-align: left;
}

.centered {
  text-align: center;
}

th.rotated {
  vertical-align: bottom;
  text-align: center;
}

th.rotated span {
  -ms-writing-mode: tb-rl;
  -webkit-writing-mode: vertical-rl;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  white-space: nowrap;
}

/* Stripe odd body rows. pandoc 3 (decker 0.15) no longer emits the
 * tr.odd/tr.even classes these rules used to match, so select by position;
 * this picks the same rows pandoc 2 marked "odd". */
.alternatecolors table tbody tr:nth-child(odd) {
  background-color: #E7E7E7;
}

table.alternatecolors tbody tr:nth-child(odd) {
  background-color: #E7E7E7;
}

table.alternatecolors tbody tr:nth-child(odd) td {
  background-color: #E7E7E7;
}

.statetransition table {
  border: 1px solid #000;
}

.statetransition tbody {
  border: 0px;
}

.statetransition table tbody tr:nth-child(odd) {
  background-color: #E7E7E7;
}

.statetransition table td:nth-child(1) {
  border-right: 1px solid #000;
}

.statetransition table th:nth-child(1) {
  border-right: 1px solid #000;
}

.nobullets ul {
  list-style-type: '';
}

.checkbullets ul {
  list-style-type: '✅  ';
}

.questionbullets ul {
  list-style-type: '❓  ';
}

.tapecell {
  display: inline-block;
  border: 1px solid #000;
  text-align: center;
  width: 50px;
}

.tapecellactive {
  display: inline-block;
  background-color: var(--emphColor);
  text-align: center;
  color: #FFF;
  border: 1px solid #000;
  width: 50px;
}

/*********************************************
* special rules for dark mode
*********************************************/

@media (prefers-color-scheme: dark) {
  table {
    color: #000;
  }

  .defbox {
    color: #000;
  }

  .media .figure {
    background-color: #FFF;
  }

  .media figure {
    background-color: #FFF;
  }
}

ol {
  counter-reset: list;
}

.parenalphalist ol>li {
  list-style: none;
}

.parenalphalist ol>li:before {
  content: "(" counter(list, lower-alpha) ")  ";
  counter-increment: list;
}

/*********************************************
 * Julian: Lists without bottom margins.
 *********************************************/
/* Enable removal of margin below <ul> */
.reveal .unpaddedlists ol,
.reveal .unpaddedlists dl,
.reveal .unpaddedlists ul {
  margin-bottom: 0em;
}

.reveal .compactlist ol li,
.reveal .compactlist dl li,
.reveal .compactlist ul li {
  margin-bottom: 0.25em;
}

.reveal .indent {
  margin-left: 2em;
}

.reveal .shadowed {
  text-shadow: 2px 2px 5px #666;
}

.reveal .smallish {
  font-size: 0.9em;
}

.reveal .smallisher {
  font-size: 0.75em;
}

.reveal .huge {
  font-size: 1.5em;
}

.reveal .defbox {
  padding: 8px 16px 8px 16px;
  background-color: #f7f7f7;
  border: 4px solid var(--emphColor);
  border-radius: 5px;
  font-size: 0.95em;
  text-align: left;
  transition: all 0.25s ease;
  max-width: max-content;
  margin: auto;
}

.defbox p {
  margin: 0px;
}

.reveal .quizbox {
  padding: 8px 16px 8px 16px;
  background-color: #EEE;
  border-radius: 5px;
  font-size: 0.95em;
  text-align: left;
  transition: all 0.25s ease;
  box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.25);
}

.quizbox p {
  margin: 0px;
}

.hintbox,
.notebox,
.warnbox {
  position: absolute;
  padding: 10px;
  border-radius: 5px;
  margin: 0 auto;
  text-align: center;
  box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.25);
}

.hintbox {
  color: #fff;
  background-color: var(--emphColor);
}

.notebox {
  color: #000;
  background-color: #EEE;
}

.warnbox {
  color: #fff;
  background-color: #C00;
}

.warnbox a {
  color: #DDD;
  font-weight: bold;
}

.hintbox p,
.notebox p,
.warnbox p {
  margin: 0;
}

/* Lists inside boxes: mario.css gives every li a 40px left margin (on top of
 * the box padding) and leaves bottom margins on the list and its last item,
 * which pile up as empty space above the box's bottom edge. 1.1em is just
 * enough room for the outside bullet/number. display: block (mario makes lists
 * inline-block) keeps the list flush left in a fixed-width box rather than
 * centered by the box's text-align: center, and drops the line-box gap below
 * an inline-block. */
.reveal :is(.hintbox, .notebox, .warnbox, .defbox, .quizbox, .boxed) :is(ul, ol) {
  display: block;
  margin-bottom: 0;
}

.reveal :is(.hintbox, .notebox, .warnbox, .defbox, .quizbox, .boxed) li {
  margin-left: 1.1em;
}

.reveal :is(.hintbox, .notebox, .warnbox, .defbox, .quizbox, .boxed) li:last-child {
  margin-bottom: 0;
}

/* Same for a display equation ending a box: its 0.7em bottom margin (set
 * below for all display math) plus the 0.3em padding from MathJax's own
 * stylesheet would sit above the box's bottom edge. Pandoc puts display math
 * in a span inside the enclosing p or li. */
.reveal :is(.hintbox, .notebox, .warnbox, .defbox, .quizbox, .boxed) :last-child > .math.display:last-child > mjx-container[display="true"] {
  margin-bottom: 0;
  padding-bottom: 0;
}

.reveal .slides .withtransition .fragment {
  transition: all 0.25s ease;
}

.reveal .slides .withtransition {
  transition: all 0.25s ease;
}

.greentext {
  color: #009900;
}

.redtext {
  color: #EE0000;
}

.graytext {
  color: #999;
}

.reveal table {
  margin: 0px 0px 0px 0px;
  background-color: #F7F7F7;
}

.reveal .slides section .fragment {
  transition: all 0.25s ease;
}

/* Replace one element by another on a fragment step: once a fragment with
 * class .swap-in is visible, every .swap-out on the same slide is hidden.
 * (reveal's data-fragment-index can't do this when the slide also has
 * unindexed fragments, e.g. from .incremental: indexed ones always go first.)
 * The delay keeps the old element until the new one has faded in; stepping
 * back shows it again immediately. On an image, decker puts .swap-in on the
 * wrapping div.media but .fragment (and so .visible) on the figure inside. */
.reveal .slides section:has(.swap-in.visible, .swap-in .visible) .swap-out {
  visibility: hidden;
  transition: visibility 0s 0.25s;
}

/* Reveal scattered elements together on one fragment step: every .show-with
 * on a slide stays hidden until a fragment with class .show-trigger on the
 * same slide is visible, and every .underline-with then gets a red underline.
 * Place the trigger, e.g. an empty `[]{.fragment .show-trigger}`, where the
 * step falls in document order (same data-fragment-index limitation as
 * .swap-in above). The hidden elements keep their space, so nothing shifts. */
.reveal .slides section .show-with {
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
}

.reveal .slides section:has(.show-trigger.visible) .show-with {
  opacity: 1;
  visibility: inherit;
}

.reveal .slides section .underline-with {
  text-decoration: underline 3px transparent;
  text-underline-offset: 5px;
  transition: text-decoration-color 0.25s ease;
}

.reveal .slides section:has(.show-trigger.visible) .underline-with {
  text-decoration-color: red;
}

.reveal .ghostlist>ul {
  list-style: none;
  list-style-type: none;

  margin: 0 !important;
  /*
    margin-block-start: 0 !important;
    margin-block-end: 0 !important;
    margin-inline-start: 0 !important;
    margin-inline-end: 0 !important;
    padding-inline-start: 0 !important;
    */
}

.reveal .ghostlist>ul>li {
  margin: 0px !important;
  margin: 0 !important;
  /*
    margin-block-start: 0 !important;
    margin-block-end: 0 !important;
    margin-inline-start: 0 !important;
    margin-inline-end: 0 !important;
    padding-inline-start: 0 !important;
    */
}

/* Lay out a list's items side by side in one row, e.g. in a short strip of a
 * box: `::: { .hintbox .row-list }`. */
.reveal .row-list>ul {
  display: flex;
  column-gap: 3em;
  margin: 0;
}

.reveal .row-list>ul>li {
  margin-bottom: 0;
}

.reveal span.figcaption {
  margin: 5px 0px 0px 0px;
}

/* JP: hack around issue where figures inserted after `.col` divs
 * end up off-screen to the right rather than below */
div.media {
  display: block;
}

div.media figure {
  margin: auto;
}

.cleared {
  display: block;
  clear: left;
}

/* JP: ensure large images are resized to fit within their enclosing div rather
 * than overflowing */
.reveal img,
video {
  max-width: 100%;
}

/* Work around thin outline around some videos seen in Safari */
.reveal video {
  clip-path: inset(1px 1px);
}

div.center90 {
  width: 90%;
  margin-left: auto;
  margin-right: auto;
}

div.center80 {
  width: 80%;
  margin-left: auto;
  margin-right: auto;
}

div.center70 {
  width: 70%;
  margin-left: auto;
  margin-right: auto;
}

div.center60 {
  width: 60%;
  margin-left: auto;
  margin-right: auto;
}

/* Prevent larger margin below the mathjax display equations */
.reveal section mjx-container[display="true"] {
  margin: 0.7em 0em 0.7em 0em;
}

.reveal pre code {
  font-size: 0.5em;
}

/* Python is the main code shown in lecture, so default it larger; shrink
 * individual blocks with a font-size on a wrapping div only where needed. */
.reveal pre.python code {
  font-size: 0.65em;
}

.red {
  color: red;
}

.blue {
  color: blue;
}

.orange {
  color: darkorange;
}

.green {
  color: green;
}

.black {
  color: black;
}

.footnotes {
  font-size: 0.8em;
  text-align: left;
}


.codemask {
  position: absolute;
  background-color: #f7f7f7;
}

/* Make sure the `fade-out` fragments are not visible in the print PDF
 * (so that the fully built slide is printed) */
html.print-pdf .reveal .slides section .fragment.fade-out {
  visibility: hidden;
}

.reveal .quizcompact ul {
  margin-top: 0em;
}

.phantom {
  visibility: hidden;
}

/* decker 0.15's pandoc 3 wraps task-list checkboxes in a <label>, so
 * mario.css's `li > input` rule no longer hides them and every .quiz
 * showed its correct answers pre-checked. */
.reveal ul.task-list li > label > input[type="checkbox"] {
  display: none;
}

/* Outline one table row at a time, advancing on each click.
 * Wrap the table in `::: rowoutline` and start the first cell of every
 * row after the first with an empty `[]{.fragment .custom}`. The first
 * row is outlined when the slide appears; each click moves the outline
 * to the next marked row. */
.reveal .rowoutline tbody tr:has(.fragment.current-fragment),
.reveal .rowoutline:not(:has(tbody .fragment.visible)) tbody tr:first-child {
  outline: 4px solid var(--emphColor);
  outline-offset: -4px;
}