/* general */
:root {
  --bg-color: linear-gradient(to right, rgba(0, 0, 0, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.04) 1px, transparent 1px);
  --code-bg-color: #f4f4f4;
  --title-color: #212121;
  --text-color: #212121;
  --secondary-color: hsl(0, 0%, 50%);
  --tertiary-color: #b0b0b0;
  --link-color: #b5c8cf;
  --link-hover-color: #618794;
  --link-bg-color: #dae4e7;
  --selection-color: #dae4e7;
  --body-stack: 'Lora', 'Georgia', 'Times New Roman', serif;
  --secondary-stack: 'Lato', 'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', 'Verdana',
    sans-serif;
  --title-stack: 'Playfair Display SC', 'Georgia', serif;
  --divider: rgb(235, 235, 235);
  --bgColor-neutral-muted: #65696e33;
  --img-brightness: 1;
}

html {
  height: 100%;
}

body {
  color: var(--text-color);
  font-size: 16px;
  margin: auto;
  min-height: 100%;
  position: relative;
  width: 100%;
  background-image: var(--bg-color);
  background-size: 7px 7px;
}

/* wrapper */
#wrapper {
  background: none;
  border: none;
  box-sizing: border-box;
  display: block;
  margin: 3rem auto 10rem auto;
  max-width: 72rem;
  padding-left: 2rem;
  padding-right: 2rem;
}

@media all and (max-width: 760px) {
  #wrapper {
    margin-top: 3rem;
  }
}
@media all and (max-width: 520px) {
  #wrapper {
    margin-top: 1rem;
  }
}

/* header */
#header {
  padding: 0.25em 0;
}

#title {
  font-size: 2em;
  font-weight: 900;
  letter-spacing: 0.05em;
  margin: 1em 0;
  text-align: center;
}

.subtitle {
  text-align: center;
  font-size: 2em;
}

.description {
  text-align: center;
  font-size: 1em;
  color: var(--secondary-color);
}

#header nav {
  margin: 2em 0;
  text-align: center;
}

.nav-link,
.nav-spacer,
.article-more-link {
  font-family: var(--secondary-stack);
  color: var(--secondary-color);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.nav-spacer {
  margin: 0 0.5em;
}

/* posts */
.article {
  border-bottom: solid 1px var(--divider);
  margin: 2em 0;
  padding-bottom: 1em;
}

.article-header {
  margin-bottom: 3em;
}

.article-title {
  text-align: left;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0.05em;
  margin-bottom: 0.25em;
  text-decoration: underline;
  text-underline-offset: 10px;
  color: var(--title-color);
}

.article-title.headline {
  font-size: 32px;
}

.article-entry {
  line-height: 1.8;
  margin-bottom: 1em;
  overflow: visible;
  color: var(--text-color);
}

.article-entry.title-left h1,
.article-entry.title-left h2,
.article-entry.title-left h3,
.article-entry.title-left h4,
.article-entry.title-left h5,
.article-entry.title-left h6 {
  text-align: left;
}

.article-entry strong {
  padding: 0 0.4em;
}

.article-entry code {
  padding: 0.2em 0.4em;
  margin: 0;
  font-size: 85%;
  white-space: break-spaces;
  background-color: var(--bgColor-neutral-muted);
  border-radius: 6px;
}
.article-category {
  line-height: 1.5;
}

.article-meta,
.archive-article-date,
.article-nav,
.page-nav,
.article-footer,
.archive-article-word-count {
  color: var(--secondary-color);
  font-family: var(--secondary-stack);
  height: auto;
  line-height: inherit;
  margin: 0;
  padding: 0;
}

@media all and (max-width: 760px) {
  .article-meta,
  .archive-article-date,
  .article-nav,
  .page-nav,
  .article-footer,
  .archive-article-word-count {
    font-size: 1em;
  }
}

/* archive */
.archives-wrap {
  margin: 0.25rem 0;
  position: relative;
  top: 0.5rem;
}

@media all and (max-width: 620px) {
  .archives-wrap {
    margin-left: 1rem;
  }
}

.month {
  color: var(--secondary-color);
  cursor: pointer;
  font-family: var(--secondary-stack);
}

.hidden,
.hidden-input {
  display: none;
  margin-bottom: 1em;
}

.hidden-input ~ .month::before {
  content: '+ ';
  position: absolute;
  left: -1em;
}

.hidden-input:checked ~ .month::before {
  content: '– ';
}

.hidden-input:checked ~ .hidden {
  display: block;
}

.archive-article {
  margin: 0.25em 0;
  position: relative;
}

.archive-article-header {
  align-items: flex-start;
  display: inline-flex;
}

.archive-article-date {
  min-width: 7em;
}

.archive-article-title {
  margin-right: 0.5em;
}

.archive-article-title {
  font: inherit;
  font-size: 1em;
  left: 1em;
  letter-spacing: 0;
  margin: 0;
  max-width: calc(100vw - 6rem);
  position: relative;
  text-align: left;
  text-decoration: none;
  text-transform: none;
}

.article-nav {
  display: flex;
  margin: 2em 0;
}

#article-nav-older,
#article-nav-newer {
  flex-basis: 50%;
}

#article-nav-newer {
  order: 1;
  text-align: right;
}

/* pagination */
.page-nav {
  margin: 1em 0;
  text-align: center;
}

.page-number,
.space,
.extend {
  font-size: 1.3em;
  margin: 0 0.4em;
}

