/*---------------------------------------------------------------------------
  Copyright 2013 Microsoft Corporation.
 
  This is free software; you can redistribute it and/or modify it under the
  terms of the Apache License, Version 2.0. A copy of the License can be
  found in the file "license.txt" at the root of this distribution.
---------------------------------------------------------------------------*/

/* ---------------------------------------------------
   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 (as long as the class names are different)
----------------------------------------------------*/

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

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

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

.toc {
  margin-top: 1em;
}

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

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

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

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

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

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

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

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

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

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

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


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

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

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

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

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

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

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

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


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


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

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

.bibitem-before {
  display: none;
}

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

.bibliography {
}

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

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

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

.hidden {
  display: none;
}

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

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


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

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

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

.titleblock table {
  width: 80%;
}

.authorblock .author {
  display: block;
  font-size: large;
}

.authorblock .email {
  font-family: monospace;
}

/* Lists */

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

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

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

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

/* Tables */
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 */
.input-mathpre .MathJax_Display, .input-mathpre .math-display {
  text-align: left !important;
}

div.input-mathpre {
  margin-top: 1.5ex;
  margin-bottom: 1ex;
}


/*---------------------------------------------------------------------------
  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: "Times New Roman", serif;
  font-size: 100%;
}

.pretty td {
  padding: 0em;
}
.pretty td.empty {
  width: 0.25em;
}
.pretty .token.identifier         { font-style: italic }
.pretty .token.constructor        { font-style: italic }


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

body.madoko.preview {
  padding: 0em 2em 0em 2em !important;
}

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

/* style h5 and h6 headers a bit better */
.madoko h5, .madoko h6 {
  margin-top: 0.5em;
  margin-bottom: 0pt;
  font-size: 100%;
}
.madoko h5+p {
  margin-top: 0.5em;
}
.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 {
  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;
}

/* ---------------------------------------------------
   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 {
    margin-left: 1em;
    margin-right: 1em;
  }
}
