@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600&family=Lora:ital,wght@0,400;0,600;1,400;1,600&display=swap');

html {
  text-rendering: optimizeLegibility;
  -moz-font-feature-settings: "liga=1";
  -moz-font-feature-settings: "liga";
  -ms-font-feature-settings: "liga";
  -o-font-feature-settings: "liga";
  -webkit-font-feature-settings: "liga";
  font-feature-settings: "liga";
}

.page-inner {
  max-width: 720px !important;
}

.katex-html {
  white-space: nowrap;
}

.book.font-family-0 {
  font-family: 'Lora', serif;
}

.book.font-family-1 {
  font-family: 'Inter', sans-serif;
}

.page-wrapper p {
  text-align: justify;
}


/* TOC */

.book-summary nav ul.summary h4 {
  padding-left: 1em;
  margin: 1.16em 0;
}

.book-summary nav ul.summary li a {
  white-space: normal !important;
}

.book-summary nav ul.summary li .katex-mathml {
  position: absolute;
  clip: rect(1px, 1px, 1px, 1px);
  padding: 0;
  border: 0;
  height: 1px;
  width: 1px;
  overflow: hidden;
}


/* Header */

.book .book-header h1 {
  text-align: right !important;
  opacity: 1 !important;
}

.book-header .katex-mathml {
  position: absolute;
  clip: rect(1px, 1px, 1px, 1px);
  padding: 0;
  border: 0;
  height: 1px;
  width: 1px;
  overflow: hidden;
}


/* Book */

h1.title {
  margin-bottom: 0 !important;
}

h2.subtitle {
  margin-top: 0.25em !important;
  margin-bottom: 0 !important;
}

p.author {
  font-size: 1.5em;
  float: left;
}

p.date {
  margin-top: 0 !important;
  font-size: 1.5em;
  float: right;
}

.page-inner h1 {
  font-size: 1.75em !important;
  border-bottom: 1px solid black;
}

.page-inner h2 {
  font-size: 1.5em !important;
}

.page-inner h1,
.page-inner h2,
.page-inner h3,
.page-inner h4,
.page-inner h5 {
  font-kerning: none;
  line-height: 1.2em;
}

.page-inner code {
  font-size: 1.4rem !important;
  background-color: inherit !important;
  padding: 0;
}
.page-inner code::before,
.page-inner code::after {
  letter-spacing: 0 !important;
  content: '' !important;
}

.katex, .page-inner .katex {
  font-size: 1.1em !important;
}


/* Custom environments */

#translators-note {
  clear: both;
  padding: 0 1.5em;
  margin: 0 1.5em 1.5em 1.5em;
  border-left: 1px dashed black;
  border-bottom: 1px dashed black;
}
#translators-note p {
  text-align: left;
}

.original-citation {
  margin: 1em 1.5em;
}
.original-citation > :last-child {
  margin-bottom: 0 !important;
}

.itenv,
.rmenv {
  margin: 1em 0;
  text-align: justify;
}

.titenv,
.trmenv {
  margin: 0.5em 0;
  text-align: justify;
}

.itenv,
.titenv {
  font-style: italic;
}
.itenv em,
.titenv em {
  font-style: normal !important;
}

.rmenv,
.trmenv {
  font-style: normal;
}

.itenv::before,
.rmenv::before,
.titenv::before,
.trmenv::before {
  content: attr(title)".";
  font-style: normal;
  font-weight: bold;
  padding-right: 0.5em;
  display: inline;
}

.itenv > p,
.rmenv > p,
.titenv > p,
.trmenv > p {
  margin-top: 0.85em !important;
}

.itenv > p:first-of-type,
.rmenv > p:first-of-type,
.titenv > p:first-of-type,
.trmenv > p:first-of-type {
  margin-top: 0 !important;
  display: inline;
}

.itenv > :last-child,
.rmenv > :last-child,
.titenv > :last-child,
.trmenv > :last-child {
  margin-bottom: 0 !important;
}


/* Anchor links */

.book-body .page-wrapper .page-inner section.normal {
  overflow: visible !important; /* so anchor link doesn't get cut off */
}

a.anchor {
  float: left;
  margin-left: -35px;
  vertical-align: baseline;
  /* Icon made by Freepik from www.flaticon.com */
  height: 30px;
  width: 30px;
  background-image: url(link.png) !important;
  background-repeat: no-repeat !important;
  background-size: 20px 20px !important;
  background-position: center center !important;
  opacity: 0;
}

.book.color-theme-2 a.anchor {
  filter: invert(100%);
}

.hasAnchor:hover a.anchor,
a.anchor:hover {
  opacity: 0.6;
  /* need to figure out how to treat anchors for nested chunks */
}

@media (max-width: 800px) { /* don't show anchor link on small screens */
  .hasAnchor:hover a.anchor {
    visibility: hidden;
  }
}

h1.hasAnchor,
h2.hasAnchor,
h3.hasAnchor,
h4.hasAnchor,
h5.hasAnchor {
  border-bottom: 1px solid transparent;
}
h1.hasAnchor:hover,
h2.hasAnchor:hover,
h3.hasAnchor:hover,
h4.hasAnchor:hover,
h5.hasAnchor:hover {
  border-bottom: 1px solid gray;
}

.itenv.hasAnchor,
.rmenv.hasAnchor,
.titenv.hasAnchor,
.trmenv.hasAnchor{
  border-top: 1px solid transparent;
  border-bottom: 1px solid transparent;
}
.itenv.hasAnchor:hover,
.rmenv.hasAnchor:hover,
.titenv.hasAnchor:hover,
.trmenv.hasAnchor:hover {
  border-top: 1px solid gray;
  border-bottom: 1px solid gray;
}
