.richtext {
  line-height: 1.4;
  font-size: 18px;
}

.richtext *:first-child {
  margin-top: 0;
}

.richtext h1,
.richtext h2,
.richtext h3,
.richtext h4 {
  margin-top: 1.5em;
  margin-bottom: 0;
  line-height: 1.2;
}

/* phones: a long word (e.g. "Acknowledgement" inside a theme box) breaks with a hyphen rather than running past
   the box. Narrow screens only, so desktop headings never get hyphenated. */
@media (max-width: 600px) {
  .richtext h1,
  .richtext h2,
  .richtext h3,
  .richtext h4 {
    -webkit-hyphens: auto;  /* Safari / iPhone */
    hyphens: auto;
    overflow-wrap: break-word;  /* if the browser has no hyphenation for the language: break the word anyway */
  }
}

/* heading sizes and colours as on the People and Parks site */
.richtext h1 {
  color: var(--mid-green);
  font-weight: 900;
  font-size: 2em;
}

.richtext h2 {
  color: var(--mid-green);
  font-weight: 800;
  font-size: 1.7em;
}

.richtext h3 {
  color: var(--deep-green);
  font-weight: 800;
  font-size: 1.4em;
}

.richtext h4 {
  color: var(--teal);
  font-weight: 800;
  font-size: 1.2em;
}

.richtext h1 b,
.richtext h1 strong,
.richtext h2 b,
.richtext h2 strong,
.richtext h3 b,
.richtext h3 strong,
.richtext h4 b,
.richtext h4 strong {
  font-weight: inherit;
}

.richtext p {
  margin-top: 1.4em;
  min-height: 1em;
  margin-bottom: 0;
}

/* external links - any https:// link not to this site. Update the domain
   on go live (also in blocks.css and project/settings.py). */
.richtext a[href^="https://"]:not([href*="naturedosedirectory.org"]):before {
  content: ' ';
  background: url('/static/cms/images/external.svg') center/contain no-repeat;
  width: 16px;
  height: 16px;
  display: inline-block;
  vertical-align: -2px;
  margin-right: 5px;
}

.richtext a[href^="mailto:"]:before {
  content: ' ';
  background: url('/static/cms/images/envelope.svg') center/contain no-repeat;
  width: 16px;
  height: 16px;
  display: inline-block;
  vertical-align: middle;
  margin-right: 5px;
  vertical-align: -1px;
}

.richtext a[href^="tel:"]:before {
  content: ' ';
  background: url('/static/cms/images/phone.svg') center/contain no-repeat;
  width: 16px;
  height: 16px;
  display: inline-block;
  vertical-align: middle;
  margin-right: 5px;
  vertical-align: -1px;
}

.richtext a[href*="/documents/"]:before {
  content: ' ';
  background: url('/static/cms/images/file.svg') center/contain no-repeat;
  width: 16px;
  height: 16px;
  display: inline-block;
  vertical-align: middle;
  margin-right: 5px;
  vertical-align: -1px;
}

.richtext blockquote {
  position: relative;
  margin: 3rem 0 1.4rem;
  padding: 0;
  font-style: italic;
}

ul,
ol {
  margin: 1.4em 0 1em;
  padding-left: 1.5em;
}

li {
  margin-bottom: 1em;
}

.richtext .responsive-object {
  position: relative;
  margin: 1em 0;
}

.richtext .responsive-object iframe {
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  position: absolute;
}

.richtext-image {
  margin: 1em 0;
  width: 100%;
  display: block;
  height: auto;
}

/* phones: smaller headings (h1 most), so a heading isn't three lines of big type */
@media (max-width: 600px) {
  .richtext h1 {
    font-size: 1.55em;  /* 28px */
  }

  .richtext h2 {
    font-size: 1.35em;  /* 24px */
  }

  .richtext h3 {
    font-size: 1.15em;  /* 21px */
  }

  .richtext h4 {
    font-size: 1.05em;  /* 19px */
  }
}
