/* Profile avatar v111: one profile image source across identity and owned assets. */

.avatar,
.identity-option-avatar,
.identity-profile-avatar,
.skill-uploader-avatar,
.skill-detail-avatar,
.compact-meta-avatar {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.hux-avatar-fallback,
.hux-avatar-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hux-avatar-fallback {
  z-index: 0;
  display: grid;
  place-items: center;
  background: inherit;
  color: inherit;
  font: inherit;
}

.hux-avatar-image {
  z-index: 1;
  display: block;
  object-fit: cover;
  background: #171717;
}

.identity-avatar-editor {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-width: 0;
  padding: 12px;
  border: 1px solid #303030;
  background:
    linear-gradient(90deg, rgb(255 77 77 / 7%), transparent 70%),
    #0e0e0e;
}

.identity-profile-avatar {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid #573434;
  background: #211717;
  color: var(--brand);
  font-size: 13px;
  font-weight: 720;
  line-height: 1;
}

.identity-avatar-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.identity-avatar-copy strong,
.identity-avatar-copy small,
.identity-avatar-status {
  overflow: hidden;
  margin: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.identity-avatar-copy strong {
  color: #e6e6e6;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
}

.identity-avatar-copy small,
.identity-avatar-status {
  color: #777777;
  font-size: 10px;
  line-height: 1.4;
}

.identity-avatar-status:not(:empty) {
  color: #b48a8a;
}

.identity-avatar-select {
  min-height: 34px;
  padding: 8px 11px;
  border: 1px solid #444444;
  border-radius: 0;
  background: #171717;
  color: #dedede;
  font: 600 11px/1.35 var(--font-body, Montserrat, "PingFang SC", system-ui, sans-serif);
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 140ms ease, background-color 140ms ease, color 140ms ease;
}

.identity-avatar-select:hover,
.identity-avatar-select:focus-visible {
  border-color: #765050;
  background: #211717;
  color: #ffffff;
  outline: none;
}

.identity-avatar-select:focus-visible {
  box-shadow: 0 0 0 2px #111111, 0 0 0 3px #8a4444;
}

.identity-profile-card[aria-busy="true"] .identity-avatar-select {
  border-color: #333333;
  background: #151515;
  color: #797979;
  cursor: wait;
}

.identity-profile-card[aria-busy="true"] .identity-profile-avatar::after {
  position: absolute;
  z-index: 2;
  right: 4px;
  bottom: 4px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 3px rgb(16 16 16 / 85%);
  content: "";
  animation: hux-avatar-upload-pulse 900ms ease-in-out infinite alternate;
}

.avatar,
.identity-option-avatar,
.skill-uploader-avatar,
.skill-detail-avatar,
.compact-meta-avatar {
  flex: 0 0 auto;
}

.skill-detail-avatar {
  display: grid;
  width: 38px;
  height: 38px;
  margin-right: 10px;
  place-items: center;
  border: 1px solid #4b3434;
  background: #1d1717;
  color: var(--brand);
  font-size: 12px;
  font-weight: 720;
  line-height: 1;
}

.compact-meta-person {
  display: flex;
  gap: 9px;
  align-items: center;
}

.compact-meta-avatar {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid #3d3434;
  background: #1b1717;
  color: var(--brand);
  font-size: 10px;
  font-weight: 720;
  line-height: 1;
}

@keyframes hux-avatar-upload-pulse {
  from { opacity: 0.45; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1); }
}

@media (max-width: 720px) {
  .identity-avatar-editor {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .identity-profile-avatar {
    width: 44px;
    height: 44px;
  }

  .identity-avatar-select {
    grid-column: 1 / -1;
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .identity-avatar-select {
    transition: none;
  }

  .identity-profile-card[aria-busy="true"] .identity-profile-avatar::after {
    animation: none;
  }
}
