/**
 * Extra media containers.  Bootstrap ratio classes imported in _helpers.scss
 */

@use "../settings" as *;

.ratio-container {
  max-width: $font-size-base * 36;
  margin-right: auto;
  margin-left: auto;
}

// Alternative to .ratio which allows the container to grow and break ratio
// if it contains too much text content.
// https://css-tricks.com/aspect-ratio-boxes/#aa-the-pseudo-element-tactic
.ratio-text {
  position: relative;
  display: flex;
  align-items: stretch;
  width: 100%;

  &::before {
    float: left;
    padding-top: var(--#{$prefix}aspect-ratio);
    content: "";
  }

  &::after { /* to clear float */
    display: table;
    clear: both;
    content: "";
  }

  > * {
    width: 100%;
  }
}
