/* http://meyerweb.com/eric/tools/css/reset/
 *    v2.0 | 20110126
 *       License: none (public domain)
 */
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, ol, ul, 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;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
	display: block;
}
blockquote, q {
	quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
	content: '';
	content: none;
}
table {
	border-collapse: collapse;
	border-spacing: 0;
}

/* Typography */
body {
  font-family: "Roboto Condensed", "Arial Narrow", "Helvetica Neue", sans-serif;
  font-size: 20px;
  line-height: 150%;
}

h1, h2, h3, h4, h5, h6 {
  font-family: "Gloria Hallelujah", "Noteworthy", "Times New Roman", sans-serif;
  line-height: 150%;
}

pre, code {
  font-family: "Source Code Pro", "Menlo", "Courier", monospace;
  color: #4f4f4f;
}

h1.title {
  font-size: 36px;
  text-align: center;
  margin-bottom: 24px;
}

h1 {
  font-size: 32px;
}

h2 {
  font-size: 24px;
  color: #4f4f4f;
}

h3 {
  font-size: 20px;
  color: #828282;
}

strong {
  font-weight: bold;
}

em {
  font-style: italic;
}

a {
  color: #ff6d6d;
  text-decoration: none;
}

a:hover {
  border-bottom: 1px solid #ff6d6d;
}

p > code {
  font-size: 95%;
}

figure {
  text-align: center;
}

figure > svg,
figure > canvas,
figure > img {
  max-width: 100%;
  height: auto;
}

caption, figcaption {
  font-style: italic;
  text-align: center;
  font-size: 16px;
  line-height: 1;
  margin-top: 5px;
}

blockquote {
  font-style:italic;
  padding: 0 3em 0 2em;
}

h1 > code, h2 > code, h3 > code, h4 > code, h5 > code, h6 > code, a > code {
  color: inherit;
}

.highlight, article > pre {
  font-size: 70%;
}

sup {
  vertical-align: super;
  font-size: 80%;
}

a[rel=footnote]::before {
  content: '['
}

a[rel=footnote]::after {
  content: ']'
}

/* Spacing */
* {
  box-sizing: border-box;
}

#main {
  max-width: 750px;
  width: 100%;
  margin: 0 auto 30px auto;
  padding: 0 10px 0 10px;
}

article > * {
  /* Space all immediate children of an article by 30px, centering everything by
   * default
   */
  margin: 0 auto 30px auto;
}

p {
  margin-bottom: 30px;
}

h1, h2, h3, h4, h5, h6 {
  /* Override the spacing rule above: only move content below headers down by
   * 10px */
  margin-bottom: 10px;
}

p + h1 {
  /* Space out sections of an article more than regular spacing */
  margin-top: 45px;
}

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

li + li {
  margin-top: 15px;
}

.highlight, article > pre, .katex-display {
  /* Make code blocks and formulas horizontally scrollable */
  overflow-x: auto;

  /* For reasons I'm unclear of, the <code> inside the <pre> is larger than the
   * <pre>, so it scrolls horizontally. Fudge it to fix this.
   */
  padding-bottom: 15px;
}

iframe {
  display: block;
  width: 100%;
}

article > p > img {
  /* Center images */
  display: block;
  margin: 0 auto;
  max-width: 100%;
}

article > p > svg {
  /* Center svg */
  display: block;
  margin: 0 auto;
  max-width: 100%;
  height: auto;
}

hr {
  border: 0;
  border-bottom: 1px solid #828282;
  width: 80%;
}

/* Table of Contents */
#TableOfContents li {
  margin-top: 0;
}

/* Homepage */
body.homepage #main {
  max-width: 400px;
}

ul.postlist {
  padding: 0;
}

ul.postlist li {
  list-style: none;
}

.postlist__date {
  display: block;
  font-size: 16px;
  color: #828282;
  line-height: 125%;
}

/* Author block */
.author {
  text-align: center;
  display: flex;
  flex-direction: column;
  margin: 30px auto 30px auto;
  transform: none;
  width: 290px;
  flex-direction: row;
}

.author a, .author a:hover {
  color: inherit;
  border-bottom: none;
}

a.author__logo {
  display: block;
  width: 130px;
  height: 130px;
}

a.author__logo #eyebrows {
  transition: transform 0.15s ease-in-out;
}

a.author__logo:hover #eyebrows {
  transform: translateY(-3px);
}

.author__elsewhere {
  display: flex;
  justify-content: center;
  padding: 5px;
}

.author__elsewhere svg {
  width: 20px;
  height: 20px;
  display: block;
}

.author__elsewhere svg:hover {
  fill: #ff6d6d;
}

.author__elsewhere a + a {
  margin-left: 10px;
}

.author__site-title {
  font-size: 30px;
  font-weight: bold;
  line-height: 125%;
}

.author .author__site-title:hover {
  color: #ff6d6d;
}

.author__my-name {
  font-size: 20px;
  line-height: 125%;
}

.author__post-date {
  font-size: 16px;
  color: #828282;
  line-height: 125%;
}

.author__site-text {
  height: 130px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin-left: 20px;
}

/* Adjacent links block */
.adjacent-posts {
  display: flex;
  width: 750px;
  max-width: 100%;
  justify-content: space-between;
  padding: 0 10px 0 10px;
  margin-bottom: 30px;
}

.adjacent-posts__relative {
  display: block;
  text-transform: uppercase;
  color: #828282;
  font-size: 16px;
  line-height: 1;
}

.adjacent-posts__prev {
  text-align: left;
}

.adjacent-posts__next {
  margin-left: 30px;
  text-align: right;
}

.endpost-blurb {
  font-size: 80%;
  font-style: italic;
  color: #828282;
  line-height: 1.25;
}

.calls-to-action {
  display: flex;
  justify-content: center;
  align-items: stretch;
  max-width: 100%;
  flex-wrap: wrap;
}

.calls-to-action > * + * {
  margin-left: 10px;
}

.calls-to-action, .calls-to-action > * {
  margin-bottom: 30px;
}

.tinyletter {
  display: flex;
  align-items: stretch;
}

.tinyletter > * + * {
  margin-left: 5px;
}

.tinyletter input[type=text] {
  text-align: center;
  border: 1px solid black;
}

.tinyletter button, .tinyletter input[type=text] {
  border-radius: 4px;
}

@media print {
  h1.title {
    page-break-before: default;
  }

  h1 {
    page-break-before: always;
    page-break-after: avoid;
  }

  article > p > svg,
  article > p > img,
  figure > svg,
  figure > canvas,
  figure > img {
    max-width: 5in;
    max-height: 8in;
    height: auto;
    width: auto;
  }

  caption, figcaption {
    page-break-before: avoid;
  }

  /* Hide content that isn't useful for printing */
  .endpost-blurb,
  .calls-to-action,
  .calls-to-action + hr,
  .adjacent-posts,
  .author {
    display: none;
  }

  article::after {
    content: '© Jamie Wong (jamie-wong.com)'
  }
}