/* Global variables */
:root {
  /* Set sans-serif & mono fonts */
  --sans-font: -apple-system, BlinkMacSystemFont, "Avenir Next", Avenir,
    "Nimbus Sans L", Roboto, "Noto Sans", "Segoe UI", Arial, Helvetica,
    "Helvetica Neue", sans-serif;
  --mono-font: "Ubuntu Mono", Consolas, Menlo, Monaco, "Andale Mono", monospace;
}

/* Light Theme (Default) */
:root, html[data-theme='light'] {
  --background-color: #ffffff;
  --text-color: #282828;
  --h1-color: #1d2021;
  --link-color: #076678;
  --meta-color: #928394;
  --code-color: #ebdbb2;
  --code-text-color: #181818;
  --border-color: #dbd4ca;
  --th-color: #f9f5d7;
  --tr1-color: #ebdbb2;
  --tr2-color: #d5c4a1;
  --note-bg-color: #f9f5d7;
  --blue-color: #45707a;
  --orange-color: #c35e0a;
  --purple-color: #875f87;
  --red-color: #c14a4a;
  --green-color: #6c782e;
  --aqua-color: #4c7a5d;
  --yellow-color: #b47109;
  --footer-color: #504945;
}

/* Dark Theme */
@media (prefers-color-scheme: dark) {
:root, html[data-theme='dark'] {
  --background-color: #1d2021;
  --text-color: #f9f5d7;
  --h1-color: #ebdbb2;
  --link-color: #7daea3;
  --meta-color: #928394;
  --code-color: #3c3836;
  --code-text-color: #fbf1c7;
  --border-color: #51463e;
  --th-color: #282828;
  --tr1-color: #3c3836;
  --tr2-color: #504945;
  --note-bg-color: #1d2021;
  --blue-color: #458588;
  --orange-color: #e78a4e;
  --purple-color: #d3869b;
  --red-color: #ea6962;
  --green-color: #a9b665;
  --aqua-color: #89b482;
  --yellow-color: #d8a657;
  --footer-color: #d5c4a1;
}
}

/* caveat-regular - latin */
@font-face {
  font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
  font-family: 'Caveat';
  font-style: normal;
  font-weight: 400;
  src: url('../fonts/caveat-v18-latin-regular.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}

/* caveat-500 - latin */
@font-face {
  font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
  font-family: 'Caveat';
  font-style: normal;
  font-weight: 500;
  src: url('../fonts/caveat-v18-latin-500.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}

/* comic-neue-regular - latin */
@font-face {
  font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
  font-family: 'Comic Neue';
  font-style: normal;
  font-weight: 400;
  src: url('../fonts/comic-neue-v8-latin-regular.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}


html {
  /* Set the font globally */
  font-family: var(--sans-font);
}

html, body {
  min-width: 18rem;
}

body {
  max-width: 36.25rem;
  margin: 0 auto;
  padding: 1.5rem 1rem;
  font-size: 1.125rem;
  line-height: 1.5;
  height: 100vh;
  background: var(--background-color);
  color: var(--text-color);
}

main {
  margin: 0;
  padding: 1.125rem;
}

h1 {
  margin-bottom: 0;
  font-family: 'Caveat';
  font-weight: 500;
  color: var(--h1-color);
}

a {
  color: var(--link-color);
  text-underline-offset: 0.3rem;
}

a:hover {
  text-decoration: none;
}

ol {
  padding-left: 1.4rem;
}

ul {
  padding-left: 1.8rem;
}

li {
    margin-bottom: 0.5rem;
}

li::marker {
  color: var(--orange-color);
}

img {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  width: auto;
}

header {
  margin-bottom: 2.5rem;
}

footer {
  text-align: right;
  margin-top: 5rem;
  border-top: 3px solid var(--orange-color);
}

header > nav {
  margin-bottom: 2rem;
}

footer > nav a,
footer > nav a:visited {
  margin: 1rem .25rem 0 .25rem;
  color: var(--text-color);
  display: inline-block;
  border-radius: .25rem;
  padding: 0.1rem .5rem;
  text-decoration: none;
}

footer > nav a:hover {
  color: var(--code-text-color);
  cursor: pointer;
}

@media (prefers-color-scheme: dark) {
  img {
    /*background-color: #fcfbf7;*/
    /*filter: brightness(80%);*/
    /*opacity: 0.8;*/
  }
}

@media only screen and (max-width: 580px) {
  body {
    padding: 1.25rem;
    font-size: 1.1rem;
  }
  main {
    padding: 0.1rem 0 1rem 0;
    border: none;
    border-radius: 0;
  }
  header {
    margin-bottom: 2rem;
  }
  h1 {
    /*font-size: 1.9rem;*/
  }
  footer {
    margin-top: 2.5rem;
  }
}

@media only screen and (max-width: 480px) {
  body {
    padding: 1.25rem .8rem 1.25rem .8rem;
  }
}


/* Classes */

.site-navi {
  display: inline-block;
}

.site-name {
  font-family: 'Comic Neue';
  font-weight: bold;
  font-size: 1.5rem;
  text-decoration: none;
  color: var(--blue-color);
  
}

.site-name:hover {
  background: transparent;
  color: var(--text-color);
}

.site-name img {
  width: 24px;
}

.subtitle, .description {
  margin-top: 0;
  font-family: 'Comic Neue';
}

.date {
  margin-top: 0;
  color: var(--meta-color);
  font-size: 90%;
}

.author {
  font-size: .85rem;
  color: var(--meta-color);
  margin-top: 2rem;
  margin-bottom: -.8rem;
}

.comic {
  border-radius: 1rem;
}

.copyright {
  padding-bottom: 1rem;
}

.page-navi {
  text-align: center;
  margin-top: 3rem;
}

.page-navi ul {
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  row-gap: 1rem;
  column-gap: 2rem;
}

.page-navi li {
  list-style: none;
  display: flex;
  flex: 1;
}

.page-navi a {
  white-space: nowrap;
  flex: 1;
  padding: .75rem;
  border: 2px solid rgb(96 139 168);
  border-radius: 5px;
  background-color: rgb(96 139 168 / 0.2);
}

.page-footer {
  font-family: 'Comic Neue';
  text-align: center;
  margin: 2rem 1rem 2rem 1rem;
}

.archive-list ul {
  padding: 0;
}

.archive-list li {
  list-style: none;
  padding-top: .5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--code-color);
}

.archive-list a {
  text-decoration: none;
}

@media only screen and (max-width: 580px) {
  .author {
    margin-bottom: revert;
  }
  .comic {
    border-radius: .5rem;
  }
  .page-footer {
    margin: 1rem 1rem 4rem 1rem;
  }
}


/* Headings Index */

.headingsLink-wrapper ul {
  padding: 0;
}

.headingsLink-wrapper li {
  list-style: none;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--code-color);
}

.headingsLink-wrapper ul:last-child li:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.headingsLink-wrapper .tc li {
  margin-top: .5rem;
  margin-bottom: 0;
  padding-bottom: .5rem;
  border-bottom: none;
}

.headingsLink-wrapper a {
  text-decoration: none;
}

.headingsLink-wrapper a:hover {
  text-decoration: underline;
}

.headingsLink-wrapper ul ul ul {
  padding-top: .5rem;
  margin-bottom: .6rem;
}

@media only screen and (max-width: 580px) {
  .headingsLink-wrapper ul:last-child li:last-child {
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--code-color);
  }
}
