/* overall layout */
* { box-sizing: border-box; }
body {
  margin: 0 auto 0;
  line-height: 1.5em;
  overflow-x: hidden;
}
body, .side, .menu { background: #ffffff; }
main, .menu ul, .footer, .single section, .post-nav {
  max-width: 800px;
  margin: 0 auto 0;
}
main {
  display: block;
  hyphens: auto;
}
.list main {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
}
.list main > * {
  flex: 1 0 100%;
}
.list main > .post-card {
  flex: 0 0 100%;
}
.menu, .container { padding: 0 1em 0; }
.article, .appendix {
  position: relative;
}
.article-list, .single main, .single .appendix, .fullwidth, .embed-left, .embed-right {
  margin-top: 2em;
  padding: 1em;
  box-shadow: 0 0 8px #ffffff;
  background: #ffffff;
}
.post-card { margin-top: 1em; }

/* header and footer areas */
.menu { box-shadow: 0px 10px 10px -5px rgba(255, 255, 255, 0.1); }
.sticky-top {
  position: sticky;
  top: 0;
  z-index: 2;
}
.menu li, .terms li, .footer li { display: inline-block; }
.article-meta { background: #ffffff; }
footer { background: #ffffff; }
.menu ul {
  padding: 1em 0 1em;
  display: flex;
}
.article-meta, .menu a, .footer a, .terms a, .bg-number {
  text-decoration: none;
  padding: 5px;
  border-radius: 5px;
}
.menu a, .footer a { margin: 1px; }
.menu a, .pagination a, .article-meta a { color: #fffff8; }
.menu a:hover, .menu .active, .summary::first-letter, .footer a:hover, .terms a:hover, .bg-number {
  background: #ffffff;
  color: #232323;
}
.menu, .article-meta, .post-nav { text-align: left; }
.menu ul, .terms, .footer ul { padding-left: 0; }
.menu .left {
  flex-grow: 1;
  font-weight: 600;
  text-align: left;
}
.title {
  font-size: 1.1em;
  line-height: 1em;
}
.article-meta .terms, .appendix, .footnotes, main .side > *, figcaption, .caption { font-size: .9em; }
.terms a {
  border: 1px solid #fffff8;
  line-height: 2em;
}
.terms a, .bg-number {
  padding: 1px 5px;
}
.footer {
  display: flex;
  justify-content: space-between;
}
.footer a { text-decoration: none; }
footer { margin-top: 2em; }

hr {
  border-style: dashed;
  color: #fffff8;
  width: 50%;
}
.footnotes hr { margin-left: 0; }

#TOC { top: 0; }
#TOC ul { list-style-position: inside; }
#TOC > ul {
  padding: 0;
  margin: 0;
}
#TOC li > ul { padding-left: 1em; }
#TOC .numbered { list-style: none; }

.appendix div:not(:last-child):not(.side) {
  border-bottom: 1px dashed rgb(255, 255, 255);
  padding-bottom: 1em;
  margin-bottom: 1em;
}

/* code */
pre {
  border: 1px solid rgb(255, 255, 255);
  overflow-x: auto;
}
pre code { background: none; }
pre code:not(.hljs), pre .hljs {
  display: block;
  padding: 1em;
}
.appendix pre code { white-space: pre-wrap; }

/* left/right elements*/
.side {
  width: 200px;
  margin: 0 auto;
}
.side > :first-child { margin-top: 0; }
.side > :last-child { margin-bottom: 0; }
.side-left {
  float: left;
  clear: left;
  margin-left: calc(-200px - 2em);
  position: sticky;
}
.side-right {
  float: right;
  clear: right;
  margin-right: calc(-200px - 2em);
}
h3.side-left { text-align: right; }
.quote-left, .quote-right { width: 45%; }
.embed-left, .embed-right {
  margin-top: auto;
  padding: 0;
}
.quote-left, .embed-left {
  float: left;
  margin-right: 1em;
}
.quote-right, .embed-right {
  float: right;
  margin-left: 1em;
}
.embed-left { margin-left: calc(-200px - 2em); }
.embed-right { margin-right: calc(-200px - 2em); }
.side-left, .embed-left, #TOC { position: sticky; }

.spacer { width: 1em; }
.spacer-left { border-left: 1px dashed; }
.spacer-right { border-right: 1px dashed; }

/* wide elements */
.fullwidth, .fullwidth * { margin: auto 0; }
.fullwidth * { max-width: calc(100vw - 4em); }
.fullscroll * { max-width: initial; }
.fullwidth {
  max-width: calc(100vw - 2em);
  margin: 1em 0 1em 50%;
  transform: translateX(-50%);
  float: left;
  min-width: 100%;
  background: #ffffff;
}
.fullscroll, .fullscroll figure, .fullscroll .figure { overflow-x: auto; }
.fullwidth figcaption, .fullwidth .caption {
  margin-left: calc(50% - 400px);
  width: 800px;
  padding: 1em 1em 0;
}

/* search */
.search .menu li, .search .container, .search footer, .search-results { display: none; }
.search #menu-search, .search .search-results {
  display: flex;
  width: 100%;
}
.search #menu-search div:first-child { flex-grow: 1; }
.search input, .search #menu-search a {
  padding: .5em;
  font-size: 1.5em;
}
.search input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 2px solid rgb(255, 255, 255);
}
.search-results b {
  font-weight: normal;
  background: orange;
}

