img {
  display: inherit;
  height: auto;
  max-width: 100%;
}

object,
iframe,
embed,
canvas,
video,
audio {
  margin: {
    left: auto;
    right: auto;
  }

  max-width: 100%;
}

// Prevents modern browsers from displaying 'audio' without controls and
// removes excess height in iOS devices.

audio {
  &:not([controls]) {
    display: none;
    height: 0;
  }
}

// Corrects overflow displayed oddly in IE9

svg {
  // stylelint-disable-next-line suitcss/selector-root-no-composition
  &:not(:root) {
    overflow: hidden;
  }
}

figure {
  img,
  iframe {
    display: block;
    margin: 0 auto;
  }

  figcaption {
    font-style: italic;
    text-align: center;
  }
}
