@import url("./tokens.css");
@import url("./branding.css");

.reveal {
  font-family: "Source Sans Pro", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --course-body-font-size: 25px;
  --course-code-font-size: 22px;
  --math-block-margin: 0.32em;
  --math-display-margin: 0.08em;
}

.reveal h1,
.reveal h2 {
  font-family: "Source Sans Pro", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  letter-spacing: 0;
  font-size: 1em;
}

/* Preserve a strict visual hierarchy across the entire course. */
.reveal h3 {
  font-size: 0.76em;
  line-height: 1.1;
}

.reveal h4 {
  font-size: 0.68em;
  line-height: 1.1;
}

.reveal .slides section#title-slide {
  height: 100%;
}

.reveal .slides section#title-slide .title {
  color: #111;
  letter-spacing: 0;
}

.reveal .slides section.slide {
  top: 0 !important;
  height: 100%;
  display: flex !important;
  flex-direction: column;
  justify-content: flex-start;
}

.reveal .slides section.slide > h2:first-child {
  flex: 0 0 auto;
  margin-top: 0.05em;
  margin-bottom: 0.2em;
  width: 100%;
  box-sizing: border-box;
  position: relative;
  display: block;
  padding-left: 4.95em;
  line-height: 1.08;
  text-align: left;
  user-select: text;
  -webkit-user-select: text;
}

.slide-title-logo {
  position: absolute;
  left: 0;
  top: 25%;
  width: 3.45em;
  height: 1.3em;
  transform: translateY(-50%);
  object-fit: contain;
  object-position: left center;
  user-select: none;
  -webkit-user-select: none;
}

.slide-title-text {
  display: block;
  width: 100%;
  white-space: normal;
  word-break: keep-all;
  overflow-wrap: normal;
  writing-mode: horizontal-tb;
  user-select: text;
  -webkit-user-select: text;
}

.reveal .slides section.slide > .slide-body {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: visible;
  box-sizing: border-box;
  padding-top: 0.05em;
  padding-bottom: 0.18em;
}

.reveal section.slide > .slide-body > p,
.reveal section.slide > .slide-body > ul,
.reveal section.slide > .slide-body > ol,
.reveal section.slide > .slide-body > blockquote,
.reveal section.slide > .slide-body > .incremental {
  font-size: var(--course-body-font-size);
  line-height: 1.12;
}

.reveal section.slide > .slide-body :is(p, li, blockquote):not(.viz-demo *) {
  font-size: var(--course-body-font-size);
  line-height: 1.12;
}

.reveal section.slide > .slide-body li {
  margin-top: 0.12em;
  margin-bottom: 0.12em;
}

.reveal div.sourceCode,
.reveal div.sourceCode > pre,
.reveal div.sourceCode > pre > code.sourceCode {
  background: var(--viz-paper) !important;
}

.reveal div.sourceCode > pre {
  font-size: var(--course-code-font-size);
  line-height: 1.20;
}

.reveal div.sourceCode > pre > code.sourceCode {
  max-height: none;
  overflow: visible;
  font-size: 1em;
  line-height: inherit;
}

.reveal table {
  width: auto;
  max-width: 100%;
  margin: 0.28em auto !important;
  border-collapse: collapse;
  border-spacing: 0;
  border-top: 2px solid #111;
  border-bottom: 2px solid #111;
  font-size: 0.72em;
  line-height: 1.22;
  color: #111;
  background: transparent;
  font-variant-numeric: tabular-nums;
}

.reveal table thead {
  border-bottom: 1px solid #111;
}

.reveal table th,
.reveal table td {
  padding: 0.30rem 1rem;
  border: 0 !important;
  background: transparent !important;
  vertical-align: middle;
}

.reveal table th {
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
}

.reveal table tbody tr:last-child td {
  border-bottom: 0 !important;
}

.reveal table td:first-child,
.reveal table th:first-child {
  text-align: left;
}

.reveal section.slide p:has(> .math.display) {
  margin-top: var(--math-block-margin);
  margin-bottom: var(--math-block-margin);
  font-size: 0.64em !important;
  line-height: 1.02 !important;
}

.reveal .math.display {
  margin-top: var(--math-display-margin);
  margin-bottom: var(--math-display-margin);
  font-size: 0.96em !important;
  line-height: 1.02 !important;
}

.reveal .MathJax_Display,
.reveal mjx-container[display="true"] {
  font-size: 96% !important;
  margin-top: var(--math-display-margin) !important;
  margin-bottom: var(--math-display-margin) !important;
}

.reveal section.slide > .slide-body > p .math.inline {
  font-size: 0.94em;
}