/* misc elements */
img, iframe, video { max-width: 100%; }
iframe, video {
  display: block;
  margin: auto;
}
.title, code, .article-list .side-title { hyphens: none; }
blockquote, code, .article tbody tr:nth-child(odd) { background: #ffffff; }
blockquote {
  border-left: 5px solid #ccc;
  padding: 1px 0 1px 1em;
  margin: auto;
}
.categories {
  text-transform: uppercase;
  font-size: .8em;
}
.single .appendix { background: none; }
.article-list a, .footer a {
  text-decoration: none;
  color: #fffff8;
}
.article-list h1 a {
  width: 100%;
  display: inline-block;
}
.article-list h1 a:hover { color: #71a5d4; }
.article-list h1 {
  border-bottom: 1px solid rgb(255, 255, 255);
  margin: 5px 0px 10px;
}
.article-list .side-title { transform: rotate(90deg); }
.article-list:nth-child(even):not(.post-card) .side-title { transform: rotate(-90deg); }
.article-list table {
  margin: 0;
  border: none;
  border-collapse: collapse;
  width: 100%;
  table-layout: fixed;
}
.article-list td { padding: 0; }
.side-title { width: 3em; }
.side-title h1 { border: none; }
.post-card .side-title h1 a, .post-card .spacer-right, .appendix h3 { color: rgb(255, 255, 255); }
.appendix h3 { text-align: right; }
.summary { margin-top: .5em; }
.pagination { text-align: center; }
.pagination li { display: inline; }
.pagination a { padding: 0 .2em; }
.active a { text-decoration: none; }
.post-nav { margin: 1em auto; }
.post-nav span {
  display: inline-block;
  width: 45%;
}
.nav-prev { text-align: right; }
.nav-next { text-align: left; }
.footer, .footer a { color: #fffff8;background: #ffffff; }
.more { font-style: italic; }
.hidden { display: none; }
.draft {
  background: repeating-linear-gradient( 135deg, #ffffff, #ffffff 10px);
}
.watermark {
  position: fixed;
  transform: rotate(-45deg);
  font-size: 12em;
  width: 100%;
  color: #fffff8;
  opacity: 0.3;
  left: 0;
  text-align: center;
  top: 50%;
}
table {
  margin: 1em auto auto;
  border-top: 1px solid rgb(255, 255, 255);
  border-bottom: 1px solid rgb(255, 255, 255);
}
table thead th { border-bottom: 1px solid rgb(255, 255, 255); }
th, td { padding: 5px; }

/* responsive */
@media (min-width: 1280px) {
  .note-ref { cursor: pointer; }
  .note-ref:hover ~ .side {
    display: inline-block;
    position: absolute;
    margin-left: 1em;
    padding: .5em;
    box-sizing: content-box;
  }
}
@media (max-width: 1280px) {
  #TOC {
    border: 1px solid rgb(255, 255, 255);
    border-radius: 5px;
    padding: 1em;
    position: initial;
  }
  .side { width: 100%; }
  main .side { padding: 0 2em; color: #ffffff; }
  .side-left, .side-right {
    clear: both;
    margin: 1em auto;
    background: none;
  }
  .embed-left, .embed-right {
    float: inherit;
    margin: auto;
    padding: 1em;
  }
  .appendix h3 { text-align: initial; }
}
@media (max-width: 800px) {
  li.optional { display: none; }
  body { padding: initial; }
  main { padding: 0 .5em 0; }
  .article-list { margin-top: 1.5em; }
  .list main .post-card { flex: inherit; }
  .quote-left, .quote-right { width: inherit; }
  .quote-left, .quote-right {
    float: inherit;
    margin: auto;
  }
  .menu ul, .footer { flex-wrap: wrap; }
  .fullwidth:not(.fullscroll) * { max-width: 100%; }
  .fullwidth {
    margin: initial;
    transform: initial;
    float: none;
    min-width: initial;
    background: none;
    border: none;
  }
  .fullwidth figcaption, .fullwidth .caption {
    margin: initial;
    padding: initial;
  }
  .search input, .search #menu-search a { font-size: 1em; }
}

a:link {
  color: #7e7e7e; /* dark gray */
  background-color: transparent; 

}
a:visited {
  color: #7e7e7e; /* dark gray */
  background-color: transparent; 

}
a:hover {
  color: #000000; /* black */
  background-color: transparent;

}
a:active {
  color: #000000; /* black */
  background-color: transparent;

}

dark theme
@media (prefers-color-scheme: dark) {
  body {
    background-color: rgb(255, 255, 255);
    filter: invert(1);
  }
  img { filter: invert(1); }
  .article-list { box-shadow: 0 0 8px rgb(255, 255, 255); }
}
