@keyframes target-animation {
  0% {
    background: transparent;
  }
  5% {
    background: #74c67280;
  }
  75% {
    background: #74c67280;
  }
  100% {
    background: transparent;
  }
}

.markdown {
  h1, h2, h3 {
    scroll-margin-top: calc(var(--header-height) * 2 + 1rem);
    @media (min-width: 800px) {
      scroll-margin-top: calc(var(--header-height) + 1rem);
    }
    code {
      background: transparent;
    }

    &:target {
      animation: 2s target-animation;
    }
  }

  h1 {
    font-size: 2rem;
    font-weight: 900;
    margin-bottom: .2rem;
  }

  h2 {
    font-size: 1.5rem;
    font-weight: bold;
    margin: 2.5rem 0 1rem;
  }

  h3 {
    font-size: 1.125rem;
    font-weight: bold;
    margin: 1.5rem 0 .6rem;
  }

  p {
    margin-bottom: 1rem;
  }

  ul {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
    list-style-type: disc;
  }

  ol {
    margin-bottom: .6rem;
    padding-left: 1.5rem;
    list-style-type: decimal;
  }

  a {
    color: #474fbc;
    text-decoration-thickness: from-font;

    &[href^="http"]:after {
      content: '';
      width: 1em;
      height: 1em;
      vertical-align: -0.05em;
      margin-left: 0.1em;
      display: inline-block;
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48' width='48px' height='48px'%3E%3Cpath style='fill: %23474fbc' d='M 41.470703 4.9863281 A 1.50015 1.50015 0 0 0 41.308594 5 L 27.5 5 A 1.50015 1.50015 0 1 0 27.5 8 L 37.878906 8 L 22.439453 23.439453 A 1.50015 1.50015 0 1 0 24.560547 25.560547 L 40 10.121094 L 40 20.5 A 1.50015 1.50015 0 1 0 43 20.5 L 43 6.6894531 A 1.50015 1.50015 0 0 0 41.470703 4.9863281 z M 12.5 8 C 8.3754991 8 5 11.375499 5 15.5 L 5 35.5 C 5 39.624501 8.3754991 43 12.5 43 L 32.5 43 C 36.624501 43 40 39.624501 40 35.5 L 40 25.5 A 1.50015 1.50015 0 1 0 37 25.5 L 37 35.5 C 37 38.003499 35.003499 40 32.5 40 L 12.5 40 C 9.9965009 40 8 38.003499 8 35.5 L 8 15.5 C 8 12.996501 9.9965009 11 12.5 11 L 22.5 11 A 1.50015 1.50015 0 1 0 22.5 8 L 12.5 8 z'/%3E%3C/svg%3E");
      background-size: contain;
      background-repeat: no-repeat;
      background-position: bottom center;
    }
  }
}

.markdown__badge {
  &:after {
    font-size: 0.625rem;
    letter-spacing: .1em;
    padding: .15rem .5rem;
    text-transform: uppercase;
    border-radius: 1000rem;
    font-weight: 500;
    display: inline-block;
    border: 1px solid #d9d9d9;
    vertical-align: super;
    margin-left: .5rem;
  }

  &--new:after {
    content: 'New feature';
    background-color: #d4fac3;
    border-color: #d4fac3;
  }
}