/* -------------- Hosted file (block) -------------- */

.hosted-file {
  margin: 1.5rem 0;
  border: 1px solid var(--border-color);
  border-radius: 0;
  overflow: hidden;
}

.hosted-file__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
}

.hosted-file--audio .hosted-file__bar {
  border-top: 1px solid var(--border-color);
}

.hosted-file__audio {
  display: block;
  width: 100%;
}

.hosted-file__name {
  overflow-wrap: anywhere;
}

.hosted-file__button {
  padding: 0.15rem 0.6rem;
  border: 1px solid var(--button-border-color);
  border-radius: 0;
  color: var(--light-text-color);
  font-size: 0.8rem;
  text-decoration: none;
}

.hosted-file__button:hover {
  background-color: var(--hover-surface-color);
  color: var(--light-text-color);
}

/* Videos (VideoBlock), embedded or from Files: */

.hosted-file-embed,
.hosted-file-video {
  display: block;
  width: 100%;
  margin: 1.5rem 0;
  border-radius: 0;
}

/* A silent loop (blocks/video_block.html): a click pauses it, and plays it again. */
.hosted-file-video--loop {
  cursor: pointer;
}

.hosted-file-embed iframe {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
}

/* Documents (DocumentBlock): */

.hosted-file-document {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.5rem 0;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 0;
  color: inherit;
  text-decoration: none;
}

.hosted-file-document:hover {
  background-color: var(--hover-surface-color);
}

.hosted-file-document__icon {
  font-size: 1.75rem;
}

.hosted-file-document__name {
  overflow-wrap: anywhere;
}

.hosted-file-document__meta {
  margin-left: auto;
  color: var(--muted-text-color);
  font-size: 0.85rem;
  white-space: nowrap;
}

/* -------------- File (FileBlock, file_block.html) -------------- */

/* The name, with its details to the right (under it when they don't fit), and the download button below. */
.hosted-file-card {
  margin: 0 0 1.5rem;
}

.hosted-file-card__header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem 1.5rem;
  margin: 0 0 1rem;
}

.hosted-file-card__name {
  font-size: 1.15rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.hosted-file-card__meta {
  color: var(--muted-text-color);
  font-size: 0.85rem;
  overflow-wrap: anywhere;
}

.hosted-file-card__actions {
  flex-basis: 100%;
}

.hosted-file-card__actions .hosted-file__button {
  display: inline-block;
}

.hosted-file-card__preview {
  display: block;
}

.hosted-file-card__preview img,
video.hosted-file-card__preview {
  display: block;
  max-width: 100%;
  max-height: 80vh;
}

audio.hosted-file-card__preview {
  width: 100%;
}
