@mixin markdown-typography {
  @include govuk-text-colour;
  @include govuk-font($size: 16);

  ol,
  ul,
  p {
    margin: 0 0 govuk-spacing(4) 0;
    @include govuk-font($size: 19);
  }

  // Headings

  // put some spacing between any element followed by a heading
  // has to be padding on the heading otherwise margins would overlap

  * + h2,
  * + h3 {
    padding-top: govuk-spacing(4);
  }

  // Markdown is expected to be styled within a document with a H1 title
  // thus H1's are not expected and are discouraged by bare styling

  h1 {
    margin: 0;
    padding: 0;
    @include govuk-font($size: 19);
  }

  h2 {
    margin: 0 0 govuk-spacing(4) 0;
    @include govuk-font($size: 24, $weight: bold);
  }

  h3 {
    margin: 0 0 govuk-spacing(4) 0;
    @include govuk-font($size: 19, $weight: bold);
  }

  // H4, H5 and H6 are discouraged and thus styled the same

  h4,
  h5,
  h6 {
    margin: 0;
    @include govuk-font($size: 19, $weight: bold);
  }

  // Links

  a {
    @include govuk-link-common;
    @include govuk-link-style-default;
    @include govuk-text-break-word;

    &:focus {
      @include govuk-focused-text;
    }
  }

  // Lists

  ol,
  ul {
    // we intentionally don't set list-style for ol elements, so that they can
    // utilise the type attribute for the formatting. Browsers default to a
    // style of decimal.
    list-style-position: outside;
    margin: 0 0 govuk-spacing(4) govuk-spacing(4);
    padding: 0;
  }

  ul {
    list-style: disc;
  }

  li {
    margin: 0 0 govuk-spacing(2);
    padding: 0;

    p {
      margin: 0 0 govuk-spacing(2);
    }
  }

  // Text styles

  sup {
    font-size: .8em;
    line-height: .7em;
    vertical-align: super;
  }

  abbr {
    cursor: help;
    text-decoration: none;
  }

  // Horizontal Rule

  hr {
    margin-top: govuk-spacing(6) - 1px;
    margin-bottom: govuk-spacing(6);
    border-top: 1px solid $govuk-border-colour;
  }

  code {
    padding: 0 5px;
    color: #d13118;
    background-color: govuk-colour("light-grey");
  }
}
