/*
 * Document reader — same dark-themed shell as the magazine reader so PDF
 * docs feel continuous with /magazines/<slug>.  Class names share the
 * mag-reader__* prefix where the markup is identical, and add doc-reader__
 * variants only where behaviour differs (canvas instead of <img>).
 */

.doc-reader {
  display: flex;
  flex-direction: column;
  /* On the document detail page the reader sits inside the platinum content
     window, so we cap its height rather than going full viewport. */
  height: min(80vh, 900px);
  background: #1a1a1a;
  color: #eee;
  user-select: none;
  border-radius: 4px;
  overflow: hidden;
}

.doc-reader__toolbar {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .4rem .75rem;
  background: #111;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.doc-reader__title {
  flex: 1;
  font-size: .85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.doc-reader__nav,
.doc-reader__zoom {
  display: flex;
  align-items: center;
  gap: .25rem;
}

.doc-reader__btn {
  background: #333;
  color: #eee;
  border: 1px solid #555;
  border-radius: 4px;
  padding: .3rem .6rem;
  cursor: pointer;
  font-size: .85rem;
  line-height: 1;
  transition: background .1s;
}
.doc-reader__btn:hover  { background: #555; }
.doc-reader__btn:disabled { opacity: .35; cursor: default; }

.doc-reader__pager {
  display: flex;
  align-items: center;
  gap: .25rem;
  font-size: .85rem;
}
.doc-reader__pager input {
  width: 3.5rem;
  text-align: center;
  background: #222;
  color: #eee;
  border: 1px solid #555;
  border-radius: 4px;
  padding: .25rem .4rem;
  font-size: .85rem;
}
.doc-reader__total { color: #888; }

.doc-reader__stage {
  flex: 1;
  overflow: auto;
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 1rem;
  box-sizing: border-box;
}

.doc-reader__viewer {
  position: relative;
  display: flex;
  justify-content: center;
}

.doc-reader__canvas {
  display: block;
  box-shadow: 0 4px 24px rgba(0, 0, 0, .6);
  background: #fff;
  border-radius: 2px;
  max-width: 100%;
  height: auto;
}

.doc-reader__loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(26, 26, 26, .55);
  font-size: 1rem;
  color: #ccc;
  pointer-events: none;
  transition: opacity .2s;
}
.doc-reader__loading[hidden] { display: none; }

.doc-reader__fallback {
  padding: 2rem;
  font-size: .9rem;
  text-align: center;
  color: #aaa;
}
.doc-reader__fallback a { color: #4af; }

@media (max-width: 600px) {
  .doc-reader { height: 70vh; }
  .doc-reader__title { display: none; }
  .doc-reader__stage { padding: .25rem; }
  .doc-reader__pager input { width: 2.8rem; }
}
