/*
   This file is part of Eighty Stylesheets, Wei's website stylesheets.

   Eighty Stylesheets is free software: you can redistribute it and/or
   modify it under the terms of the GNU General Public License as
   published by the Free Software Foundation, either version 3 of the
   License, or (at your option) any later version.

   Eighty Stylesheets is distributed in the hope that it will be
   useful, but WITHOUT ANY WARRANTY; without even the implied warranty
   of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
   General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with Eighty Stylesheets. If not, see
   <https://www.gnu.org/licenses/>.

   Copyright (c) Wei Tang, 2020.
*/

html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
    margin: 0;
    padding: 0;
    border: 0;
    font-size: 100%;
    font: inherit;
    vertical-align: baseline;
}

em {
    font-style: italic;
}

strong {
    font-weight: 500;
}

body {
    display: flex;
    flex-flow: column nowrap;
    justify-content: center;
    align-items: flex-start;
}

#content {
    width: 100%;
    flex-basis: 100%;
    display: flex;
    flex-flow: row nowrap;
    justify-content: center;
    align-items: flex-start;
}

ol, ul {
    list-style: none;
}

table {
    border-collapse: collapse;
    border-spacing: 0;
    border-top: 2px solid black;
    border-bottom: 2px solid black;
    width: 100%;
}

table > caption {
    font-size: 1.2rem;
    padding: 10px;
}

th {
    border-bottom: 1px solid black;
}

td, th {
    font-size: 1.2rem;
    padding: 10px;
    text-align: left;
}

td > p {
    font-size: 1.2rem;
    margin: 0;
}

ul {
    list-style: outside circle;
}

ol {
    list-style: outside decimal;
}

ol ol {
    list-style: lower-roman;
}

ul.vault {
    list-style-type: circle
}

p.list {
    margin-bottom: 3rem;
}

.de-emphasize {
    color: rgba(17, 17, 17, 0.5);
}

.copyright {
    padding-bottom: 2rem;
    font-size: 1rem;
}

.highlight {
    border-radius: 3px;
}

.code > .highlight {
    border-radius: 0 3px 3px 0;
}

.linenos {
    border-radius: 3px 0 0 3px;
    background-color: #073642;
    border-right: 1px solid #00232C;
    color: #586E75;
    text-shadow: 0 -1px #021014;
}

td.code {
    width: 100%;
    max-width: 100px;
}

.linenos a {
    color: #586E75;
}

sub, sup {
    position: relative;
    font-size: 75%;
    line-height: 0;
    vertical-align: baseline;
}

sup {
    top: -0.5em;
}

sub {
    bottom: -0.25em;
}

article pre, .page pre {
    padding: .8em;
    line-height: 1.1em;
    overflow: auto;
}

header .header_box {
    padding-top: 4.5em;
}

footer.paginator {
    margin-top: 4rem;
    display: flex;
    justify-content: space-between;
    font-size: 1.2rem;
}

footer.paginator > span.hide {
    visibility: hidden;
}

code, pre {
    white-space: pre-wrap;
}

code {
    background-color: #F9F2F4;
    border-radius: 4px;
    box-sizing: border-box;
    color: #C7254E;
    font-family: Consolas, Monaco, Menlo, "Courier New", monospace;
    line-height: 18px;
    padding: 2px 4px;
}

pre {
    font-family: Consolas, Monaco, Menlo, "Courier New", monospace;
}

footer p {
    margin: 0;
    font-size: 1.2rem;
}

main {
    padding-top: 0;
    padding-bottom: 0;
    --padding-left: var(--media-xs) 1rem;
    padding-left: var(--padding-left, 4rem);
    --padding-right: var(--media-xs) 1rem;
    padding-right: var(--padding-right, 4rem);
    max-width: 1000px;
}

article > header > p {
    margin: 0;
}

section.available {
    padding-top: 0;
    padding-bottom: 2rem;
}

section.available p {
    padding-top: 1rem;
    padding-bottom: 1rem;
    border-top: 1px dashed rgba(17,17,17,0.2);
    border-bottom: 1px dashed rgba(17,17,17,0.2);
}

/* make <del>s accessible to screen readers. Thanks, MDN! */
del::before,
del::after {
    clip-path: inset(100%);
    clip: rect(1px, 1px, 1px, 1px);
    height: 1px;
    overflow: hidden;
    position: absolute;
    white-space: nowrap;
    width: 1px;
}

