/* Cascading Style Sheet for RsML 1.0
   Copyright (C) 2025, Jing Huang <RadioNoiseE@gmail.com> */

@import "font.css";

::selection {
    background-color: #bdbdbd;
    color: white;
}

body {
    font-family: LAT-SF, serif;
    font-size: 1em;
    line-height: 1.4;
    margin: auto;
    max-width: 56em;
}

.title,
.subtitle {
    text-align: right;
}

.subtitle {
    font-style: italic;
    margin-left: 0;
    margin-top: -.67em;
}

.status {
    font-family: LAT-MS, monospace;
}

.status,
.abstract {
    margin: 0 1.6em;
}

.toc a {
    text-decoration: none;
}

.toc .chapno::after,
.toc .secno::after {
    content: '.';
}

@media only screen and (min-width: 84em) {
    body {
        margin-left: calc(50vw - 24em);
    }

    #lot {
        font-size: 14px;
        left: 1.6vw;
        max-height: 84vh;
        overflow-y: auto;
        position: fixed;
        top: 6vh;
        user-select: none;
        -webkit-user-select: none;
        width: 16em;
    }

    #lot h2 {
        display: none;
    }

    .toc ul,
    .toc tl {
        list-style: none;
        margin: 0;
        padding: 0;
    }

    :not(li) > .toc {
        margin-left: 2em;
    }

    .toc li {
        font-weight: bold;
    }

    .toc li:not(:first-child) {
        margin-top: .2em;
    }

    .toc > li {
        font-weight: normal;
        margin-left: 1em;
    }

    .toc > li:first-child {
        margin-top: .1em;
    }

    .toc > li:not(:first-child) {
        margin-top: 0;
    }

    .toc .chapno,
    .toc .secno {
        float: left;
        margin-left: -2em;
        white-space: nowrap;
        width: 2em;
    }

    .toc > li .secno {
        margin-left: -3em;
    }

    .toc .chapno::after,
    .toc .secno::after {
        content: normal;
    }
}

h2 {
    margin-left: -1.1em;
}

h3 {
    margin-left: -.9em;
}

mark {
    background: #eeeeee;
}

.math {
    font-family: LAT-MS, monospace;
}

code {
    background: #eeeeee;
    border-radius: .25em;
    font-family: LAT-MS, monospace;
    padding: .125em .25em;
}

.term {
    font-weight: bold;
}

.keyword {
    font-style: italic;
}

a {
    color: #000000;
}

sup a {
    text-decoration: none;
}

.left {
    margin-right: auto;
}

.center {
    margin: 0 auto;
}

.right {
    margin-left: auto;
}

dl dt {
    font-style: italic;
    font-weight: bold;
}

figure img {
    max-width: 100%;
}

figure figcaption {
    font-size: 90%;
    font-style: italic;
}

table {
    border-collapse: collapse;
}

table caption {
    margin-bottom: 6px;
}

table td,
table th {
    border: 1px solid;
    padding: 4px 8px;
}

table thead td,
table thead th {
    font-weight: bold;
}

table tbody td,
table tbody th {
    font-weight: normal;
}

table tfoot td,
table tfoot th {
    font-style: italic;
    font-weight: normal;
}

div.math {
    margin: -1em 0;
    overflow-x: auto;
    overflow-y: hidden;
}

.prewrap {
    margin-block-end: .83em;
    overflow-x: auto;
}

pre {
    display: table;
    font-family: LAT-MS, monospace;
    line-height: .9;
    margin: 0;
    table-layout: fixed;
    white-space: pre;
    width: 90%;
    word-wrap: break-word;
}

pre .line {
    display: table-row;
}

pre .ln {
    display: table-cell;
    font-size: 13px;
    text-align: right;
    user-select: none;
    -webkit-user-select: none;
    width: 1.6rem;
}

pre .nsep {
    display: none;
}

pre .ld {
    border-left: 1.6px solid;
    display: table-cell;
    padding-bottom: 4px;
    padding-left: .4em;
    padding-top: 4px;
}

pre code {
    background: inherit;
    border: none;
    padding: initial;
    word-wrap: break-word;
}

blockquote {
    border-left: 1.6px solid;
    margin-left: 1.6em;
    padding-left: .4em;
}

.note,
.tip,
.warning,
.caution {
    border: 1.6px solid;
    margin: 1.6em;
    padding: .4em;
}

.note::before,
.tip::before,
.warning::before,
.caution::before {
    font-style: italic;
    font-weight: bold;
}

.note::before {
    content: 'Note:';
}

.tip::before {
    content: 'Tip:';
}

.warning::before {
    content: 'Warning:';
}

.caution::before {
    content: 'Caution:';
}

.note p,
.tip p,
.warning p,
.caution p {
    margin: 0;
}

cite.author,
cite.year {
    font-style: normal;
}

.footnotes {
    font-size: 90%;
    margin-block-end: .83em;
    margin-left: -.85em;
    margin-top: 1.6em;
}

.footnotes hr {
    border: none;
    border-top: medium double;
    color: #000000;
    margin: 0;
    margin-bottom: .4em;
    max-width: 1.6in;
}

.footnote {
    display: flex;
    margin: .2em 0;
}

.footno {
    flex: 0 0 1.2em;
}

.footbody {
    display: inline-block;
}

@media (max-width: 60em), print {
    body {
        margin: 16px;
        width: auto;
    }

    h1, h2, h3, h4 {
        margin-left: -6px;
    }
}
