/* Overall formatting and counter stuff */

html, body {
    max-width : 100%;
    overflow-x : hidden;
}

body {
	font-family : Cambria;
	font-size : 11pt;
	overflow-y : hidden;
	counter-reset : h1 definition theorem;
}

h1 {
	counter-reset : h2; 
	font-size: 200%;
}

h1:before {
	counter-increment : h1; 
	content: "Chapter " counter(h1) ". ";
}

h2:before {
	counter-increment : h2; 
	content: counter(h1) "." counter(h2) ". ";
}

.definition:before {
	counter-increment : definition; 
	content: "Definition " counter(definition) ". ";
	font-weight: bold;
}

.theorem:before {
	counter-increment : theorem; 
	content: "Theorem " counter(theorem) ". ";
	font-weight: bold;
}

.corollary:before {
	counter-increment : theorem; 
	content: "Corollary " counter(theorem) ". ";
	font-weight: bold;
}

.lemma:before {
	counter-increment : theorem; 
	content: "Lemma " counter(theorem) ". ";
	font-weight: bold;
}

.proof:before {
	content: "Proof. ";
	font-style: italic;
}

.proof:after {
	content: "\25fb";
	float: right;
}
  
  
/* Meyer reset */
table, caption, tbody, tfoot, thead, tr, th, td {
	margin: 0;
	padding: 0;
	border: 0;
	font-size: 100%;
	font: inherit;
	vertical-align: baseline;
}
table {
	border-collapse: collapse;
	border-spacing: 0;
}

/* general table reformats */
table {
	margin-left: 2.5em;
	border: 1px solid black;
	margin-bottom:1em;
	margin-top:1em;
}

th, td {
	padding-left : 5px;
	padding-right : 5px;
	padding-top : 2px;
	padding-bottom : 2px;
}

th {
	border-bottom: 1px solid black;
}

.rightborder {
	border-right: 1px solid black;
}

.bottomborder {
	border-bottom: 1px solid black;
}

.border {
	border: 1px solid black;
}

/* A couple of special tables */

table.fancytable {
	background-color: #cdf3da;
}

table.fancytable th {
	text-align : left; 
	background-color: #80b39a;
}

table.fancytable th, table.fancytable td{
	border-left: 1px solid black;
	border-right: 1px solid black;
	padding-left: 10px;
	padding-right: 10px;
	padding-top: 2px;
	padding-bottom: 2px;
}

table.bordertable th, table.bordertable td {
	border: 1px solid black;
	padding-left: 10px;
	padding-right: 10px;
	padding-top: 2px;
	padding-bottom: 2px;
}

.noborder {
	border: none;
}


/* for centering images */
img.centered {
	margin-top : 1em;
	margin-bottom : 1em;
	display : block;
	margin-left : auto;
	margin-right : auto;
}

/* for centering images with a specific size*/
img.centered_sized {
	margin-top : 1em;
	margin-bottom : 1em;
	display : block;
	margin-left : auto;
	margin-right : auto;
	height: auto;
	width: auto;
	max-width: 600px;
}

img.centered_sized_smaller {
	margin-top : 1em;
	margin-bottom : 1em;
	display : block;
	margin-left : auto;
	margin-right : auto;
	height: auto;
	width: auto;
	transform: scale(.85,.85);
	max-width: 100%;
}

img.img_math {
	margin-top : 0em;
	margin-bottom : 1em;
	display : block;
	margin-left : auto;
	margin-right : auto;
	height: auto;
	width: auto;
	max-width: 700px;
}

/* for centering images with a specific size*/
img.img_align_env {
	margin-top : 1em;
	margin-bottom : 1em;
	display : block;
	/*transform: scale(.6, .6);*/
	max-width: 100px;
	/*
	float: left;
	text-align: left;
	margin-left: 2.5em;
	*/
	margin-left: 2.5em;
}

/* highlight background of inline code segments */
code.inline {
	/*background : #eeeeee;*/
	white-space: nowrap;
}

/* indent code segments */
pre {
  margin-left : 3em;
  /*background : #DFC; */
  /*border : 1px solid black;*/
}

/* small spacing reformats on li and h1 */
li { margin : 1em 0;}
h1 { margin-top : 2em; }