del::before {
    content: " [deletion start] ";
}

del::after {
    content: " [deletion end] ";
}

/*
    Tufte CSS styles. Originally from https://edwardtufte.github.io/tufte-css/
    Modified as needed to fit into a 2-column display by Eric Lawler in the
    green San Diegan spring of 2019.
*/

html {
    font-size: 15px;
}

body {
    font-family: Jost, Georgia, serif;
    background-color: #fffff8;
    color: #111;
}

h1 {
    font-weight: 500;
    margin-top: 4rem;
    margin-bottom: 1.5rem;
    font-size: 3.2rem;
    line-height: 1.2;
}

h2 {
    font-weight: 500;
    margin-top: 2.1rem;
    margin-bottom: 1.4rem;
    font-size: 2.2rem;
    line-height: 1.2;
}

h3 {
    font-weight: 400;
    font-size: 1.8rem;
    margin-top: 2.5rem;
    margin-bottom: 1.4rem;
    line-height: 1.2;
}

h4 {
    font-weight: 400;
    font-size: 1.6rem;
    margin-top: 2.0rem;
    margin-bottom: 1.2rem;
    line-height: 1.2;
}

h5 {
    font-style: italic;
    font-weight: 400;
    font-size: 1.6rem;
    margin-top: 2.0rem;
    margin-bottom: 1.2rem;
    line-height: 1.2;
}

h6 {
    font-style: italic;
    font-weight: 400;
    font-size: 1.4rem;
    margin-top: 1.9rem;
    margin-bottom: 1.1rem;
    line-height: 1.2;
}

hr {
    display: block;
    height: 1px;
    border: 0;
    border-top: 2px solid rgba(17, 17, 17, 0.1);
    margin: 1em 0;
    padding: 0;
}

hr.separator {
    margin: 0;
}

hr.separator.extra {
    margin: 4rem 0;
}

p.subtitle {
    font-style: italic;
}

.numeral {
    font-family: et-bembo-roman-old-style;
}

.danger {
    color: red;
}

article {
    counter-reset: sidenote-counter;
    position: relative;
}

article:first-of-type {
    --padding-top: var(--media-lte-md) 0;
    padding-top: var(--padding-top, 2rem);
    padding-bottom: 2rem;
    padding-left: 0;
    padding-right: 0;
}

article.intro {
    padding-bottom: 0;
}

article:last-of-type {
    padding-bottom: 2rem;
}

section {
    padding-top: 1rem;
    padding-bottom: 1rem;
}

p, ol, ul {
    font-size: 1.4rem;
    line-height: 2rem;
}

p {
    margin-top: 1.4rem;
    margin-bottom: 1.4rem;
    padding-right: 0;
    vertical-align: baseline;
}

/* Chapter Epigraphs */
div.epigraph {
    margin: 5em 0;
}

div.epigraph > blockquote {
    margin-top: 3em;
    margin-bottom: 3em;
}

div.epigraph > blockquote, div.epigraph > blockquote > p {
    font-style: italic;
}

div.epigraph > blockquote > footer {
    font-style: normal;
}

blockquote > footer > cite {
    font-style: italic;
}

/* end chapter epigraphs styles */

blockquote {
    margin: 1.4rem 40px;
    font-size: 1.4rem;
    padding-left: 1.4rem;
    border-left: 2px solid rgba(17, 17, 17, 0.1);
}

blockquote footer {
    font-size: 1.1rem;
    text-align: right;
}

article footer {
    text-align: right;
    --padding-bottom: var(--media-xs) 0.5rem;
    padding-bottom: var(--padding-bottom);
}

li:not(:first-child) {
    margin-top: 0.25rem;
}

figure {
    padding: 0;
    border: 0;
    font: inherit;
    vertical-align: baseline;
    max-width: 60%;
    margin: 0 0 3em 0;
}

figcaption {
    float: right;
    clear: right;
    margin-top: 0;
    margin-bottom: 0;
    font-size: 1.1rem;
    line-height: 1.6;
    vertical-align: baseline;
    position: relative;
    max-width: 40%;
}

figure.fullwidth figcaption {
    margin-right: 24%;
}

/* Links: replicate underline that clears descenders */
a:link, a:visited {
    color: inherit;
}

