html, body {
    padding: 0;
    margin: 0;
}
body {
    font-size: 14px;
    line-height: 1.6em;
    text-align: justify;
    font-weight: 400;
    font-family: lp-bitter, Georgia, serif;
}

.content p, .content ul, .content ol {
    -ms-hyphens: auto;
    -webkit-hyphens: auto;
    hyphens: auto;

    hyphenate-limit-chars: 7 3 3;
}

.content p, .content ul, .content ol {
    letter-spacing: -0.02em;
    word-spacing: 0.1em;
    margin: 0 0 1em 0;
}

span.katex {
    font-size: 1.1em;
    display: inline-block;
    margin: 0 0.1em
}

div.codehilite {
    padding: 0 0.5em 0.5em 0;
}

div.codehilite pre {
    font-family: lp-iosevka, monospace;
    padding: 0 0.5em 0 0;
    /* display: inline-block is needed for horizontal scroll on narrow screens. */
    display: inline-block;
    page-break-inside: avoid;
}

@media print {
    div.codehilite pre {
        /* display: block is needed to break code blocks across pages. */
        display: block;
    }
}

a {
    color: #03B;
    /*text-decoration: underline dashed;*/
    /*text-decoration-color: #888;*/
    text-decoration: none;
}
a:visited {
    color: #606;
}
a:hover {
    text-decoration: underline;
}

h1, h2, h3, h4 {
    font-family: lp-enriqueta, Gelasio, serif;
    line-height: 1.2em;
    text-align: left;
    font-weight: normal;
    letter-spacing: -0.02em;
    margin-top: 1.2em;
    margin-bottom: 0.6em;
}

h1:first-child {
    margin-top: 1em;
}
/*
The difference between headings is not enough in theory,
but it's ok since we add numbering.
*/

h1 {
    font-size: 2.3em;
    text-align: center;
    page-break-before: always;
    margin-bottom: 1.5em;
}
h2 {font-size: 1.6em;}
h3 {font-size: 1.4em;}
h4 {font-size: 1.2em;}

sub, sup {
    line-height: 1em;
}

.footnote hr {
    margin: 0;
    visibility: hidden;
}

h1#references {
    margin: 0.75em;
    text-align: left;
}
.footer {
    text-align: center;
    padding: 2em 0 3em 0;
    margin: 0 0 5em 0;
}
.footer .authors-timeline {
    max-width: 100%;
}

.footer > a, .footer > span {
    display: inline-block;
    margin: 0em 1em;
}

.content ol {padding-inline-start: 2em;}
.content ul {padding-inline-start: 1em;}


li {
    line-height: 1.65em;
    margin-bottom: 0.3em;
}
li p:last-child {margin-bottom: 0;}

table {
    border-collapse: collapse;
    text-align: left;
    margin: 1em auto;
}

.content tbody tr:nth-child(2n + 1) {background: #F6F6F6;}
.dark .content tbody tr:nth-child(2n + 1) {background: #222;}

th {
    text-align: center;
}
th, td {
    padding: 0.3em 0.6em;
    vertical-align: baseline;
}

.content td:first-child {white-space: pre;}
.content td {white-space: pre-wrap;}

tr, th, td {border: 1px solid #CCC;}
.dark tr, .dark th, .dark td {border: 1px solid #555;}

th, td, .dark th, .dark td {border-width: 0 1px;}
tr, .dark tr {border-width: 1px 0;}

th:first-child, td:first-child {border-left: 0;}
th:last-child, td:last-child {border-right: 0;}

tr:first-child {border-top: 0;}
tbody tr:last-child {border-bottom: 0;}

.content tbody tr:hover {background: #EEE;}
.dark .content tbody tr:hover {background: #333;}

body {
    counter-reset: chapter-number, figure-number, link;
}

.content > p > img,
.content .codehilite,
.content .katex-display,
.content table {
    counter-increment: figure-number;
}

.admonition {
    page-break-inside: avoid;
}
.admonition p:first-child {
    page-break-after: avoid;
}

blockquote p:last-child {margin: 0;}

blockquote, .admonition {
    line-height: 1.5em;
    color: #222;
    border-width: 0 0 0 5px;
    border-style: solid;
}

blockquote li, .admonition li,
blockquote p, .admonition p {
    line-height: 1.5em;
}

.dark blockquote, .dark .admonition {
    color: #EEE;
}

blockquote > p, .admonition > p {
    padding: 0 1em;
}
blockquote > ul, .admonition > ol,
.admonition > ul, .admonition > ol {
    padding: 0 2em 0 2em;
}

/* Fix padding on admonitions without titles. */
blockquote p:first-child,
.admonition p:first-child {
    padding-top: 1em;
}

.admonition p.admonition-title {
    color: #000;
    font-size: 1.05em;
    padding: 0.3em 1em;
    margin: 0 0 0.8em -0.25px;
}

blockquote {
    padding: 0.3em 0;
}
blockquote, .admonition {
    margin: 1.5em auto;
    padding: 0 0 0.8em 0;
    width: calc(100% - 20px);
}

.admonition p:last-child {
    margin-bottom: 0;
}

.dark .admonition p.admonition-title {
    color: #FFF;
}

blockquote                {border-color: #AAA;}
.admonition.aside         {border-color: #AAA;}
.admonition.info          {border-color: #6AD;}
.admonition.note          {border-color: #6AD;}
.admonition.warn          {border-color: #FA4;}
.admonition.warning       {border-color: #FA4;}
.admonition.error         {border-color: #E66;}
.admonition.danger        {border-color: #E66;}
.dark blockquote          {border-color: #777;}
.dark .admonition.aside   {border-color: #777;}
.dark .admonition.info    {border-color: #48C;}
.dark .admonition.note    {border-color: #48C;}
.dark .admonition.warn    {border-color: #E80;}
.dark .admonition.warning {border-color: #E80;}
.dark .admonition.error   {border-color: #E44;}
.dark .admonition.danger  {border-color: #E44;}

.admonition.aside         .admonition-title {background: #DDD;}
.admonition.info          .admonition-title {background: #BDF;}
.admonition.note          .admonition-title {background: #BDF;}
.admonition.warn          .admonition-title {background: #FDA;}
.admonition.warning       .admonition-title {background: #FDA;}
.admonition.error         .admonition-title {background: #FBB;}
.admonition.danger        .admonition-title {background: #FBB;}
.dark .admonition.aside   .admonition-title {background: #444;}
.dark .admonition.info    .admonition-title {background: #246;}
.dark .admonition.note    .admonition-title {background: #246;}
.dark .admonition.warn    .admonition-title {background: #602D00;}
.dark .admonition.warning .admonition-title {background: #602D00;}
.dark .admonition.error   .admonition-title {background: #622;}
.dark .admonition.danger  .admonition-title {background: #622;}

.admonition .admonition-title {
    position: relative;
}
.admonition .admonition-title:after {
    content: " ";

    background-size: 1.3em 1.3em;
    height: 1.3em;
    width: 1.3em;

    display: inline-block;
    position: absolute;
    right: 0.5em;
    top: 0.35em;
}

.admonition.info .admonition-title:after,
.admonition.note .admonition-title:after {
    background-image: url('/static/info.svg');
}

.admonition.warn .admonition-title:after,
.admonition.warning .admonition-title:after {
    background-image: url('/static/warn.svg');
}

.admonition.error .admonition-title:after,
.admonition.danger .admonition-title:after {
    background-image: url('/static/danger.svg');
}
