.thumbnailBig {
  background-color: var(--media-thumbnail-background-color);
  width: var(--width);
  height: var(--height);
  max-width: 250px;
  max-height: 250px;
  margin: 3px 20px 5px 20px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.floatingEmbed,
.communityAvatar {
  max-width: 250px;
  max-height: 250px;
  display: inline-flex;
}

.communityAvatar {
  margin: 3px 20px 5px 20px;
}

.spoiler {
  width: 100px;
  height: 100px;
  margin: 3px 20px 5px 20px;
}

@media (max-width: 640px) {
  .communityAvatar {
    max-width: 125px;
    max-height: 125px;
    margin: 3px 10px 5px 5px;
    display: inline-block;
  }

  .spoiler {
    margin: 3px 10px 5px 5px;
  }
}

.thumbnailSmall {
  background-color: var(--media-thumbnail-background-color);
  width: var(--width);
  height: var(--height);
  max-width: 125px;
  max-height: 125px;
  margin: 3px 10px 5px 5px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.thumbnailSmall span,
.thumbnailSmall a,
.thumbnailSmall .noThumbnailButton {
  width: 100%;
  display: inline-block;
  overflow-wrap: break-word;
  text-align: center;
  cursor: pointer;
}

.noThumbnailButton {
  appearance: none;
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
  font: inherit;
  margin: 0;
  padding: 0;
}

.noThumbnailButton:focus-visible {
  outline: 1px dotted var(--post-link-text-color);
  outline-offset: 1px;
}

.thumbnail {
  float: left;
}

.removeFloat {
  float: none !important;
}

.thumbnail video {
  cursor: pointer;
}

.mediaToggleButton {
  all: unset;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  max-height: 100%;
  line-height: 0;
}

.mediaToggleButton:focus-visible {
  outline: 1px dotted var(--post-link-text-color);
  outline-offset: 1px;
}

.mediaToggleButton img,
.mediaToggleButton video {
  display: block;
}

.thumbnailBig > .mediaToggleButton,
.thumbnailSmall > .mediaToggleButton {
  width: 100%;
  height: 100%;
}

.hide {
  display: none !important;
}

.thumbnail .show {
  display: block;
}

.content img,
.content video,
.content iframe,
.content audio {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.content img {
  cursor: pointer;
}

.gifPlaceholder {
  width: 100%;
  height: 100%;
  display: inline-block;
  cursor: pointer;
}

.swfPlaceholder {
  display: inline-block;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--post-link-text-color);
  font-family: inherit;
  font-size: 9pt;
  line-height: 1.2;
  padding: 0;
  text-align: center;
  text-decoration: var(--post-link-text-decoration);
  cursor: pointer;
}

.swfPlaceholder:hover {
  color: var(--post-link-text-color-hover);
  text-decoration: var(--post-link-text-decoration-hover);
}

.content iframe {
  border: none;
  color-scheme: light;
}

.rufflePlayer {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: min(640px, 100%);
  height: 480px;
  max-width: 100%;
  border: var(--reply-desktop-border);
  background: var(--media-thumbnail-background-color);
  box-sizing: border-box;
  line-height: 1.2;
}

.rufflePlayerElement {
  display: block;
  width: 100%;
  height: 100%;
}

.rufflePlayerMount {
  display: block;
  width: 100%;
  height: 100%;
}

.rufflePlayerMountHidden {
  display: none;
}

.ruffleLoading,
.ruffleFallback {
  padding: 4px;
  color: var(--post-mobile-file-info-text-color);
  font-size: 9pt;
}

.ruffleFallback a {
  color: var(--post-link-text-color);
  text-decoration: var(--post-link-text-decoration);
}

.ruffleFallback a:hover {
  color: var(--post-link-text-color-hover);
  text-decoration: var(--post-link-text-decoration-hover);
}

.fileInfo {
  padding-bottom: 5px;
  text-align: center;
  color: var(--post-mobile-file-info-text-color);
  font-size: 9pt;
}

.fileInfo a {
  color: var(--post-link-text-color);
  text-decoration: var(--post-link-text-decoration);
}

.fileInfo a:hover {
  color: var(--post-link-text-color-hover);
}

.closeButton {
  text-align: center;
  padding: 5px 0 10px 0;
}

.thumbnailReplyDesktop {
  margin: 3px 20px 5px 20px;
}

.thumbnailMobile {
  margin: 8px 10px 5px 5px;
}

.mediaMobile img,
.mediaMobile video,
.mediaMobile iframe,
.mediaMobile audio {
  padding: 0;
}

.mediaDesktopReply img,
.mediaDesktopReply video,
.mediaDesktopReply iframe,
.mediaDesktopReply audio {
  padding: 0;
}

.mediaDesktopOp {
  max-width: calc(100% - 40px);
  box-sizing: border-box;
}

.mediaDesktopOp img,
.mediaDesktopOp video,
.mediaDesktopOp iframe,
.mediaDesktopOp audio {
  padding: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.fileDeleted {
  image-rendering: pixelated;
}

.mediaLoadFailure {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  height: 100%;
  min-width: 0;
  padding: 8px;
  box-sizing: border-box;
  line-height: 1.2;
  font-size: 10pt;
  text-align: center;
  overflow-wrap: anywhere;
}

.mediaLoadFailureSource {
  max-width: 30ch;
  font-size: 8pt;
}

.mediaLoadFailureStatus {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.mediaLoadFailureLink {
  color: var(--post-link-text-color);
  text-decoration: var(--post-link-text-decoration);
  font-size: 9pt;
}

.mediaLoadFailureLink:hover {
  color: var(--post-link-text-color-hover);
  text-decoration: var(--post-link-text-decoration-hover);
}

.mediaLoadFailureInfo {
  display: block;
  clear: both;
  color: var(--post-mobile-file-info-text-color);
  font-size: 9pt;
  line-height: 1.2;
}

.mediaLoadFailureInfo a {
  color: var(--post-link-text-color);
  text-decoration: var(--post-link-text-decoration);
}

.mediaLoadFailureInfo a:hover {
  color: var(--post-link-text-color-hover);
  text-decoration: var(--post-link-text-decoration-hover);
}

@media (min-width: 640px) {
  .thumbnail,
  .content {
    line-height: 0; /* Ensure no extra space due to line-height */
  }
}

.fitToScreen {
  max-width: 100vw;
  max-height: 100vh;
}

.fitToScreen img,
.fitToScreen video {
  max-width: 100%;
  max-height: 100vh;
}
