/* ---------------------------------------------------
   Various settings to display madoko elements correctly.
   For example, lines in tables or a table of contents.

   All rules use specific madoko classes and never just
   a generic element. This means one can safely include
   this CSS into any web page without affecting non-madoko
   content.
----------------------------------------------------*/

/* The table of  contents */
.madoko .toc>.tocblock .tocblock .tocblock {
  margin-left: 2.5em;
}

.madoko .toc>.tocblock .tocblock {
  margin-left: 1.7em;
}

.madoko .toc>.tocblock>.tocitem {
  font-weight: bold;
}

.madoko .toc {
  margin-top: 1em;
}

/* Paragraphs */
.madoko p.para-continue {
  margin-bottom: 0pt;
}

.madoko .para-block+p {
  margin-top: 0pt;
}

.madoko ul.para-block, .madoko ol.para-block {
  margin-top: 0pt;
  margin-bottom: 0pt;
}

.madoko ul.para-end, .madoko ol.para-end {
  margin-bottom: 1em;
}

.madoko dl {
  margin-left: 0em;
}

.madoko blockquote {
  font-style: italic;
}

/* Local page links do not get an underline unless hovering */
.madoko a.localref {
  text-decoration: none;
}
.madoko a.localref:hover {
  text-decoration: underline;
}

/* Footnotes */
.madoko .footnotes {
  font-size: smaller;
  margin-top: 2em;
}

.madoko .footnotes hr {
  width: 50%;
  text-align: left;
}

.madoko .footnote { 
  margin-left: 1em;
}
.madoko .footnote-before {
  margin-left: -1em;
  width: 1em;
  display: inline-block;
}

/* Abstract */
.madoko .abstract>p:first-child:before {
  content: "Abstract. ";
  font-weight: bold;
}

.madoko .abstract {
  margin-left: 2.7em;
  margin-right: 2.7em;
  font-size: small;
}


/* Alignment */
.madoko .align-center, .madoko .align-center>p {
  text-align: center !important;
}

.madoko .align-center pre {
  text-align: left;
}

.madoko .align-center>* {
  margin-left: auto !important;
  margin-right: auto !important;
}

.madoko .align-left, .madoko .align-left>p {
  text-align: left !important;
}

.madoko .align-left>* {
  margin-left: 0pt !important;
  margin-right: auto !important;
}

.madoko .align-right, .madoko .align-right>p {
  text-align: right !important;
}

.madoko .align-right>* {
  margin-left: auto !important;
  margin-right: 0pt !important;
}

.madoko .align-center>table,
.madoko .align-left>table,
.madoko .align-right>table {
  text-align: left !important;
}


/* Equations, Figure's etc. */
.madoko .equation-before {
  float: right;
}


/* Bibliography */
.madoko .bibitem {
  font-size: smaller;
}

.madoko .bib-numeric .bibitem {
  margin-left: 3em;
  text-indent: -3em;
}

.madoko .bibitem-before {
  display: none;
}

.madoko .bib-numeric .bibitem-before {
  display: inline-block;
  width: 3em;
  text-align: right;
}

.madoko .bibliography {
}

.madoko .bibsearch {
  font-size: x-small;
  text-decoration:none;
  color: black;
  font-family: "Segoe UI Symbol", Symbola;
}

/* General */
.madoko .block, .madoko .figure, .madoko .bibitem, .madoko .equation, .madoko div.math {
  margin-top: 1ex;
  margin-bottom: 1ex;
}

.madoko .figure {
  padding: 0.5em;
  margin-left: 0pt;
  margin-right: 0pt;
}

.madoko .hidden {
  display: none;
}

.madoko .invisible {
  visibility: hidden;
}

.madoko.preview .invisible {
  visibility: visible;
  opacity: 0.5;
}

.madoko code.code, .madoko span.code {
  white-space: pre-wrap;
}

.madoko hr, hr.madoko {
  border: none;
  border-bottom: black solid 1px;
  margin-bottom: 0.5ex;
}

.madoko .framed>*:first-child {
  margin-top: 0pt;
}
.madoko .framed>*:last-child {
  margin-bottom: 0pt;
}


/* Title, authors */
/*
.madoko .title {
  font-size: xx-large;
  font-weight: bold;
  margin-bottom: 1ex;
}

.madoko .subtitle {
  font-size: x-large;
  margin-bottom: 1ex;
  margin-top: -1ex;
}

.madoko .titleblock>* {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.madoko .titleblock table {
  width: 80%;
}

.madoko .authorblock .author {
  font-size: large;
}

.madoko .titlenote {
  margin-top: -0.5ex;
  margin-bottom: 1.5ex;
}
*/

/* Lists */

.madoko ul.list-star {
  list-style-type: disc;
}

.madoko ul.list-dash {
    list-style-type: none !important;
}

.madoko ul.list-dash > li:before {
    content: "\2013"; 
    position: absolute;
    margin-left: -1em; 
}

.madoko ul.list-plus {
  list-style-type: square;
}

/* Tables */
.madoko table.madoko {
  border-collapse: collapse;
}
.madoko td, .madoko th {
  padding: 0ex 0.5ex;
  margin: 0pt;
  vertical-align: top;
}

.madoko .cell-border-left {
  border-left: 1px solid black;
}
.madoko .cell-border-right {
  border-right: 1px solid black;
}


.madoko thead>tr:first-child>.cell-line,
.madoko tbody:first-child>tr:first-child>.cell-line {
  border-top: 1px solid black;
  border-bottom: none;
}

