

/* ************** */
/* *** 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: 20px;
  }
}

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

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



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

main.main-content{
  #padding:1rem;
}

p.indent, p.noindent{text-indent:0}
/* code{font-size:1.4rem;} */
/* figure pre.listings{font-size: 1.4rem;} */
figure.texsource, figure.shellcommand, figure.htmlsource{
  margin:0.5rem; 
  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:1em;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:2em;margin-left:0;}

nav.TOC span{
  display:block;
  margin-top:0;
  font-size:0.8rem;
}

nav.TOC a, nav.TOC a:visited{
  text-decoration:none;
}


pre {
  white-space: pre-wrap;
  word-wrap: break-word;
  text-align: justify;
}

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


/* body{background-color:#dce8d0;} */
/* It seems that dark background is better to my eyes */
body{background-color:#313d63;} 

main.main-content, div.maketitle{
  background-color:white;
  margin-left: 20%;
  padding: 0px 40px;
  max-width:48rem;
  min-height: 100vh;
 }


nav.TOC{
  background-color:#22211f;
  color:#cec1aa;
  height: 96%;
  width: 20%;
  position: fixed;
  z-index: 1;
  overflow-x: hidden;
  top: 0;
}

nav.TOC a, nav.TOC a:visited{
  background-color:#22211f;
  color:#cec1aa;
}

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


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


@media screen and (max-width: 37rem) {
 main.main-content, div.maketitle{
    max-width:40rem;
    margin-left: 0;
}
 nav.TOC{
    min-height:80vh;
    position:unset;
    width: 100%;
  }
}

.footer {
  left: 0;
  bottom: 0;
  width: 100%;
  background-color: #22211f;
  color: white;
  text-align: center;
  font-size:0.7rem;
}

