/*
 * The image viewer (specs/005 FR-016): pictures in messages and posts open large over
 * the page, on every page with messages (layouts render shared/_image_viewer).
 */

.attachment__open {
  display: inline-block;
  max-width: 100%;
  cursor: zoom-in;
  border-radius: var(--radius-standard);
}

.attachment__video {
  display: block;
  max-width: 100%;
  max-height: 360px;
  background-color: var(--color-deep-night);
  border-radius: var(--radius-standard);
}

dialog.image-viewer {
  max-width: none;
  max-height: none;
  padding: 0;
  color: var(--color-foreground);
  background: transparent;
  border: 0;
}

dialog.image-viewer[open] {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  width: 100vw;
  height: 100dvh;
  margin: 0;
  padding: var(--space-4);
}

dialog.image-viewer::backdrop {
  background-color: rgba(27, 26, 35, 0.88);
}

.image-viewer__image {
  max-width: 100%;
  max-height: calc(100dvh - 120px);
  object-fit: contain;
  border-radius: var(--radius-standard);
  background-color: var(--color-deep-night);
}

.image-viewer .image-viewer__close {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  width: 44px;
  color: var(--color-foreground);
  background-color: var(--color-card-raised);
}

.image-viewer__original {
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
}
