@mixin clearfix {
  *zoom: 1;
  &:before,
  &:after {
    display: table;
    content: "";
    line-height: 0;
  }
  &:after {
    clear: both;
  }
}

html {
  line-height: 1;
}

html,
body {
  overflow: auto;
  &.no-scroll {
    overflow: hidden;
  }
  height: 100%;
  line-height: 1.2
}

body {
  font-family: $base-font;
  color: $overlay-color;
  background: $white;
}

a {
  color: $overlay-color;
  outline: none;
  text-decoration: none
}

em {
  font-style: italic;
}

table {
  border-collapse: collapse;
  border-spacing: 0
}

caption,
th,
td {
  text-align: left;
  font-weight: normal;
  vertical-align: middle
}

q,
blockquote {
  quotes: none
}

q:before,
q:after,
blockquote:before,
blockquote:after {
  content: "";
  content: none
}

a img {
  border: none;
}

article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
main,
menu,
nav,
section,
summary {
  display: block
}

*,
*:after,
*:before {
  box-sizing: border-box
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 1.8rem 0 0.5rem;
  font-family: $base-font;
}

h1 {
  font-size: 1.6em;
}

h2 {
  font-size: 1em;
}

h3 {
  font-size: 0.86em;
}

h4 {
  font-size: 0.8em;
}

h5 {
  font-size: 0.72em;
}

h6 {
  font-size: 0.65em;
}

figure {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  flex-wrap: wrap;
  margin: 1em 0;
  @include clearfix();
  figcaption {
    margin-bottom: 0.5em;
    color: lighten($black, 40);
    font-size: 12px;
    width: 100%;
    text-align: center;
  }
  @media (prefers-color-scheme: dark) {
    figcaption {
      color: darken($white, 25);
    }
  }
  img {
    margin-bottom: 10px;
  }
  > a {
    display: block;
    border: none !important;
  }
  &.half {
    @media only screen and (min-width: $small) {
      > a, > img {
        width: calc(50% - 4px);
        float: left;
        margin-left: 1px;
        margin-right: 1px;
      }
      figcaption {
        clear: left;
      }
    }
  }
  &.third {
    @media only screen and (min-width: $small) {
      > a, > img {
        width: calc(33.3% - 6px);
        float: left;
        margin-left: 1px;
        margin-right: 1px;
      }
      figcaption {
        clear: left;
      }
    }
  }
}

@media only screen and (max-width: $small - 1px) {
  figure {
    justify-content: center;
  }
}

img {
  display: block;
  max-width: 100%;
  height: auto;
  -ms-interpolation-mode: bicubic;
  image-rendering: optimizeQuality;
  margin: 0 auto;
  border: 1px solid;
  border-color: $overlay-color;
}

blockquote {
  margin: 1em 1em 1em 0;
  padding-left: 1em;
  padding-right: 1em;
  font-style: italic;
  border-left: 0.25em solid $gray;
  cite {
    font-style: italic;
    font-size: 0.85em;
    &:before {
      content: "\2014";
      padding-right: 5px;
    }
  }
}

address {
  font-size: 14px;
}

cite {
  font-style: italic;
  font-size: 0.85em;
}

ul > li {
  list-style: square;
}

ol > li {
  list-style: inside decimal;
}

dt {
  border: 1px solid darken($white, 7%);
  padding: 0.5em;
  background-color: darken($white, 5%);
  font-weight: bold;
}

dd {
  padding: 0.5em 1em;
  margin-left: 0;
  border: 1px solid darken($white, 7%);
  border-top: 0;
}

table {
  width: 100%;
  font-size: 14px;
  border-collapse: collapse;
}

thead {
  background-color: darken($white, 5%);
}

th,
td {
  border: 1px solid darken($white, 7%);
}

th,
td {
  text-align: center;
  padding: 0.5em;
  a {
    text-decoration: none !important;
  }
}

th:first-child,
td:first-child {
  text-align: left;
}

th:last-child,
td:last-child {
  text-align: right;
}

.gist {
  tr,
  td {
    border-bottom: 0;
  }
}

sup, sub {
  font-size: 75%;
}

sup {
  top: -0.6em
}

sub {
  bottom: -0.2em
}

var {
  font-weight: bold;
}

video {
  max-width: 100%;
  height: auto;
}

.video-iframe {
  position: absolute;
  top: 0;
  left: 0;
}

.video-embedded {
  position: relative;
  height: 0;
  max-width: 100%;
  padding-top: 56.25%;
  overflow: hidden;
}

.video-local,
.video-embedded {
  display: flex;
  margin: 20px 0;
  align-items: center;
  justify-content: center;
  text-align: center;
}

embed,
iframe,
object {
  max-width: 100%;
}

iframe {
  border-style: none;
  width: 100%;
  height: 100%;
  border: 0;
  overflow: hidden;
  }

figure > table {
  display: block;
  overflow-x: auto;
}

pre,
kbd {
  overflow-x: auto;
  padding: 0.9rem;
  margin: 0;
}

p > code,
a > code,
li > code,
figcaption > code,
td > code,
kbd {
  padding: 0.1rem 0.15rem;
  font-size: 12px;
  background-color: darken($white, 15%);
  font-family: $base-font;
}

kbd {
  padding: 3px;
  border-radius: 4px;
  border-top: 1px solid;
}

footer {
  margin-bottom: 8px;
  text-align: center;
  font-size: 11px;
  line-height: 0.8rem;
  width: 100%;
  > a {
    color: $shamrock-green;
  }
}

#precache-payload{
  display: none;
}
