@import url("https://fonts.googleapis.com/css2?family=Lato:ital,wght@0,400;0,700;1,400;1,700&family=Roboto:ital,wght@0,700;1,300&display=swap");

:root {
  --book-accent: #00b7ff;
  --book-accent-dark: #00a5e6;
  --book-ink: #343a40;
}

/* Match the typography and color system used by Causal Inference: The Mixtape. */
body {
  color: var(--book-ink);
  font-family: "Lato", sans-serif;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
}

h1,
h2,
h3 {
  color: var(--book-ink);
  font-family: "Roboto", sans-serif;
  letter-spacing: normal;
}

h1,
h1.title {
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.2;
}

h2 {
  border-bottom: 0;
  font-size: 1.5rem;
  margin-top: 2rem;
  padding-bottom: 0;
}

h3 {
  font-size: 1.25rem;
}

a {
  color: var(--book-accent);
  text-underline-offset: initial;
}

a:hover,
a:focus,
div.sidebar-item-container .active,
div.sidebar-item-container .show > .nav-link,
div.sidebar-item-container .sidebar-link > code {
  color: var(--book-accent-dark) !important;
}

/* Reproduce Mixtape's wide floating three-column grid on desktop. */
@media (min-width: 1240px) {
  body.floating .page-columns {
    display: grid;
    gap: 0;
    grid-template-columns:
      [screen-start] 1.5em
      [screen-start-inset] 5fr
      [page-start] minmax(25px, 50px)
      [page-start-inset] minmax(50px, 150px)
      [body-start-outset] minmax(25px, 50px)
      [body-start] 4em
      [body-content-start] minmax(500px, calc(800px - 3em))
      [body-content-end] 4em
      [body-end] minmax(25px, 50px)
      [body-end-outset] minmax(50px, 150px)
      [page-end-inset] minmax(25px, 50px)
      [page-end] 5fr
      [screen-end-inset] 1.5em
      [screen-end];
  }
}

#quarto-sidebar {
  border-right: 0;
}

.sidebar-title {
  color: var(--book-ink);
  font-family: "Lato", sans-serif;
  font-size: 1.3rem;
  font-weight: 400;
  letter-spacing: normal;
  line-height: 1.23;
  padding-bottom: 0;
}

.sidebar-title a {
  color: var(--book-ink);
  font-weight: 400;
}

.sidebar-navigation .sidebar-item a {
  border-left: 0;
  color: #595959;
  font-family: "Lato", sans-serif;
  font-size: 0.925rem;
  font-weight: 400;
  line-height: 1.081081;
  padding-bottom: 0;
  padding-top: 0;
}

.sidebar-navigation .sidebar-item a.active {
  border-left: 0;
  color: var(--book-accent-dark);
  font-weight: 400;
}

#quarto-margin-sidebar {
  border-left: 0;
  padding-left: 0;
}

#toc-title,
#TOC .nav-link {
  font-family: "Lato", sans-serif;
}

#toc-title {
  color: var(--book-ink);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.2;
}

#TOC .nav-link {
  color: var(--book-ink);
  font-size: 0.875rem;
  line-height: 1.257143;
  padding: 0.2rem 0 0.2rem 0.6rem;
}

#TOC .nav-link:hover,
#TOC .nav-link.active {
  color: #2761e3 !important;
}

main.content {
  max-width: none;
}

#title-block-header {
  border-bottom: 0;
  margin: -1px 0 1rem;
  padding-bottom: 0;
}

main.content p,
main.content ul,
main.content ol {
  margin-bottom: 1rem;
}

.citation-box {
  border: 2px solid #9e9e9e;
  border-radius: 4px;
  margin: 1rem 0 2rem;
  padding: 0.5rem 1rem;
}

.citation-box h3 {
  font-size: 1.15rem;
  margin: 0.35rem 0 0.65rem;
}

.citation-box p:last-child {
  margin-bottom: 0.5rem;
}

blockquote {
  border-left: 0.25rem solid #e9ecef;
  color: var(--book-ink);
  font-size: inherit;
  margin: 0 0 1rem;
  padding: 0 1rem;
}

.page-navigation {
  border-top: 0;
  margin-top: 2rem;
  padding-top: 0;
}

.nav-page-text,
.nav-page .bi {
  color: var(--book-accent);
}

/* Use one consistent size for every MathJax expression. */
mjx-container {
  font-size: 16px !important;
}

mjx-container[jax="CHTML"][display="true"],
.math.display {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.1rem 0;
}

@media (max-width: 991.98px) {
  main.content {
    max-width: none;
  }
}
