html {
  font-size: $base-font-size;
}

/**
 * Reset some basic elements
 */
body, h1, h2, h3, h4, h5, h6,
p, blockquote, pre, hr,
dl, dd, ol, ul, figure {
  margin: 0;
  padding: 0;

}



/**
 * Basic styling
 */
body {
  font: $base-font-weight #{$base-font-size}/#{$base-line-height} $base-font-family;
  color: rgba(var(--front), 0.72);
  background-color: $background-color;
  -webkit-text-size-adjust: 100%;
  -webkit-font-feature-settings: "kern" 1;
     -moz-font-feature-settings: "kern" 1;
       -o-font-feature-settings: "kern" 1;
          font-feature-settings: "kern" 1;
  font-kerning: normal;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  overflow-wrap: break-word;
  width: 100%;
  box-sizing:border-box;
}



.small {
  font-size: $small-font-size;
}

/**
 * Set `margin-bottom` to maintain vertical rhythm
 */
h1, h2, h3, h4, h5, h6,
p, blockquote, pre,
ul, ol, dl, figure,
%vertical-rhythm {
  margin-top: $spacing-unit / 2;
}

hr {
  margin-top: $spacing-unit;
  border: 1px solid rgba(var(--front), 0.1);
  border-width: 1px 0 0;

  & + p {
    margin-top: $spacing-unit;
  }
}

/**
 * `main` element
 */
main {
  display: block; /* Default value of `display` of `main` element is 'inline' in IE 11. */
}

a:focus-visible,
button:focus-visible {
  outline: 4px solid rgba(var(--primary-color-rgb), 0.6);
  outline-offset: 1px;
}

/**
 * Images
 */
img {
  max-width: 100%;
  height: auto;
  vertical-align: middle;
}



/**
 * Figures
 */
figure > img {
  display: block;
}

figcaption {
  padding-top: $spacing-unit / 4;
  font-size: $small-font-size;
  color: $grey-dk-000;
  text-align: center;

  a,
  a:visited,
  a:hover {
    color: $grey-dk-000;
    text-decoration: underline;
  }

  a:hover {
    color: $grey-dk-300;
  }
}


/**
 * iframes
 */
iframe {
  border: 1px solid rgba(0, 0, 0, 0.05);
}

/**
 * Lists
 */
ul, ol {
  margin-left: $spacing-unit;
}

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

li ul, li ol {
  margin-top: 0;
}


/**
 * Headings
 */

h1, h2, h3, h4, h5, h6 {
  font-weight: $heavy-font-weight;
  line-height: 1.4;
  color: var(--frontHex);
}

h1 {
  letter-spacing: -0.03em;
}


/**
 * Links
 */
a {
  color: var(--link-base-color);
  text-decoration: none;
  transition: color 100ms $ease;

  &:visited {
    color: var(--link-visited-color);
  }

  &:hover {
    color: var(--link-hover-color);
    text-decoration: underline;
  }

  .social-media-list &:hover {
    text-decoration: none;

    .username {
      text-decoration: underline;
    }
  }
}


/**
 * Blockquotes
 */
blockquote {
  background: #f8f8f8;
  padding: 24px;
  text-align: center;
  border: none;
  font-style: normal;
  font-weight: 400;
  box-sizing: border-box;

  cite {
    display: inline-block;
    @include responsive('font-size', 16, 22);
    font-style: normal;
  }

  > :last-child {
    margin-bottom: 0;
  }

  i, em {
    font-style: normal;
  }
}

blockquote,
blockquote > p {
  @include responsive('font-size', 22, 28);
  line-height: 1.4;
  color: #474747;
}



/**
 * Code formatting
 */
pre,
code {
  font-family: $code-font-family;
  font-size: 0.9375em;
  border: 1px solid $border-color-01;
  border-radius: 3px;
  background-color: $code-background-color;
}

code {
  padding: 1px 5px;
}

pre {
  padding: 8px 12px;
  overflow-x: auto;

  > code {
    border: 0;
    padding-right: 0;
    padding-left: 0;
  }
}

.highlight {
  border-radius: 3px;
  background: $code-background-color;
  @extend %vertical-rhythm;

  .highlighter-rouge & {
    background: $code-background-color;
  }
}



/**
 * Wrapper
 */
