:host {
  position: relative;
  box-sizing: border-box;
  font-feature-settings: "cv03", "cv04", "cv11";
}
:host *, :host *:before, :host *:after {
  box-sizing: inherit;
}

/**
 * @prop --size: The size of the avatar.
 */
:host {
  display: inline-block;
  --size: 3rem;
}

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: var(--size);
  height: var(--size);
  background-color: var(--sl-color-gray-300);
  font-family: var(--sl-font-sans);
  font-size: calc(var(--size) * 0.5);
  font-weight: var(--sl-font-weight-normal);
  color: var(--sl-color-white);
  overflow: hidden;
  user-select: none;
  vertical-align: middle;
}

.avatar--circle {
  border-radius: var(--sl-border-radius-circle);
}

.avatar--rounded {
  border-radius: var(--sl-border-radius-medium);
}

.avatar--square {
  border-radius: 0;
}

.avatar__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.avatar__initials {
  line-height: 1;
  text-transform: uppercase;
}

.avatar__image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}