* { box-sizing: border-box; }
@font-face {
  font-family: 'PT Serif';
  font-style: normal;
  font-weight: 400;
  src:
    local(''),
    url('../fonts/PT-Serif_Regular.woff2') format('woff2'),
    url('../fonts/PT-Serif_Regular.woff') format('woff');
}

@font-face {
  font-family: 'PT Serif';
  src:
    local(''),
    url('../fonts/PT-Serif_Italic.woff2') format('woff2'),
    url('../fonts/PT-Serif_Italic.woff') format('woff');
  font-weight: normal;
  font-style: italic;
}

@font-face {
  font-family: 'PT Serif';
  src:
    local(''),
    url('../fonts/PT-Serif_Bold.woff2') format('woff2'),
    url('../fonts/PT-Serif_Bold.woff') format('woff');
  font-weight: 700;
  font-style: normal;
}

@font-face {
  font-family: 'PT Serif';
  src:
    local(''),
    url('../fonts/PT-Serif_Bold-Italic.woff2') format('woff2'),
    url('../fonts/PT-Serif_Bold-Italic.woff') format('woff');
  font-weight: 700;
  font-style: italic;
}

:root {
  --accent-color: #de564a;
  --accent-color-border: rgba(223, 86, 74, 0.2);
  --accent-color-hover: #E36E64;
  --extra-light-grey: #F8F6F6;
  --light-gray: rgba(0, 0, 0, 0.15);
  --mid-gray: #9E8B89;
  --gray: #666666;
  --dark-gray: #393636;
  --body-bg-color: #FFF;
  --body-text-color: #262626;
  --code-color: #55413F;
  --code-bg-color: var(--extra-light-grey);
  --callout-code-color: #FFF;

  --wrapper-width: 1180px;
  --aside-width: 340px;
  --callout-width: 370px;
  --space-1x: 0.8rem;
  --space-2x: 1.6rem;
  --space-3x: 2.4rem;
  --space-4x: 3.2rem;

  --font-size: 1.5rem;
  --lh: 1.4;
  --header-spacing: 0.6rem;
  --paragraph-spacing: var(--space-3x);
  --post-subtitle-size: 2rem;
  --post-body-font-size: 1.8rem;
  --post-body-lh: 1.5;
  --footnotes-font-size: 1.6rem;
  --blockquote-font-size: 1.7rem;
  --callout-font-size: 1.5rem;
  --dateline-font-size: 1.5rem;
  --post-tag-font-size: 1.3rem;
  --article-right-margin: 8rem;

  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace;
  --sans-serif: system-ui, sans-serif;
  --serif: "PT Serif", system-ui, serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --accent-color: rgb(232, 113, 103);
    --accent-color-border: rgba(232, 113, 103, 0.5);
    --body-bg-color: #2b2a34;
    --body-text-color: #FFF;
    --code-color: #FFF;
    --code-bg-color: #1d1c22;
    --light-gray: rgba(255, 255, 255, 0.15);
    --extra-light-grey: rgba(255, 255, 255, 0.1);
    --mid-gray: #bdbdbd;
    --gray: #bdbdbd;
    --dark-gray: #dbdbdb;
    --callout-code-color: #1d1c22;
  }

  img {
    background-color: #FFF;
  }

  code[class*="language-"],
  pre[class*="language-"] {
    /* THe prism color looks ugly with dark grey */
    background-color: #1d1c22;
  }
}

* {
  box-sizing: border-box;
  -moz-osx-font-smoothing: grayscale;
  -webkit-font-smoothing: antialiased;
}

html {
  font-size: 62.5%;
  /* For rem-based font sizes */
  line-height: 1.15;
  /* Correct the line height in all browsers. */
  -webkit-text-size-adjust: 100%;
  /* Prevent adjustments of font size after orientation changes in iOS. */
}

body {
  margin: 0;
  font-family: var(--sans-serif);
  font-size: var(--font-size);
  line-height: var(--lh);
  color: var(--body-text-color);
  background-color: var(--body-bg-color);
}

/* Grid */
.wrapper {
  margin: 0 auto;
  padding: 0 var(--space-2x);
  max-width: var(--wrapper-width);
}

@media only screen and (min-width: 576px) {
  .wrapper {
    padding: 0 var(--space-3x);
  }
}

.grid-main {
  margin: 0 auto;
  max-width: 720px;
  margin-bottom: var(--space-3x);
  min-width: 0;
  /* pre will expand flex containers otherwise */
}

