@import url(fonts/fonts.css);

/* Generated rules from HTML.pm centralized here */
a.summary-letter {text-decoration: none}
div.display {margin-left: 0em}
div.example {margin-left: 0em}
div.indentedblock {margin-left: 0em}
div.lisp {margin-left: 0em}
div.smalldisplay {margin-left: 0em}
div.smallexample {margin-left: 0em}
div.smallindentedblock {margin-left: 0em}
div.smalllisp {margin-left: 0em}
kbd {font-style:oblique}
pre.display {font-family: inherit}
pre.format {font-family: inherit}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
span.nocodebreak {white-space:nowrap}
span.nolinebreak {white-space:nowrap}
span.roman {font-family:serif; font-weight:normal}
span.sansserif {font-family:sans-serif; font-weight:normal}
ul.no-bullet {list-style: none}

html {
  font-family: "Linux Libertine O", serif;
  font-size: 170%; /* 100% for epub */
  color: #383838;
  line-height: 130%;
  /* 'liga' turns on ligatures, 'ss06' picks alternate ampersand */
  -moz-font-feature-settings: "liga" 1, "ss06";
  -ms-font-feature-settings: "liga" 1, "ss06";
  -webkit-font-feature-settings: "liga", "ss06";
  -o-font-feature-settings: "liga", "ss06";
  font-feature-settings: "liga", "ss06";
}

@media (min-width: 481px) and (max-width: 720px) {
  html {
    font-size: 140%; /* 100% for epub */
  }
  blockquote {
    margin-left:  1em;
    margin-right: 1em;
  }
  ul.no-bullet {padding-left: 1em}
}

@media (max-width: 480px) {
  html {
    font-size: 120%; /* 100% for epub */
  }
  blockquote {
    margin-left:  0.5em;
    margin-right: 0.5em;
  }
  ul.no-bullet {padding-left: 0.6em}
}

body {
  background-color: #f8f8f8;
  margin: 0;
  position: relative;
}

section {
  margin: 1em auto;
  width: 67ex;
  max-width: 88%;
}

h1, h2, h3, h4, h5 {
  font-family: "Linux Biolinum O", sans-serif; 
  margin-top: 1.6em;
  margin-bottom: 1.0rem;
  line-height: 125%;
}

h1, h2.chapter {
  margin-top: 4em;
  margin-bottom: 2em;
}

h2.unnumbered {
  margin-top: 2.5em;
}

h3.section {
  margin-top: 2em;
}
  
strong {
  font-family: "Linux Biolinum O", sans-serif; 
}

h1 { font-size: 1.88rem; }

h1.titlefont { 
  margin-top: 5em; 
  margin-bottom: 1em; 
  line-height: 120%; 
}

/* Hide the Info style node menu that has been
   made redundant by table of contents */
h1.node-heading, 
h1.node-heading + table.menu, 
a[name="Top"] + nav.header {
  display: none; 
}

h2 { font-size: 1.57rem; line-height: 110%; }

h3 { font-size: 1.31rem; }

h4 { font-size: 1.1rem; }
h4 code { font-size: 0.88rem; }

h5 { font-size: 1rem; }
h5 code { font-size: 0.82rem; }

.chapnum {
  display: inline-block;
  font-weight: normal;
  font-size: 6.7em;
  color: #aeaece;
  height: 1ex;
  margin-top: 0.3ex;
  margin-bottom: 0.5ex;
}

.chaptitle {
  display: inline-block;
  width: 78%;
  margin-left: 1ex;
}

@media (max-width: 960px) {
  .chaptitle {
    width: 64%;
    margin-left: 0.5em;
  }
}

.secnum {
  display: inline-block;
  color: #9090c0;
  margin-right: 0.8em;
  vertical-align: top;
}

.sectitle {
  display: inline-block;
  max-width: 85%;
  vertical-align: top;
}
@media (max-width: 480px) {
  .sectitle {
    max-width: 100%;
  }
  h1, h2, h3, h4, h5 {
    line-height: 110%;
  }
}

