@if $enable-flex {
  .media {
    display: flex;
    margin-bottom: $spacer;
  }
  .media__body {
    flex: 1;
    word-break: break-word;
    overflow: hidden;
  }
  .media__object {
    &--inverse {
      order: 2;
    }
    &--middle {
      align-self: center;
    }
    &--bottom {
      align-self: flex-end;
    }
  }
} @else {
  .media {
    margin-top: $spacer;

    &:first-child {
      margin-top: 0;
    }
  }
  .media,
  .media__body {
    overflow: hidden;
    zoom: 1;
  }
  .media__body {
    width: 10000px;
  }
  .media__object,
  .media__body {
    display: table-cell;
    vertical-align: top;
  }
  .media__object--middle {
    vertical-align: middle;
  }
  .media__object--bottom {
    vertical-align: bottom;
  }
  .media__object {
    // Fix collapse in webkit from max-width: 100% and display: table-cell.
    &.img--thumbnail {
      max-width: none;
    }
  }
}


//
// Images/elements as the media anchor
//

.media__object > * {
  // Force things inside object to have width/height if needed
  display: block;
}


//
// Alignment
//

.media__object {
  margin-right: $spacer;
}

.media__object--inverse {
  margin-left: $spacer;
  margin-right: 0;
}


//
// Headings
//

.media__heading {
  margin-bottom: 0; // remove default margin-bottom
}


//
// Media list variation
//

.media--list {
  padding-left: 0;
  list-style: none;
}