/* formatting and numbering for exercises */
#exercises {counter-reset : lictr}
  
li.ex {
    display: block;
    margin-bottom: .5em;
    margin-left: 2em;
}
  
li.ex:before {
	counter-increment : lictr;
	content : counter(lictr) ".";
	width: 2em;
	margin-left: -2em;
}

/* second level nesting of ol's to alphabetical */
ol ol { list-style-type : lower-alpha; }
ol ol ol { list-style-type : lower-roman; }

/* formatting for the table of contents menu */

ul.menulist li {
	padding : 0px;
	margin : 0px;
}

ol.menulist li a { 
	color : #005000; 
	text-decoration : none;
	display: block;
}

.contentsEntry { background-Color : #EEE; border: 1px solid #BBB;}
.contentsEntry:hover { 
	background-Color : #0EE; 
	cursor: default;
}

/* position table of contents menu on left, make it fixed and scrollable */
nav { 
	/*float : left; */
	display : inline-block;
	width : 20%;
	height : 100%;
	position : fixed;
	overflow-y : scroll;
	/*background-color : #EFE;*/
}

/* main contains the book contents */
section#main {
	/*float : left;*/
	display : inline-block;
	width : 40em;
	margin-left : 30%;
}

.paragraph {
	font-weight: bold;
	padding-top: 2em;
	padding-right: 1em;
}

.footnote_marker {
	color: blue;
}

.footnote_marker:hover {
	background-color: #dddddd;
}

.footnote_marker:active {
	background-color: yellow;
}
.footnote:active {
	background-color: yellow;
}
.footnote {
	color: red;
	display: none;
}

.indentblock {
	margin-left: 2.5em;
}

.overarrow {
	margin-left: -1.5em; 
	vertical-align: .7em; 
	margin-right: .5em;
	font-size: 80%;
}

.lightgray {
	color: #dddddd;
}

.red {
	color: red;
}

.red {
	color: green;
}
	
.theorem, .definition, .proof {
	margin-top: 2ex;
}

.proof {
	margin-bottom: 4ex;
}

.circled_text {
	border: 1px solid black;
	border-radius: 50%; 
	padding-right: .3em;
	padding-left: .3em;
}

.bigg {
	font-size: 150%;
}

.legsym {
  display: inline-grid;
  grid-template-columns: 1fr auto 1fr;
  vertical-align: .7em;
  font-size: 90%;
  margin-left: .1em;
  margin-right: .1em;
}

.legsym > span:first-of-type,
.fracline + span {
  grid-column: 2;
}

.legparttop {
	justify-self: center;
}

.legpartbottom {
	justify-self: center;
	margin-top: -.2em;
}

.fraction {
  display: inline-grid;
  grid-template-columns: 1fr auto 1fr;
  vertical-align: .5em;
  font-size: 75%; 
}

.fraction > span:first-of-type,
.fracline + span {
  grid-column: 2;
}

.fracline {
  grid-column: 1 / -1;
  height: 1px;
  background: black;
}

.fracpart {
	justify-self: center;
}

/*
.sumint {
  display: inline-grid;
  grid-template-columns: auto;
  vertical-align: 1em;
  justify-items: center;
}
*/

.sumint {
  display: inline-grid;
  grid-template-columns: auto;
  vertical-align: .65em;
  margin-left: .05em;
  margin-right: .2em;
  grid-row-gap: .2em;
}

.sumint2 {
  display: inline-grid;
  grid-template-columns: auto;
  grid-row-gap: 0em;
  vertical-align: .5em;
  margin-left: .05em;
}


.sumintlimit {
	font-size: 75%;
}

.binom {
  display: inline-grid;
  grid-template-columns: auto;
  vertical-align: .65em;
  margin-left: .05em;
  margin-right: .2em;
  grid-row-gap: .2em;
}

.binomlimit {
	font-size: 75%;
}


.overtilde {
	margin-left: -.85em; 
	vertical-align: .85em; 
	font-size: 60%;
}

sub, sup {
	font-size: 75%;
}

.math {
	margin-left: .1em;
	white-space: nowrap;
}

.indenttable {
	margin-left: 2.5em;
}

.indenttable table {
	margin-left: 0em;
}