pre, code, tt, samp {
  font-family: "Inconsolata LGC", "DejaVu Sans Mono", monospace; 
  font-size: 0.8rem;
}

pre, pre code, pre var {
  font-size: 0.77rem;
  line-height: 150%;
}

.lisp .MathJax {
  color: #606060; 
}

.roman .MathJax {
  color: #a07040; 
}

p, table.menu, div.lisp {
  margin-top: 1em;
  margin-bottom: 1em;
}

/* Allow hyphenation */
p, ol, ul {
  -ms-hyphens: auto;
  -webkit-hyphens: auto;
  -moz-hyphens: auto;
  hyphens: auto;
}
/* But not in navigation bar, imprint, contents, and references */
nav p, a#References ~ p, h1 ~ p, .shortcontents ul, .contents ul {
  -ms-hyphens: none;
  -webkit-hyphens: none;
  -moz-hyphens: none;
  hyphens: none;
}

a#UTF ~ p > i:last-child {
  display: block;
  margin-top: 0.8em;
  margin-bottom: 1.6em;
}

a[href] {
  color: #804040;
  text-decoration: none;
}

a[href] > sup {
  font-size: 78%; 
  vertical-align: top; 
  position: relative;
  top: -0.4ex;
  margin: -2ex;
  padding: 2ex;
}

a[href]:-webkit-any-link > sup {
  top: -1.0ex;
}

nav.header p {
  font-family: "Linux Biolinum O", sans-serif; 
  font-size: 0.9rem;
  padding: 0.5em;
  margin: 0;
  background-color: #f0f0f0;
}

nav.header a[href] {
  margin: -1.5ex;
  padding: 1.5ex;
}

nav.header:last-of-type {
  margin-top: 2em;
}

span.roman {
  font-family: "Linux Libertine O", serif; 
  font-size: 0.96rem;
}

figure {
  width: 100%;
  margin-top: 2em;
  margin-bottom: 1.2em;
  text-align: center;
  margin-left: 0;
  margin-right: 0;
}

figcaption {
  display: table;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5em;
  padding-right: 1.5em;
  min-width: 10em;
  margin-top: 1em;
}

figcaption p {
  text-align: left;
  margin: 0;
}

#footnote_popup {
  background-color: #ffffff;
  padding: 0 3ex;
  width: 100%;
  -webkit-box-shadow: 4px 4px 22px rgba(0,0,0,0.5);
  box-shadow: 4px 4px 22px rgba(0,0,0,0.5);
  z-index: 12;
}

@media (min-width: 481px) and (max-width: 960px) {
  #footnote_popup {
    padding-left: 3.6ex;
  }
}

@media (max-width: 480px) {
  #footnote_popup {
    padding-left: 4ex;
  }
}

#footnote_popup a.footnote_backlink {
  display: none;
}

td > a[href*="#Exercise-"], td > a[href*="#Figure-"] {
  margin-left: 1ex;
  margin-right: 1ex;
}

section > hr:nth-last-child(2) {
  margin-top: 2em;
}

div.subtitle {
  margin-bottom: 1.0em;
  text-align: left;
}

div.subtitle > abbr {
  font-size: 1.2rem;
  letter-spacing: 0.07rem;
  word-spacing: 0.07rem;
}

table.menu td {
  width: auto;
  vertical-align: top;
}

h2 ~ p:first-of-type:first-line, abbr {
  font-family: "Linux Libertine O", serif; 
  letter-spacing: 0.04em;
  -moz-font-feature-settings: "onum", "c2sc", "smcp";
  -ms-font-feature-settings: "onum", "c2sc", "smcp";
  -webkit-font-feature-settings: "onum", "c2sc", "smcp";
  -o-font-feature-settings: "onum", "c2sc", "smcp";
  font-feature-settings: "onum", "c2sc", "smcp";
}