.current {
  color: var(--text-color);
}

/* typography */
a {
  color: inherit;
  text-decoration: none;
}

p,
ul,
ol,
h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0 0 1.2rem 0;
}

ul,
ol {
  padding-left: 1em;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: normal;
  letter-spacing: 0.1em;
  text-decoration: none;
}

h1,
h2 {
  font-size: 2em;
  letter-spacing: 0;
  margin-top: 2rem;
}

h2 {
  font-size: 1.5em;
  font-weight: 500;
}

h3 {
  font-size: 1.2em;
  font-weight: 500;
  margin: 2rem 0 1rem 0;
}

h4,
h5,
h6 {
  font-size: 1em;
  font-weight: 400;
  margin-top: 1.5rem;
  text-transform: uppercase;
}

h4,
h5,
h6 {
  font-size: 0.9em;
  margin-top: 1rem;
}

blockquote {
  display: block;
  margin: 0 0 1em;
  padding-left: 0.75rem;
  border-left: 1px solid var(--tertiary-color);
}

.article .article-entry blockquote footer,
.caption {
  color: var(--secondary-color);
  display: block;
  text-align: center;
}

.article .article-entry blockquote footer cite:before {
  content: ' — ';
}

.pullquote {
  border: 0;
  color: var(--secondary-color);
  font-size: 1.2em;
  font-family: var(--secondary-stack);
  margin: 0;
  width: 40%;
}

.pullquote p {
  margin: 0;
}

.pullquote.left {
  float: left;
  padding: 1em 1em 1em 0;
  text-align: left;
}

.pullquote.right {
  float: right;
  padding: 0 1em 1em 1em;
  text-align: right;
}

.caption {
  color: #aeb4b9;
  display: block;
  font-size: 0.8em;
  text-align: center;
}

.katex {
  font-size: 1.1em;
}

.article-entry a {
  -webkit-transition-duration: 0.3s;
  -webkit-transition-property: border-bottom;
  border-bottom: 1px solid var(--link-color);
  transition-duration: 0.3s;
  transition-property: border-bottom;
}

.article-entry a:hover {
  -webkit-transition-duration: 0.3s;
  -webkit-transition-property: border-bottom;
  border-bottom: 3px solid var(--link-hover-color);
  transition-duration: 0.3s;
  transition-property: border-bottom;
}

#title a,
.article-title a,
a.nav-link,
.archive-article-title a,
.article-nav a,
a.page-number,
a.extend,
.month,
.article-footer a,
.article-category a,
.article-tag a,
.article-more-link a {
  -webkit-transition-duration: 0.3s;
  -webkit-transition-property: background;
  transition-duration: 0.3s;
  transition-property: background;
}

#title a:hover,
.article-title a:hover,
a.nav-link:hover,
.archive-article-title a:hover,
.article-nav a:hover,
a.page-number:hover,
a.extend:hover,
.month:hover,
.article-footer a:hover,
.article-category a:hover,
.article-tag a:hover,
.article-more-link a:hover {
  -webkit-transition-duration: 0.3s;
  -webkit-transition-property: background;
  background: var(--link-bg-color) !important;
  transition-duration: 0.3s;
  transition-property: background;
}

.article-category,
.article-tag {
  color: var(--secondary-color);
  font-family: var(--secondary-stack);
  margin-top: 2em;
}

.article-more-link {
  font-size: 12px;
  letter-spacing: 0.1em;
  margin-bottom: 1.1em;
  text-transform: uppercase;
}

/* miscellaneous */
img {
  box-sizing: border-box;
  display: block;
  max-width: min(40em, 100%);
  filter: brightness(var(--img-brightness));
}

a img {
  -webkit-transition-duration: 0.3s;
  -webkit-transition-property: border;
  border: 3px solid var(--bg-color);
  transition-duration: 0.3s;
  transition-property: border;
}

a img:hover {
  -webkit-transition-duration: 0.3s;
  -webkit-transition-property: border;
  border: 3px solid var(--secondary-color);
  transition-duration: 0.3s;
  transition-property: border;
}

.article-gallery img,
table {
  margin: 1em auto;
}

td,
th,
table caption,
table td,
table th {
  border-bottom: 1px solid var(--tertiary-color);
  padding: 0.25em;
}

.video-container {
  position: relative;
  padding-top: 56.25%;
  margin-bottom: 1em;
  height: 0;
  overflow: hidden;
}

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

::selection {
  background-color: var(--selection-color);
}

#settings-container {
  /* background: var(--tertiary-color); */
  bottom: 3em;
  position: fixed;
  right: 2em;
}

#sans-font,
#dark-mode {
  cursor: pointer;
  float: right;
  font-size: 2em;
  /* padding: 0.5em; */
}

/** for markdown */
.h5-4md {
  text-align: center;
  font-size: 1.8em;
}
.h5-4md.yellow {
  color: rgb(237, 157, 0);
}

.text-c-4md {
  text-align: center;
}

.icp {
  padding: 10px 0;
  font-size: 10px;
  text-align: center;
  color: var(--secondary-color);
}

.img-title {
  color: var(--secondary-color);
  font-size: 12px;
  margin-top: 8px;
}

.dont-reprint {
  color: var(--secondary-color);
}

.article-entry h1,
.article-entry h2,
.article-entry h3 {
  color: var(--title-color);
}
