$small-size: rem(24px);
$medium-size: rem(32px);
$large-size: rem(48px);
$stacking-order: (
  image: 10,
  shadow: 20,
);

.Polaris-Thumbnail {
  position: relative;
  display: block;
  overflow: hidden;
  background: color('white');
  max-width: 100%;
  border-radius: border-radius();

  &::after {
    content: '';
    position: relative;
    z-index: z-index(shadow, $stacking-order);
    display: block;
    padding-bottom: 100%;
    box-shadow: inset 0 0 0 1px rgba(33, 43, 54, 0.1);
    border-radius: border-radius();
  }
}

.Polaris-Thumbnail--sizeSmall {
  width: $small-size;
}

.Polaris-Thumbnail--sizeMedium {
  width: $medium-size;
}

.Polaris-Thumbnail--sizeLarge {
  width: $large-size;
}

.Polaris-Thumbnail--round {
  border-radius: 50%;
  &:after {
    border-radius: 50%;
  }
}

.Polaris-Thumbnail__Image {
  position: absolute;
  z-index: z-index(image, $stacking-order);
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  margin: auto;
  max-width: 100%;
  max-height: 100%;
}

.Polaris-Thumbnail__File {
  position: absolute;
  z-index: z-index(image, $stacking-order);
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  @include state(base);
  @include text-emphasis-strong;
  color: color('ink', 'lighter');
}