h2 ~ p:first-of-type:first-letter {
  float: left;
  margin-top: 0.33rem;
  margin-right: 0.04em;
  margin-bottom: -0.15em;
  margin-left: -0.15ex;
  padding-left: 0;
  line-height: 0.83em;
  font-family: "Linux Libertine O", serif;
  text-transform: uppercase;
  font-weight: normal;
  font-size: 3rem;
  color: #9090c0;
}

h2 + blockquote {
  margin-top: 3em;
  margin-bottom: 3em;
}

h2.unnumbered + blockquote {
  margin-top: 2em;
  margin-bottom: 2em;
}

/* Next three blocks are adapted from:
 * http://stackoverflow.com/questions/11374059/make-an-html-svg-object-also-a-clickable-link
 * http://jsfiddle.net/WEbGd/
 */
a.cover {
  position: relative;
  z-index: 1;
}

a.cover figure {
  margin-top: 1em;
  margin-bottom: 1em;
  -webkit-box-shadow: 2px 3px 20px rgba(0,0,0,0.5);
  box-shadow: 2px 3px 20px rgba(0,0,0,0.5);
  display: inline-block;
}

a.cover object {
  position: relative;
  z-index: -1;
  width: 100%; 
  height: auto;
  background-color: #fbfbfb;
}

/* Italic correction */
var {
  padding-right: 0.16ex;
}

/* MathML fonts */
mtext {
  font-family: STIXGeneral;
}

pre math {
  font-size: 0.94rem;
}
code math {
  font-size: 1rem;
}
/* Allow linebreaks in math and inline code */
math, code {
  white-space: normal;
}
math[display="block"] {
  margin: 1em 0;
}

/* Adapted from http://mxr.mozilla.org/mozilla-central/source/layout/mathml/mathml.css?raw=1 */
mtd {
  padding-right: 0.5em;
  padding-left: 0.5em;
  padding-bottom: 0.0ex;
  padding-top: 0.0ex;
}
mtable[columnalign="right center left"] mtd {
  padding-right: 0.1em;
  padding-left: 0.1em;
}
/* turn off the spacing at the periphery of boundary cells */
mtr:first-child > mtd {
  padding-top: 0ex;
}
mtr:last-child > mtd {
  padding-bottom: 0ex;
}
mtd:first-child {
  padding-left: 0.2em;
}
mtd:last-child {
  padding-right: 0.2em;
}

/* Match x-height of roman to italic (STIX fonts) */
mtext, mi[mathvariant="normal"], mi[_moz-math-font-style="normal"] {
  font-size: 98%;
}
math *[mathvariant="monospace"] {
  font-size: 0.8rem;
  font-family: "Inconsolata LGC", monospace; 
}

.faulty {
  color: red;
  background-color: yellow;
}

a#References ~ p {
  -moz-font-feature-settings: "onum", "ss06";
  -ms-font-feature-settings: "onum", "ss06";
  -webkit-font-feature-settings: "onum" 1, "ss06" 1;
  -o-font-feature-settings: "onum", "ss06";
  font-feature-settings: "onum", "ss06";
}

@media (max-width: 960px) {
  html {
    line-height: 126%;
  }

  pre, pre code, pre var {
    line-height: 140%;
  }

  h2 ~ p:first-of-type:first-letter {
    font-size: 2.9em;
  }
}

.jump {
  font-family: "DejaVu-Arrows";
  font-size: 2rem;
  font-weight: bold;
  position: fixed; /* comment out when generating epub */
  /* display: none; */ /* uncomment for epub */
  right: 0;
  text-align: center;
}

.jump a[href] {
  color: rgba(220, 220, 220, .5);
  margin: -1.5ex;
  padding: 1.5ex;
}

.top { 
  top: 0; 
  padding: 0.7ex 0.0ex;
}

.bottom { 
  bottom: 0; 
  padding: 0.4ex 0.0ex;
}
