/* External links (marked by javascripts/external-links.js) get an "open in new
   tab" icon. The icon uses the current text color via mask-image, so it adapts
   to light/dark themes and the link's own colour. */
.md-content a.external-link::after {
  content: "";
  display: inline-block;
  width: 0.68em;
  height: 0.68em;
  margin-left: 0.2em;
  vertical-align: -0.02em;
  background-color: currentColor;
  opacity: 0.65;
  -webkit-mask-image: var(--external-link-icon);
  mask-image: var(--external-link-icon);
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  mask-size: contain;
}

:root {
  --external-link-icon: url('data:image/svg+xml;charset=utf-8,\
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">\
<path d="M14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3m-2 16H5V5h7V3H5c-1.11 0-2 .9-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7h-2z"/>\
</svg>');
}

/* Don't add the icon to links that are only an image (e.g. shield badges). */
.md-content a.external-link:has(img)::after {
  content: none;
}
