.shortcode-tip,
.shortcode-warning,
.shortcode-error,
.shortcode-disclaimer {
  background: $color-grey;
  margin: 1rem 0;
  padding: 1rem 1rem 1rem 2rem;
  position: relative;

  h3,
  h4 {
    margin-top: 0;
  }

  p {
    margin: 0 0 2rem !important;
    padding: 0 !important;
  }

  p:first-of-type {
    margin: 0 !important;
  }

  p:last-of-type {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
  }

  /* Fix for Hugo <p> tag bug */
  p:empty + & {
    margin-top: -2rem;
  }

  + p:empty {
    margin-bottom: -2rem;
  }

  /* Fix for heading spacer */
  + h1,
  + h2,
  + h3,
  + h4,
  + h5,
  + h6 {
    padding-top: 1rem;
  }

  &::before {
    /* Set the circle size here */
    $circle-size: 1.5rem;

    background: $color-brand;
    border-radius: calc($circle-size / 2);
    color: $color-white;
    content: "ℹ︎";
    font-weight: 600;
    height: $circle-size;
    left: calc(-$circle-size / 2);
    line-height: $circle-size;
    position: absolute;
    text-align: center;
    top: 1rem;
    width: $circle-size;
    z-index: 5;
  }

  &::after {
    background: $color-brand;
    content: "";
    height: 100%;
    left: -0.1rem;
    position: absolute;
    top: 0;
    width: 0.2rem;
    z-index: 0;
  }
}

.shortcode-warning {
  &::before {
    background-color: color($color-merino saturation(+50%) w(-50%));
    content: "!";
  }

  &::after {
    background: color($color-merino saturation(+50%) w(-50%));
  }
}

.shortcode-error {
  &::before {
    background-color: $color-error;
    content: "!";
  }

  &::after {
    background: $color-error;
  }
}

.shortcode-disclaimer {
  &::before {
    background-color: $color-sinbad;
    content: "?";
  }

  &::after {
    background-color: $color-sinbad;
  }
}

.post-media {
  background: rgba(0, 0, 0, 0.1);
  margin-left: auto !important;
  padding: 1.2em;
  text-align: center;
  width: 100% !important;

  img {
    margin-bottom: 0.5em;
    max-width: 100%;
  }

  figcaption {
    font-size: 0.8em;
    font-style: italic;
    opacity: 0.8;
  }
}

.youtube-embed--wrapper {
  height: 0;
  padding-bottom: 56.25%; /* 16:9 */
  position: relative;
  width: 100%;

  > .youtube-embed {
    height: 100%;
    position: absolute;
    width: 100%;
  }
}

.pretty-screenshot,
.md-content figure {
  text-align: center;
  width: 100%;

  img {
    display: block;
    margin-left: auto;
    margin-right: auto;
    max-width: 100%;
  }

  figcaption {
    font-size: 0.8em;

    p {
      margin-top: 0;
    }
  }
}

.pretty-screenshot figcaption {
  font-style: italic;
  margin-bottom: 1.2em;
  margin-top: 1.2em;
}

.pretty-screenshot img {
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23);
}

.md-content .obnoxious {
  font-size: 1.4rem;
  line-height: 1.2;

  img {
    display: block;
    margin: 0 auto;
  }

  h1,
  h2,
  h3 {
    background: $color-brand;
    color: #ffffff;
    font-size: 2rem !important;
    margin: 0;
    padding: 2em;
    text-align: center;

    a > svg {
      display: none;
    }
  }
}
