@font-face {
  font-family: "Merriweather";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: local("Merriweather"), url("/style/mwr.woff2") format("woff2");
}
@font-face {
  font-family: "Fira Code";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: local("Fira Code"), url("/style/fcr.woff2") format("woff2");
}
@font-face {
  font-family: "Merriweather";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: local("Merriweather Bold"), url("/style/mwb.woff2") format("woff2");
}
@font-face {
  font-family: "Merriweather";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: local("Merriweather Italic"), url("/style/mwi.woff2") format("woff2");
}
body {
  margin: 40px auto 60px;
  max-width: 850px;
  line-height: var(--mobile-line-height);
  font-size: var(--mobile-font-size);
  font-family: "Merriweather", serif;
  color: var(--active-body-color);
  background: var(--active-body-bg);
  padding: 0 10px;
  box-sizing: border-box;
}
h1, h2, h3 {
  line-height: 1.2;
}
a { color: var(--active-link); }
a:visited { color: var(--active-link-visited); }
code {
  font-family: "Fira Code", monospace;
  font-size: 0.875em;
  /* fix ios safari weird font sizes in code blocks */
  text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
}
code:not(.code-title code, .highlight > pre > code) {
  background: var(--active-code-bg);
  padding: 2px 5px;
}
pre {
  padding: 2%;
  min-width: 96%; /* 96+2+2 */
  overflow-x: auto;
  display: block;
  margin: 20px 0 20px 0;
  background: var(--light-pre-background);
}
.highlight > pre { /* when not syntax highlighted */
  color: var(--light-pre-font-color);
}
.highlight > pre > code > span > span {
  padding-right: 2%; /* codeblock right padding */
}
figcaption {
  font-style: italic;
  text-align: center;
}
figure {
  margin: auto;
}
.code-title + pre {
  margin: 0 0 20px 0;
}
.code-title {
  color: var(--light-pre-font-color);
  text-align: left;
  padding: 1% 0 1% 1%;
  background: var(--light-pre-background);
  border: 3px dashed var(--code-title-border-color);
  font-style: normal;
  display: flex;
  align-items: baseline;
  gap: 1em;
}
.code-title-name {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  white-space: nowrap;
}
.code-copy {
  flex-shrink: 0;
  font-style: normal;
  text-decoration: underline;
  color: var(--dark-link);
  cursor: pointer;
  padding: 0 2px;
  margin-right: 0.5em;
}
img {
  max-width: 95%;
  display: block;
  padding: 5px;
  margin: auto;
  filter: var(--active-img-filter);
}
blockquote {
  background: var(--active-blockquote-bg);
  border-left: 3px solid var(--blockquote-left-bar-color);
  padding-left: 2%;
  margin-left: 1rem;
}
.date {
  margin-top: -1em;
  font-style: italic;
}
.spoiler {
  background-color: gray;
  color: transparent;
  user-select: none;
}
.spoiler:hover {
  background-color: inherit;
  color: inherit;
}
.code-caption {
  margin: -1rem auto 1rem auto;
}
@media (min-width: 600px) { /* desktops, tablets */
  body {
    font-size: var(--desktop-font-size);
    line-height: var(--desktop-line-height);
  }
  html.index .post-card:first-child {
    margin-top: 1rem;
  }
  html.index .post-card:last-child {
    margin-bottom: 1rem;
  }
}
/* site header (back link / title + theme toggle) */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: nowrap;
}
html:not(.index) .site-header {
  align-items: baseline;
}
.site-header h1 {
  margin: 0; /* prevent flex-item h1 default margins from inflating the header height */
}
html.index body {
  margin-top: 60px; /* match main's 60px index top margin */
}
/* theme toggle button */
.theme-toggle {
  flex-shrink: 0;
  border: none;
  padding: 0;
  min-width: 5.5em;
  text-align: center;
  background: none;
  font-family: "Fira Code", monospace;
  font-size: 0.875em;
  color: inherit;
  cursor: pointer;
}
.theme-toggle::before { content: '[ '; }
.theme-toggle::after  { content: ' ]'; }
.theme-toggle-word { display: inline-block; width: 5ch; text-align: center; text-decoration: underline; } /* 5ch -> stop button from jumping */
.theme-toggle-word::before { content: 'theme'; }
:root[data-theme="dark"]  .theme-toggle-word::before { content: 'dark'; }
:root[data-theme="light"] .theme-toggle-word::before { content: 'light'; }

/* end-of-page marker */
.post-end {
  text-align: center;
  margin: 2rem 0 4rem;
  opacity: 0.65;
}
/* index post list cards */
html.index .post-list {
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
  padding: 0;
}
html.index .post-card {
  display: block;
  background: var(--active-card-bg);
  border: 1px solid var(--active-card-shadow);
  padding: 0.6rem 0.85rem;
  text-decoration: none;
  color: inherit;
}
html.index .post-card-title {
  display: block;
  color: var(--active-link);
  text-decoration: underline;
}
html.index .post-card:visited .post-card-title {
  color: var(--active-link-visited);
}
html.index .post-card-date {
  display: block;
  opacity: 0.8;
  font-size: 0.85em;
}
html.index .post-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.35rem;
}
html.index .post-tag {
  font-size: 0.8em;
  font-family: "Fira Code", monospace;
  opacity: 0.75;
}
