/* The full-screen file reader: a dark page with a slim bar on top and the
   original file in the middle, the way a drive opens a file. */
.reader-body { background: #15302e; }
.reader {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  background: color-mix(in oklab, var(--color-ink) 95%, #000);
  color: #f7f5f1;
}
.reader__bar {
  display: flex;
  flex: none;
  align-items: center;
  gap: 1rem;
  height: 4rem;
  padding: 0 1.25rem;

  @media (max-width: 640px) { gap: 0.5rem; height: 3.5rem; padding: 0 0.5rem; }
}
.reader__close {
  display: grid;
  flex: none;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;

  & svg { width: 1.375rem; height: 1.375rem; }
  &:hover { background: rgb(255 255 255 / 0.1); }
}
.reader__icon {
  flex: none;
  color: #9fc7ae;

  & svg { width: 1.375rem; height: 1.375rem; }
  @media (max-width: 640px) { display: none; }
}
.reader__titles { display: flex; flex: 1; flex-direction: column; gap: 0.125rem; min-width: 0; }
.reader__title {
  overflow: hidden;
  font-size: 1.0625rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.reader__status { font-size: 0.75rem; color: #9fb3ad; }
.reader__edit {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 0.375rem;
  height: 2.25rem;
  padding: 0 0.875rem;
  border: 1px solid rgb(247 245 241 / 0.4);
  border-radius: 0.375rem;
  font-size: 0.9375rem;
  font-weight: 600;

  & svg { width: 1rem; height: 1rem; }
  &:hover { background: rgb(255 255 255 / 0.1); }
  @media (max-width: 640px) { & span { display: none; } }
}

/* The browser shows the file itself here. */
.reader__frame {
  flex: 1;
  width: 100%;
  border: 0;
  background: #fff;
}
.reader__scroll {
  display: flex;
  flex: 1;
  justify-content: center;
  align-items: flex-start;
  overflow: auto;
  padding: 2rem 1.5rem;

  @media (max-width: 640px) { padding: 0.75rem; }
}
.reader__text {
  width: min(100%, 47.5rem);
  padding: 3rem 4rem;
  border-radius: 0.5rem;
  background: var(--color-surface);
  color: var(--color-ink);
  font: inherit;
  font-size: 1.0625rem;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  box-shadow: 0 1rem 2.5rem rgb(0 0 0 / 0.33);

  @media (max-width: 640px) { padding: 1.5rem 1.25rem; font-size: 1rem; }
}
.reader__image { max-width: 100%; height: auto; border-radius: 0.5rem; box-shadow: 0 1rem 2.5rem rgb(0 0 0 / 0.33); }

/* A file the browser can't show: download it instead. */
.reader__middle { display: grid; flex: 1; place-items: center; padding: 1rem; }
.reader__download {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  width: min(100%, 27.5rem);
  padding: 2.5rem;
  border-radius: 1rem;
  background: var(--color-surface);
  color: var(--color-ink);
  text-align: center;

  @media (max-width: 640px) { padding: 1.5rem; }
}
.reader__download-icon {
  display: grid;
  place-items: center;
  width: 4rem;
  height: 4rem;
  border-radius: 1rem;
  background: var(--color-primary-soft);
  color: var(--color-primary-dark);

  & svg { width: 1.875rem; height: 1.875rem; }
}
.reader__download-name { font-size: 1.25rem; font-weight: 700; overflow-wrap: anywhere; }
.reader__download-text { color: var(--color-text); }
