/* ************** */
/* *** Fonts  *** */
/* ************** */

/* Font size tricks from https://www.madebymike.com.au/writing/precise-control-responsive-typography/ 
 * The font size will be adjusted to the screen size.
 * */
 :root{
  font-size: 16px;
}

/* the min width is calculated as:
 * font-size / ( number of viewport units / 100 )
 * it means 16 / (1.5/100)
 */
@media (min-width: 1200px){
  :root {
    font-size: 1.5vw;
  }
}

/* Maximal font size should be 24px, so stop font scalling at some point (24 / (1.5/100)) */

@media (min-width: 1500px){
  :root {
    font-size: 18px;
  }
}

/* ************** */
/* *** Layout *** */
/* ************** */

body{
  /* max-width:52rem; */
  margin:0;
  padding:0;
}

@media screen and (min-width: 65rem) {
  body{
    overflow-y: hidden;
    position: relative;
    min-height: 100%;
  }
  main.main-content, div.footnotes{
    width:44.89em;
    justify-self: center;
  }
  nav.TOC:not(main.main-content nav.TOC){
    width: 232px;
    overflow-y: auto;
    left: 0;
    top: 0;
    height: 100vh;
    position: fixed;
  }
  div.main, div.titlepage{
    display: grid;
    position: fixed;
    top: 50px;
    left: 250px;
    right: 0;
    bottom: 0;
  }
  div.titlepage{
    display: initial;
  }
  div.book-header{
    background-color: white;
    border-bottom: 1.5px solid rgba(0,0,0,.07);
    position: fixed;
    height: 50px;
    left: 250px;
    right: 0px;
    top: 0;
    z-index: 1;
  }
  html.translated-ltr div.book-header, html.translated-ltr div.book-header,
  html.translated-ltr nav.TOC, html.translated-ltr nav.TOC,  
  html.translated-ltr div.main, html.translated-ltr div.main {
     margin-top: 39px; }
  div.book-header a{
    float: right;
    display: block;
    color: black;
    text-align: center;
    padding: 14px 25px;
    text-decoration: none;
  }
  div.book-header a.item:hover {
    background: #17181a;
    color: #cecfd0;
  }
}


/* ****************** */
/* *** Formatting *** */
/* ****************** */

p.indent, p.noindent{
  grid-row: 2;
}

div.book-cover{
  display: flex;
  justify-content: center;
  height: 10rem;
  padding-bottom: 1rem;
  padding-top: 1rem;
}

div.book-cover img{
  height: inherit; 
  border-radius: 20px; 
  max-width: max-content;
}

p.indent, p.noindent{text-indent:0}
figure.texsource, figure.shellcommand, figure.htmlsource, figure.luasource, figure.textsource{
  margin:0.5rem 0; 
  padding-left:0.5rem; 
  overflow:auto;
}
figure pre.listings{font-size: 1em;}

.chapterToc, .sectionToc, .subsectionToc{margin:0;padding:0;}
nav.TOC{
  padding:0.5rem;
  font-size:0; /* trick to remove vertical space above TOC entries */
}

 .chapterToc ~ .likesectionToc, .chapterToc ~ .sectionToc, .likechapterToc ~ .likesectionToc, .likechapterToc ~ .sectionToc {padding-left:2em;margin-left:0}
 .chapterToc ~ .likesectionToc ~ .likesubsectionToc, .chapterToc ~ .likesectionToc ~ .subsectionToc, .chapterToc ~ .sectionToc ~ .likesubsectionToc, .chapterToc ~ .sectionToc ~ .subsectionToc, .likechapterToc ~ .likesectionToc ~ .likesubsectionToc, .likechapterToc ~ .likesectionToc ~ .subsectionToc, .likechapterToc ~ .sectionToc ~ .likesubsectionToc, .likechapterToc ~ .sectionToc ~ .subsectionToc {padding-left:4em;margin-left:0;}

nav.TOC span{
  display:inherit;
  margin-top:0;
  font-size:0.8rem;
  text-align: left;
}

main.main-content nav.TOC span, main.main-content nav.TOC span a{
  margin-top:0;
  text-align: left;
  hyphens: none;
  display: inline;
}

main.main-content nav.TOC div.book-cover, main.main-content nav.TOC span.chapterToc a{
  height: 0px;
  font-size: 0px;
  padding-bottom: 0;
  padding-top: 0;
}

nav.TOC span.likechapterToc a{
  font-size: 0px;
}

nav.TOC a, nav.TOC a:visited{
  text-decoration:none;
  font-size: 0.8rem;
}

nav.crosslinks-top, nav.crosslinks-bottom{
  display:flex;
  justify-content: space-between;
}

table.equation tbody tr{
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

table.equation tbody tr td.eq-no{
  position: absolute;
  right: 0;
  width: auto;
}

dt.enumerate-enumitem span.textbf{
  color: white;
}

html:not(.translated-ltr) body {
  top: 0px !important; 
  }
html:not(.translated-ltr) body > .skiptranslate {
  display: none;
}

#google_translate_element{
  position: fixed;
  right: 0.5em;
  bottom: 0.5em;
  z-index: 10;
}

span.next{
  visibility: hidden;
}

/* span.next{
  visibility: hidden;
} */


/* ************** */
/* *** Colors *** */
/* ************** */

body{background-color: white;} 

main.main-content, div.footnotes{
  background-color:white;
  padding: 0.5em;
}

nav.TOC,nav.TOC a, nav.TOC a:visited{
  background-color:#17181a;
  color:#cecfd0;
}

main.main-content nav.TOC, main.main-content nav.TOC a, main.main-content nav.TOC a:visited{
  background-color: white;
  color: black;
  overflow-y: hidden;
}

main.main-content nav.TOC span:hover, main.main-content nav.TOC span:hover *{
  background-color:#b0b5b1;
}

nav.TOC span:hover, nav.TOC span:hover *{
  background-color:#66635d;
}

figure.texsource, figure.shellcommand, figure.htmlsource, figure.luasource, figure.textsource{
  border:1px solid #cec1aa; 
  background-color:#d5e3c6;
}