@media only screen and (min-width: 992px) {
  .grid {
    display: flex;
  }

  .grid-main {
    max-width: 100%;
    margin: 0;
    flex-grow: 1;
    padding-right: var(--article-right-margin);
  }

  .grid-sidebar {
    flex-shrink: 0;
    top: var(--space-3x);
    position: sticky;
    width: var(--aside-width);
    padding-bottom: var(--space-3x);
    height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
  }
}

main {
  display: block;
  padding-top: var(--space-3x);
}

section {
  margin-bottom: var(--space-3x);
}

section.box {
  background-color: var(--extra-light-grey);
  padding: var(--space-3x);
}

@media (prefers-color-scheme: dark) {
  section.box {
    border: 1px solid var(--light-gray);
  }
}

section.header-line {
  border-top: 1px solid var(--light-gray);
  padding-top: var(--space-3x);
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
p,
hr,
ol,
ul {
  margin-top: 0;
}

h1,
h2,
h3,
h4,
h5 {
  font-family: var(--sans-serif);
  line-height: 1.2;
  margin-bottom: 0.8em;
}

article p,
article hr,
article ol,
article ul,
article dl {
  margin-bottom: var(--paragraph-spacing);
}

article ol li p,
article ul li p {
  margin: 0;
}

article h1 {
  font-size: 3rem;
  line-height: 1.1;
  margin-bottom: 1.5rem;
}

@media only screen and (min-width: 576px) {
  article h1 {
    font-size: 3.6rem;
  }
}

@media only screen and (min-width: 1200px) {
  article h1 {
    font-size: 4rem;
  }
}

.dateline {
  margin-bottom: 3rem;
}

.dateline a {
  color: inherit;
  text-decoration: underline;
}

.dateline,
.subtitle {
  font-family: var(--sans-serif);
  font-size: var(--dateline-font-size);
  color: var(--gray);
}

.subtitle {
  font-size: var(--post-subtitle-size);
}


article h2 {
  font-size: 2.4rem;
  margin-bottom: var(--header-spacing);
}

article h3 {
  font-size: 2rem;
  margin-bottom: var(--header-spacing);
}

article h4,
article h5 {
  font-size: inherit;
  margin-bottom: var(--header-spacing);
}

article h5 {
  color: var(--gray);
  font-weight: 400;
}

a {
  color: var(--accent-color);
  text-decoration: none;
}

a:hover {
  color: var(--accent-color-hover);
  text-decoration: underline;
}

blockquote {
  font-size: var(--blockquote-font-size);
  color: var(--dark-gray);
  border-left: 1px solid var(--light-gray);
  margin: var(--space-3x) 0;
  padding: 0 var(--space-3x);
  /* This is to clear the call-out floats */
  overflow: hidden;
}

blockquote blockquote {
  border-left: 0;
}

blockquote p:last-child {
  margin-bottom: 0;
}

hr {
  border: 0;
  background-color: var(--light-gray);
  height: 1px;
}

pre {
  max-width: 100%;
  overflow-x: auto;
  font-size: 0.8em;
  border-radius: 3px;
  background-color: var(--code-bg-color);
  padding: 1rem;
}

pre,
code {
  font-family: var(--mono);
}

:not(pre):not(h1):not(h2):not(h3):not(h4):not(h5)>code {
  font-size: 0.8em;
  font-weight: 500;
  color: var(--code-color);
  padding: .15em .2em .05em;
  border-radius: 3px;
  background-color: var(--code-bg-color);
}

pre[class*="language-"] {
  border-radius: 3px;
  font-size: 14px;
  line-height: 1.375;
  direction: ltr;
  text-align: left;
  white-space: pre;
  word-spacing: normal;
  word-break: normal;
  tab-size: 2;
  margin-bottom: 1rem;
  padding: 1rem;
}

article ol,
article ul {
  padding: 0;
  list-style: none;
  counter-reset: li;
  position: relative;
}

article ol li,
article ul li {
  margin-bottom: 0;
}

article ol li:last-child,
article ul li:last-child {
  margin-bottom: 0;
}

article ol li {
  counter-increment: li;
  padding-left: 1.5em;
}

article ul li {
  padding-left: 1em;
}

article ol li::before,
article ul li::before {
  position: absolute;
  left: 0;
  color: var(--mid-gray);
}

article ol li::before {
  content: counter(li) ".";

}

article ul li::before {
  content: "•";
}

table {
  font-family: var(--sans-serif);
  font-size: 1.6rem;
  margin-bottom: 1em;
  border-collapse: collapse;
  width: 100%;
}

.callout table {
  font-size: inherit;
}

td,
th {
  border: 1px solid var(--light-gray);
  padding: 3px 6px;
  text-align: left;
}

/* Special row colors for tables */
tr.row-blue {
  background: rgb(199, 235, 255);
  color: rgb(0, 85, 133);
}
tr.row-green {
  background: rgb(217, 251, 208);
  color: rgb(28, 108, 9);
}
tr.row-red {
  background: rgb(255, 224, 219);
  color: rgb(184, 24, 0);
}
@media (prefers-color-scheme: dark) {
  tr.row-blue {
    background: rgba(96, 198, 255, 0.08);
    color: rgb(96, 198, 255);
  }
  tr.row-green {
    color: rgb(144, 214, 127);
    background: rgba(144, 214, 127, 0.08);
  }
  tr.row-red {
    background: rgb(75, 47, 54);
    color: rgb(255, 179, 210);
  }
}



/* Forms */
button,
input {
  font-family: var(--sans-serif);
  font-size: 14px;
  padding: 5px 10px;
  border-radius: 3px;
  margin: 0;
  border: 1px solid rgba(0, 0, 0, 0.2);
}

input[type="submit"],
button {
  cursor: pointer;
  -webkit-appearance: none;
}

.subscribe-button {
  background-color: var(--accent-color);
  color: #fff;
  border-color: transparent;
}

.subscribe-button:hover,
.subscribe-button:active,
.subscribe-button:focus {
  background-color: var(--accent-color-hover);
}

.inline-form {
  display: flex;
  width: 100%;
}

footer .inline-form {
  display: inline-flex;
  width: auto;
}

.inline-form input {
  flex-grow: 1;
  width: 100%;
  margin-right: 3px;
}

/* Direct Links / Markdown Headers */
.direct-link {
  text-decoration: none;
  color: transparent;
}

.direct-link:focus,
:hover>.direct-link {
  color: var(--accent-color);
}

/* Header */
header {
  padding: 1.2rem 0;
  border-bottom: 1px dashed var(--light-gray);
  font-size: 1.4rem;
}

@media only screen and (min-width: 576px) {
  header {
    padding: var(--space-2x) 0;
    font-size: inherit;
  }
}

header .wrapper {
  display: flex;
  align-items: center;
}

.nav-title {
  line-height: 1;
  display: inline-block;
  font-size: inherit;
  margin: 0;
  margin-right: var(--space-2x);
}

.nav {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
}

.nav-item {
  display: inline-block;
  margin-right: var(--space-2x);
  white-space: nowrap;
}

.nav-item:last-child {
  margin-right: 0;
}

.nav-item.desktop-only {
  display: none;
}

.nav-item.highlight a {
  color: var(--accent-color);
}

@media only screen and (max-width: 575px) {
  .nav-item.highlight a {
    color: white;
    background-color: var(--accent-color);
    border-radius: 3px;
    padding: 2px 6px;
  }

  .nav-item.highlight a:hover {
    color: white;
    text-decoration: none;
    background-color: var(--accent-color-hover);
  }
}

@media only screen and (min-width: 576px) {
  .nav {
    font-size: inherit;
  }

  .nav-title {
    font-size: 1.6rem;
    margin-right: var(--space-3x);
  }

  .nav-item.desktop-only {
    display: inline-block;
  }
}

header a {
  text-decoration: none;
  color: inherit;
}

header a:hover,
header a.active {
  text-decoration: underline;
}

/* Footer */
footer {
  padding: calc(var(--space-2x) * 2) 0;
  border-top: 1px dashed var(--light-gray);
}

article {
  line-height: var(--post-body-lh);
  font-size: var(--post-body-font-size);
  font-family: var(--serif);
}

article img,
article iframe {
  max-width: 100%;
}

/* Footnotes */
sub,
sup {
  font-size: 75%;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}

sub {
  bottom: -0.25em;
}

sup {
  top: -0.5em;
}

sup a {
  text-decoration: dotted;
}

.footnotes {
  font-size: var(--footnotes-font-size);
}

/* Sidebar adjustments */
aside {
  border-top: 1px solid var(--light-gray);
  padding-top: var(--space-3x);
}

aside .box {
  display: none;
  /* don't show on small screens */
}

aside .box h2 {
  margin-bottom: 1rem;
}

@media only screen and (min-width: 992px) {
  aside {
    border-top: 0;
    padding-top: 0;
  }

  aside .box {
    display: block;
  }
}

/* Callout */
.callout {
  padding: var(--space-3x) var(--space-2x);
  margin-bottom: var(--space-2x);
  margin-left: calc(var(--space-2x) * -1);

  width: calc(100% + var(--space-2x) * 2);
  background: var(--extra-light-grey);

  font-family: var(--sans-serif);
  font-size: var(--callout-font-size);
  line-height: 1.6;
}

.callout h4 {
  color: var(--body-text-color);
}

.callout p {
  margin-top: 0;
  margin-bottom: 1em;
}

.callout ul,
.callout ol,
.callout p:last-child {
  margin-bottom: 0;
}

.callout code,
.callout pre {
  background-color: var(--callout-code-color);
}

@media only screen and (min-width: 1240px) {
  .callout {
    background: var(--extra-light-grey);
    padding: var(--space-3x);
    float: left;
    width: var(--callout-width);
    margin-right: var(--paragraph-spacing);
    margin-bottom: var(--space-1x);
    margin-left: -50px;
  }

  /* because floats */
  article ol,
  article ul {
    overflow: hidden;
  }
}


/* Post List */
.postlist {
  padding: 0;
  list-style: none;
  margin: 0 0 1em;
  font-size: var(--post-body-font-size);
}

aside .postlist {
  font-size: inherit;
}

aside .postlist-item,
.postlist-item {
  margin-bottom: var(--space-2x);
}

.postlist-link {
  color: inherit;
  margin-right: 0.5rem;
  font-family: var(--serif);
}

aside .postlist-link {
  font-family: inherit;
}

.postlist-date {
  margin-right: 0.5rem;
  display: inline-block;
  font-weight: bold;
  color: var(--gray);
}

.postlist-date,
.post-tag {
  font-size: var(--post-tag-font-size);
  font-family: var(--sans-serif);
}

aside .postlist-date {
  display: none;
}

aside .post-tags {
  display: block;
}

:not(aside) .post-tag {
  display: inline-block;
  margin-top: 4px;
  border-radius: 3px;
  padding: 1px 5px;
  color: var(--accent-color);
  border: 1px solid var(--accent-color-border);
}

a.post-tag:hover {
  background: var(--accent-color);
  color: white;
  text-decoration: none;
}

/* Various image styles */
.img-center {
  display: block;
  margin: 0 auto;
  margin-bottom: var(--space-2x);
}

.img-float {
  display: block;
  margin: 0 auto;
  margin-bottom: var(--space-2x);
}
@media only screen and (min-width: 576px) {
  .img-float {
    float: left;
    margin-right: var(--space-2x);
    margin-bottom: 0;
  }
}

/* Side-by-side images */
.img-flex-equal {
  display: flex;
  margin-bottom: var(--paragraph-spacing);
}

.img-flex-equal>div {
  margin-right: var(--space-2x);
}

.img-flex-equal>div:last-child {
  margin-right: 0;
}

figure,
figure.img-center {
  margin: 0 0 var(--paragraph-spacing) 0;
  display: table;
}

figure.img-center {
  margin: 0 auto var(--paragraph-spacing);
}

figcaption {
  width: 0;
  min-width: 100%;
  font-size: 0.8em;
  font-family: var(--sans-serif);
}

figure p {
  margin: 0;
}

/* Featured section on Archive */
.featured {
  list-style: none;
  padding: 0;
  margin-bottom: var(--space-3x);
}

.featured-header,
.featured-subtitle {
  margin-bottom: var(--space-1x);
}

.featured-subtitle {
  font-size: 1.1em;
}

.featured-content {
  max-width: 700px;
}

.featured-item a {
  display: block;
  margin-bottom: var(--space-2x);

  text-decoration: none;
  color: inherit;
}

.featured-item img {
  display: none;

}

@media only screen and (min-width: 576px) {
  .featured {
    margin-bottom: 0;
  }

  .featured-item a {
    display: flex;
    padding: var(--space-2x);
    margin-bottom: 0;
  }

  .featured-item a:hover {
    background-color: var(--extra-light-grey);
  }

  .featured-item img {
    display: block;
    width: 168px;
    height: 121px;
    object-fit: cover;
    margin-right: var(--space-2x);
  }
}

/* Definition lists that have inline terms */
dl {
  padding: 0;
  margin-top: 0;
}
dt {
  font-weight: bold;
}
dt, dd {
  display: inline;
  margin: 0;
}
dd:not(:last-child)::after {
  content: "";
  display: block;
  padding: var(--space-1x);
}
.postlist { counter-reset: start-from 2 }