.madoko .cell-line, .madoko .cell-double-line {
  border-bottom: 1px solid black;
  border-top: none;
}

.madoko .cell-double-line {
  border-top: 1px solid black;
  padding-top: 1.5px !important;
}


/* Math Pre */
.madoko .input-mathpre .MathJax_Display {
  text-align: left !important;
}

.madoko div.input-mathpre {
  text-align: left;
  margin-top: 1.5ex;
  margin-bottom: 1ex;
}

.madoko .math-rendering {
  color: gray;
}

/* Math */
.madoko .mathdisplay {
  text-align: center;
}


/*---------------------------------------------------------------------------
  Default style for syntax highlighting
---------------------------------------------------------------------------*/

.highlighted                        { color: black; }
.highlighted .token.identifier      { }
.highlighted .token.operators       { }
.highlighted .token.keyword         { color: blue }
.highlighted .token.string          { color: maroon } 
.highlighted .token.string.escape   { color: gray }
.highlighted .token.comment         { color: darkgreen }
.highlighted .token.comment.doc     { font-style: normal }
.highlighted .token.constant        { color: purple; }
.highlighted .token.entity          {  }
.highlighted .token.tag             { color: blue }
.highlighted .token.info-token      { color: black }
.highlighted .token.warn-token      { color: black }
.highlighted .token.error-token     { color: darkred }
.highlighted .token.debug-token     { color: gray }
.highlighted .token.regexp          { color: maroon }
.highlighted .token.attribute.name  { color: navy }
.highlighted .token.attribute.value { color: maroon }
.highlighted .token.constructor     { color: purple }
.highlighted .token.namespace       { color: navy }
.highlighted .token.header          { color: navy }
.highlighted .token.type            { color: teal } 
.highlighted .token.type.delimiter  { color: teal; } 
.highlighted .token.predefined      { color: navy }
.highlighted .token.invalid         { border-bottom: red dotted 1px }
.highlighted .token.code            { color: maroon }
.highlighted .token.code.keyword    { color: navy }
.highlighted .token.typevar         { font-style: italic; }

.highlighted .token.delimiter   {  } /* .[curly,square,parenthesis,angle,array,bracket] */
.highlighted .token.number      {  }    /* .[hex,octal,binary,float] */
.highlighted .token.variable    {  }  /* .[name,value]  */
.highlighted .token.meta        { color: navy }      /* .[content] */

.highlighted .token.bold            { font-weight: bold; }
.highlighted .token.italic          { font-style: italic; }


/* Pretty formatting of code */
.madoko pre.pretty, .madoko code.pretty { 
  font-family: Cambria,Times,Georgia,serif;
  font-size: 100%;
}

.madoko .pretty table {
  border-collapse: collapse;
}
.madoko .pretty td {
  padding: 0em;
}
.madoko .pretty td.empty {
  min-width: 1.5ex;
}
.madoko .pretty td.expander {
  width: 100em;
}
.madoko .pretty .token.identifier         { font-style: italic }
.madoko .pretty .token.constructor        { font-style: italic }


/* ---------------------------------------------------
   Styling for full documents
----------------------------------------------------*/
body.madoko {
  font-family: Cambria,"Times New Roman","Liberation Serif","Times",serif;
  -webkit-text-size-adjust: 100%;       /* so math displays well on mobile devices */
  text-rendering: optimizeLegibility;
}

body.madoko {
  max-width: 88ex; /* about 88 characters */
  margin: 1em auto;
  padding: 0em 2em;  
}

body.preview.madoko {
  padding: 0em 1em;
}

.madoko p,
.madoko li {
  text-align: justify;
}

/* style headings nicer, especially h5 and h6 */
.madoko h1, .madoko h2, .madoko h3, .madoko h4 { 
  margin-top: 1.22em; 
  margin-bottom: 1ex;
}
.madoko h1+p, .madoko h2+p, .madoko h3+p, .madoko h4+p, .madoko h5+p  { 
  margin-top: 1ex;    
}
.madoko h5, .madoko h6 { 
  margin-top: 1ex;
  font-size: 1em;
}
.madoko h5 { 
  margin-bottom: 0.5ex;
}
.madoko h5 + p {
  margin-top: 0.5ex;
}
.madoko h6 { 
  margin-bottom: 0pt;
}
.madoko h6 + p {
  margin-top: 0pt;
}


/* Fix monospace display (see http://code.stephenmorley.org/html-and-css/fixing-browsers-broken-monospace-font-handling/) */
.madoko pre, .madoko code, .madoko kbd, .madoko samp, .madoko tt, .madoko .monospace, .madoko .token.indent, .madoko .reveal pre, .madoko .reveal code, .madoko .email {
  font-family: Consolas,"Andale Mono WT","Andale Mono",Lucida Console,Monaco,monospace,monospace;
  font-size: 0.85em;
}
.madoko pre code, .madoko .token.indent {
  font-size: 0.95em;
}

.madoko pre code {
  font-family: inherit !important;
}

/* Code prettify */
.madoko ol.linenums li {
  background-color: white;
  list-style-type: decimal;
}

/* Merging */
.madoko .remote {
  background-color: #F0FFF0;
}
.madoko .remote + * {
  margin-top: 0pt;
}

/* ---------------------------------------------------
   Print settings
----------------------------------------------------*/

@media print {
  body.madoko {
    font-size: 10pt;
  }
  @page {
    margin: 1in 1.5in;
  }
}

/* ---------------------------------------------------
   Mobile device settings
----------------------------------------------------*/

@media only screen and (max-device-width:1024px) {
  body.madoko {
    padding: 0em 1em;
  }
}