.main:not(.sidebar),
.wrapper {
  width: 100%;
  box-sizing: border-box;
  max-width: calc(#{$content-width} - (#{$spacing-unit}));
  margin-right: auto;
  margin-left: auto;
  // padding-right: $spacing-unit / 3 * 2;
  // padding-left: $spacing-unit / 3 * 2;
  @include clearfix;

  @include media-query(large) {
    max-width: calc(#{$content-width} - (#{$spacing-unit} * 2));
    padding-right: $spacing-unit;
    padding-left: $spacing-unit;
  }
}

.sidebar .wrapper {
  max-width: unset;
  box-sizing: border-box;
}


/**
 * Clearfix
 */
%clearfix:after {
  content: "";
  display: table;
  clear: both;
}



/**
 * Icons
 */

.orange {
  color: #f66a0a;
}

.grey {
  color: #828282;
}

.svg-icon {
  width: 16px;
  height: 16px;
  display: inline-block;
  fill: currentColor;
  padding: 5px 3px 2px 5px;
  vertical-align: text-bottom;
}


/**
 * Tables
 */
table {
  margin-top: $spacing-unit;
  margin-bottom: $spacing-unit;
  width: 100%;
  text-align: $table-text-align;
  color: $table-text-color;
  border-collapse: collapse;
  th, td {
    padding: ($spacing-unit / 3) ($spacing-unit / 3);
    vertical-align: top;
  }
  th {
    border-bottom: 1px solid $table-border-color;
    text-transform: uppercase;
    font-size: 0.8rem;
    font-weight: 700;
  }
  td {
    border-bottom: 1px solid $table-border-color;
  }

  @include media-query(large) {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
            -ms-overflow-style: -ms-autohiding-scrollbar;
  }
}

a.footnote {
  color: #474747;
  padding: 0 6px;
  font-size: 0.7rem;
}

ul.task-list {
  list-style: none inside;
  li {
    margin-left: 0!important;
      input {
        margin: 0 1rem 0 0;
      }
  }
}

.modal-image-container {
  z-index: 999;
  display: flex;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  align-items: center;
  opacity: 1.0;
  transition: opacity .5s;
  flex-direction: column;
  justify-content: space-between;

  &.hidden {
    opacity: 0.0;
    pointer-events: none;
    transition: opacity .5s;
    transform: translateY(0.5);

    .modal-image-inner {
      transform: translateY(50%);
    }
  }

  &.portrait {
    .modal-image-inner {
      .modal-image {
        max-height: 100%;
        width: auto;
      }
    }
  }

  &.loading {
    .modal-image-caption {
      opacity: 0;
      transition: none;
    }

    .modal-image {
      opacity: 0;
      transition: none;
    }

    .modal-image-loading {
      opacity: 0.5;
    }
  }
}

.modal-image-top {
  width: 100%;
  opacity: 1;
  position: relative;
  z-index: 999;
  display: flex;
  justify-content: flex-end;
  flex-direction: row;
  height: 60px;
  cursor: pointer;
}

.modal-image-bottom {
  height: 60px;
  width: 100%;
  position: relative;
  z-index: 999;
  cursor: pointer;
}

.modal-image-inner {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  transform: translateY(0%);
  transition: transform 0.5s ease;

  .modal-image-loading {
    background: url('/assets/loading-spinner.svg') center/ 50% no-repeat;
    width: 10rem;
    height: 10rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    position: absolute;
    top: calc(50% - 5rem);
    left: calc(50% - 5rem);
  }
}

.modal-image-overlay {
  background: rgba(225,225,225,0.95);
  position: fixed;
  width: 100%;
  height: 100%;
  top:0;
  left:0;
  cursor: pointer;
}

.modal-image {
  position: relative;
  transition: opacity 0.5s ease 0.25s;
}

.modal-image-close {
  cursor: pointer;
  transform: rotateZ(-45deg) scale(1.0);
  transition: transform 0.25s ease;
  width: 40px;
  height: 40px;
  border-radius: 30px;

  position: relative;
  margin: 10px 10px;

  &:before, &:after {
    content: '';
    background: $body-heading-color;
    border-radius: 8px;
    position: absolute;
  }

  &:before {
    width: 4px;
    height: 32px;
    left: 18px;
    top: 4px;
  }

  &:after {
    height: 4px;
    width: 32px;
    top: 18px;
    left: 4px;
  }

  &:hover {
    transform: rotateZ(-45deg) scale(1.15);
    transition: transform 0.25s ease;
  }
}

.modal-image-caption {
  text-align: center;
  padding: 1rem;
  margin: 0;
  position: relative;
  transition: opacity 0.5s ease 0.25s;

  &.hidden {
    display: none;
  }

  p {
    margin: 0;
  }
}

figcaption {
  &.modal-indicator, &.animation-controls {
    display: flex;
    align-items: center;
    justify-content: center;

    p {
      max-width: calc(100% - 39.5px);
    }

    svg {
      flex-basis: 32px;
      width: 32px;
      height: 32px;
      display: inline;
      color: $grey-dk-000;
      margin-top: $spacing-unit / 2;
      margin-left: $spacing-unit / 4;
      cursor: pointer;
    }
  }

  &.animation-controls {
    cursor: pointer;

    .pause {
      .play {
        display: none;
      }
    }

    .play {
      .pause {
        display: none;
      }
    }

    &.deactivated {
      &.default, svg {
        display: none;
      }
    }

    button {
      border: 0;
      background: none;
      color: $grey-dk-000;
      display: flex;
      flex-direction: row;
      justify-content: center;
      align-items: center;
      cursor: pointer;

      p {
        margin: 0;
      }

      svg {
        margin-top: 0;
      }
    }
  }
}

.sr-only {
  position: absolute;
  left: -999rem;
}

a.skip-to-content-link {
  position: absolute;
  left: 50%;
  padding: 7px 15px;
  transform: translate(-50%, -100%);
  z-index: 12;
  font-size: 15px;
  font-weight: 500;
  color: white;
  background: #e77e23;
  border-bottom-left-radius: 5px;
  border-bottom-right-radius: 5px;
  transition: transform 150ms $ease;

  &:focus-visible {
    transform: translate(-50%, 0%);
  }
}