article a:link {
    text-decoration: none;
    background: linear-gradient(#fffff8, #fffff8), linear-gradient(#fffff8, #fffff8), linear-gradient(#333, #333);
    background-size: 0.05em 1px, 0.05em 1px, 1px 1px;
    background-repeat: no-repeat, no-repeat, repeat-x;
    text-shadow: 0.03em 0 #fffff8, -0.03em 0 #fffff8, 0 0.03em #fffff8, 0 -0.03em #fffff8, 0.06em 0 #fffff8, -0.06em 0 #fffff8, 0.09em 0 #fffff8, -0.09em 0 #fffff8, 0.12em 0 #fffff8, -0.12em 0 #fffff8, 0.15em 0 #fffff8, -0.15em 0 #fffff8;
    background-position: 0 93%, 100% 93%, 0 93%;
}

/* make underlines sungglier on jobsphones */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
    article a:link {
        background-position-y: 87%, 87%, 87%;
    }
}

article a:link::selection {
    text-shadow: 0.03em 0 #b4d5fe, -0.03em 0 #b4d5fe, 0 0.03em #b4d5fe, 0 -0.03em #b4d5fe, 0.06em 0 #b4d5fe, -0.06em 0 #b4d5fe, 0.09em 0 #b4d5fe, -0.09em 0 #b4d5fe, 0.12em 0 #b4d5fe, -0.12em 0 #b4d5fe, 0.15em 0 #b4d5fe, -0.15em 0 #b4d5fe;
    background: #b4d5fe;
}

article a:link::-moz-selection {
    text-shadow: 0.03em 0 #b4d5fe, -0.03em 0 #b4d5fe, 0 0.03em #b4d5fe, 0 -0.03em #b4d5fe, 0.06em 0 #b4d5fe, -0.06em 0 #b4d5fe, 0.09em 0 #b4d5fe, -0.09em 0 #b4d5fe, 0.12em 0 #b4d5fe, -0.12em 0 #b4d5fe, 0.15em 0 #b4d5fe, -0.15em 0 #b4d5fe;
    background: #b4d5fe;
}

main > article > header > h1 > a:link.no-line {
    background: none;
    text-shadow: none;
}

.sidenote, .marginnote {
    float: right;
    clear: right;
    margin-right: -63%;
    width: 52%;
    margin-top: 0;
    margin-bottom: 0;
    font-size: 1.1rem;
    line-height: 1.3;
    vertical-align: baseline;
    position: relative;
    /* Otherwise, highlighting a paragraph correctly grabs the sidenotes
     TODO: figure out how to improve this later */
    -moz-user-select: none;
    -ms-user-select: none;
    -webkit-user-select: none;
    user-select: none;
}

.sidenote-number {
    counter-increment: sidenote-counter;
}

.sidenote-number:after, .sidenote:before {
    font-family: et-bembo-roman-old-style;
    position: relative;
    vertical-align: baseline;
}

.sidenote-number:after {
    content: counter(sidenote-counter);
    font-size: 1rem;
    top: -0.5rem;
    left: 0.1rem;
}

.sidenote:before {
    content: counter(sidenote-counter) " ";
    font-size: 1rem;
    top: -0.5rem;
}

blockquote .sidenote, blockquote .marginnote {
    margin-right: -82%;
    min-width: 59%;
    text-align: left;
}

article img {
    max-width: 100%;
}

div.fullwidth, table.fullwidth {
    width: 100%;
}

div.table-wrapper {
    overflow-x: auto;
    font-family: "Trebuchet MS", "Gill Sans", "Gill Sans MT", sans-serif;
}

.sans {
    font-family: "Gill Sans", "Gill Sans MT", Calibri, sans-serif;
    letter-spacing: .03em;
}

code {
    font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace;
    font-size: 1.0rem;
    line-height: 1.42;
}

.sans > code {
    font-size: 1.2rem;
}

h1 > code, h2 > code, h3 > code {
    font-size: 0.80em;
}

.marginnote > code, .sidenote > code {
    font-size: 1rem;
}

.fullwidth {
    max-width: 90%;
    clear: both;
}

span.newthought {
    font-variant: small-caps;
    font-size: 1.2em;
}

input.margin-toggle {
    display: none;
}

label.sidenote-number {
    display: inline;
}

label.margin-toggle:not(.sidenote-number) {
    display: none;
}

.iframe-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    padding-top: 25px;
    height: 0;
}

.iframe-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}
