/* Image avatars and image messages. Loaded after chat.css. */

.chat-header-avatar {
  overflow: hidden;
}

.chat-header-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.chat-header-avatar.is-missing {
  background: #8e8e93;
  color: #ffffff;
}

.chat-bubble.chat-bubble-image {
  display: block;
  width: 75%;
  max-width: 75%;
  padding: 0;
  overflow: hidden;
}

.chat-image-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
}

.chat-image-grid[data-count="1"] {
  grid-template-columns: 1fr;
}

.chat-image-grid[data-count="3"] .chat-image-cell:nth-child(3) {
  grid-column: 1 / -1;
  aspect-ratio: 2 / 1;
}

.chat-image-cell {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1;
  background: #8e8e93;
}

.chat-image-cell img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
  -webkit-user-drag: none;
}

.chat-image-more {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  color: #ffffff;
  font-size: calc(var(--base) * 28);
  font-weight: 600;
}

.chat-image-caption {
  padding: calc(var(--base) * 8) calc(var(--base) * 12);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
