:host {
  display: inline-block;
  width: 100%;
  position: relative;
}

img {
  display: block;
  position: var(--ux-image-inner-position);
  top: 0;
  width: 100%;
  height: var(--ux-image-inner-height);
}
img::before {
  content: "";
  width: 100%;
  height: 100%;
  background-color: var(--ux-image-placeholder-background-color);
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  color: transparent;
}
img::after {
  content: attr(alt);
  font-family: var(--ux-font);
  width: 100%;
  text-align: center;
  background-color: var(--ux-image-placeholder-background-color);
  position: absolute;
  top: var(--ux-image-error-alt-position, 50%);
  left: 0;
  transform: translateY(calc(-1 * (var(--ux-image-error-alt-position, 50%))));
  color: var(--ux-image-error-alt-text-color);
  font-size: var(--ux-font-size-medium);
}

.placeholder-container {
  position: relative;
  background-color: var(--ux-image-placeholder-background-color);
  padding-top: var(--ux-image-placeholder-padding-top);
}

.placeholder-content {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.error-icon {
  color: var(--ux-image-error-color);
  font-size: var(--ux-image-error-icon-size);
}

.error-message {
  color: var(--ux-image-error-color);
  margin-top: 10px;
  font-size: var(--ux-font-size-medium);
}

.error-alt-text {
  color: var(--ux-image-error-alt-text-color);
  margin-top: 10px;
  font-size: var(--ux-font-size-medium);
}