/* Newspaper reader (read.php). Colours and fonts come from site.css. */

body.reader { background: #3a3d45; background-image: none; min-height: 100vh; }

.rd-bar {
  position: sticky; top: 0; z-index: 20;
  background: var(--dark); color: #fff;
  box-shadow: 0 6px 20px -8px rgba(0, 0, 0, .5);
}
.rd-bar-row { display: flex; align-items: center; gap: 14px; padding: 10px 16px; max-width: 1400px; margin: 0 auto; }
.rd-title { flex: 1; min-width: 0; text-align: center; line-height: 1.2; }
.rd-title b { display: block; font: 800 1.25rem/1.15 var(--serif); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rd-title span { font-size: .9rem; color: rgba(255, 255, 255, .75); }
.rd-tools { display: flex; align-items: center; gap: 10px; }

.rd-btn {
  display: inline-flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 16px;
  border-radius: 13px; border: 2px solid rgba(255, 255, 255, .3); background: transparent;
  color: #fff; font: 700 1rem/1.15 var(--sans); text-decoration: none; cursor: pointer;
  transition: background .15s, border-color .15s;
}
.rd-btn:hover { background: rgba(255, 255, 255, .12); border-color: #fff; }
.rd-btn .ic { width: 22px; height: 22px; }
.rd-label { display: flex; flex-direction: column; align-items: flex-start; }
.rd-label small { font-size: .78rem; font-weight: 600; opacity: .78; }
.rd-download { background: #fff; color: var(--dark); border-color: #fff; }
.rd-download:hover { background: #e9ecf6; color: var(--dark); }
.rd-zoom { display: flex; align-items: center; gap: 6px; }
.rd-icon { width: 52px; padding: 0; justify-content: center; }
.rd-icon:disabled { opacity: .35; cursor: default; }
.rd-zoom-level { min-width: 52px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }

/* Pages: a column of paper sheets. --zoom grows them; past the screen width the column scrolls sideways. */
.rd-main { --zoom: 1; overflow-x: auto; padding: 28px 16px 120px; }
.rd-pages { width: min(100%, calc(960px * var(--zoom))); margin: 0 auto; display: flex; flex-direction: column; gap: 28px; }
.rd-main.is-zoomed .rd-pages { width: calc(min(100vw - 32px, 960px) * var(--zoom)); }
.rd-page { margin: 0; scroll-margin-top: 90px; }
.rd-sheet {
  position: relative; aspect-ratio: 1100 / 1348; background: #fff; border-radius: 3px; overflow: hidden;
  box-shadow: 0 18px 40px -16px rgba(0, 0, 0, .6);
}
.rd-sheet img { position: relative; z-index: 1; display: block; width: 100%; height: 100%; object-fit: contain; background: transparent; }
.rd-wait {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  color: #8a8f9c; font-weight: 700; font-size: 1.1rem;
  background: repeating-linear-gradient(180deg, #fff 0 22px, #f3f1ec 22px 24px);
}
.rd-fallback { display: none; position: absolute; inset: 0; z-index: 2; align-items: center; justify-content: center; padding: 20px; text-align: center; background: #fff; font-weight: 700; }
.rd-sheet.is-missing .rd-fallback { display: flex; }
.rd-page figcaption { margin-top: 10px; text-align: center; color: rgba(255, 255, 255, .8); font-weight: 700; }

.rd-editions { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; width: min(100%, 960px); margin: 40px auto 0; }
.rd-edition-next { margin-left: auto; }
.rd-edition-next .rd-label { align-items: flex-end; }

.rd-counter {
  position: fixed; left: 50%; bottom: 18px; z-index: 20; transform: translateX(-50%);
  padding: 10px 20px; border-radius: 999px; background: rgba(10, 21, 80, .92); color: #fff;
  font-weight: 700; box-shadow: 0 10px 26px -8px rgba(0, 0, 0, .6); font-variant-numeric: tabular-nums;
}
.rd-message { max-width: 640px; margin: 60px auto; padding: 24px; border-radius: 16px; background: #fff; font-size: 1.15rem; }

@media (max-width: 760px) {
  /* phones: one slim bar (pinch to zoom instead of the zoom buttons) */
  .rd-bar-row { gap: 8px; padding: 6px 8px; }
  .rd-zoom { display: none; }
  .rd-title b { font-size: 1.05rem; }
  .rd-title span { font-size: .8rem; }
  .rd-btn { min-height: 46px; padding: 0 12px; gap: 6px; }
  .rd-back .rd-label small, .rd-download .rd-label small { display: none; }
  .rd-main { padding: 12px 6px 96px; }
  .rd-pages { gap: 16px; }
  .rd-main.is-zoomed .rd-pages { width: 100%; }
  .rd-edition { width: 100%; }
}

@media (max-width: 400px) {
  .rd-back, .rd-download { width: 46px; padding: 0; justify-content: center; }
  .rd-back .rd-label, .rd-download .rd-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
