/* css/pdf-preview.css — paginated PDF preview overlay and its print output. */

.pdfp-overlay {
  position: fixed;
  inset: 0;
  z-index: 350;
  display: flex;
  flex-direction: column;
  font-family: var(--pp-ui, system-ui, sans-serif);
  color: #e8edf2;
  background: #2a3138;
  animation: pdfp-in 0.16s ease-out;
}

@keyframes pdfp-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

body.pdfp-open { overflow: hidden; }
body.pdfp-open #warning-marquee { display: none; }

/* Toolbar */
.pdfp-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 16px;
  background: #161b21;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.pdfp-bar-title { display: flex; align-items: center; gap: 10px; min-width: 0; }

.pdfp-bar-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 34px;
  height: 34px;
  color: #fff;
  background: linear-gradient(135deg, #e5484d, #b4232a);
  border-radius: 9px;
  box-shadow: 0 4px 12px -4px rgba(229, 72, 77, 0.7);
}

.pdfp-bar-text { display: flex; flex-direction: column; line-height: 1.25; }
.pdfp-bar-text strong { font-size: 14px; font-weight: 650; color: #fff; }
.pdfp-bar-text span { font-size: 11.5px; color: rgba(232, 237, 242, 0.6); white-space: nowrap; }

.pdfp-bar-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0 auto;
}

.pdfp-seg {
  display: inline-flex;
  padding: 3px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
}

.pdfp-seg button {
  padding: 6px 12px;
  font: 600 12.5px inherit;
  font-family: inherit;
  color: rgba(232, 237, 242, 0.7);
  background: none;
  border: 0;
  border-radius: 7px;
  cursor: pointer;
}

.pdfp-seg button:hover { color: #fff; }
.pdfp-seg button.is-active { color: #161b21; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3); }

.pdfp-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  font-size: 12.5px;
  font-weight: 600;
  color: rgba(232, 237, 242, 0.85);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 9px;
  cursor: pointer;
}

.pdfp-toggle input { width: 15px; height: 15px; margin: 0; accent-color: #36b3d6; }

.pdfp-select {
  padding: 6px 10px;
  font: 600 12.5px inherit;
  font-family: inherit;
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9px;
}

.pdfp-select option { color: #13202b; }

.pdfp-zoom {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 9px;
}

.pdfp-zoom button {
  width: 30px;
  height: 30px;
  font-size: 16px;
  color: #fff;
  background: none;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

.pdfp-zoom button:hover { background: rgba(255, 255, 255, 0.1); }
.pdfp-zoom span { min-width: 44px; font-size: 12px; font-weight: 600; text-align: center; font-variant-numeric: tabular-nums; }

.pdfp-bar-actions { display: flex; align-items: center; gap: 8px; }

.pdfp-download {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  font: 650 13px inherit;
  font-family: inherit;
  color: #fff;
  background: #0b6e8f;
  border: 0;
  border-radius: 9px;
  box-shadow: 0 4px 14px -4px rgba(11, 110, 143, 0.9);
  cursor: pointer;
}

.pdfp-download:hover { background: #0d82a8; }

.pdfp-close {
  width: 34px;
  height: 34px;
  font-size: 22px;
  line-height: 1;
  color: rgba(232, 237, 242, 0.75);
  background: rgba(255, 255, 255, 0.06);
  border: 0;
  border-radius: 9px;
  cursor: pointer;
}

.pdfp-close:hover { color: #fff; background: rgba(255, 255, 255, 0.14); }

/* Workspace */
.pdfp-workspace { display: flex; flex: 1; min-height: 0; }

.pdfp-thumbs {
  display: flex;
  flex: none;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 168px;
  padding: 18px 0;
  overflow-y: auto;
  background: #1f252b;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.pdfp-thumb {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 6px;
  background: none;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

.pdfp-thumb-frame {
  position: relative;
  display: block;
  overflow: hidden;
  background: #fff;
  border-radius: 2px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  outline: 2px solid transparent;
  outline-offset: 3px;
  transition: outline-color 0.12s;
}

.pdfp-thumb:hover .pdfp-thumb-frame { outline-color: rgba(255, 255, 255, 0.25); }
.pdfp-thumb.is-active .pdfp-thumb-frame { outline-color: #36b3d6; }
.pdfp-thumb-num { font-size: 11px; font-weight: 600; color: rgba(232, 237, 242, 0.6); }
.pdfp-thumb.is-active .pdfp-thumb-num { color: #fff; }

.pdfp-page--mini {
  position: absolute !important;
  top: 0;
  left: 0;
  margin: 0 !important;
  box-shadow: none !important;
  transform-origin: 0 0;
  pointer-events: none;
}

.pdfp-stage { position: relative; flex: 1; overflow: auto; }

.pdfp-pages {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  padding: 32px 24px 64px;
}

.pdfp-loading {
  position: absolute;
  top: 40%;
  left: 50%;
  display: none;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
  color: rgba(232, 237, 242, 0.8);
  transform: translate(-50%, -50%);
}

.pdfp-overlay.is-loading .pdfp-loading { display: flex; }
.pdfp-overlay.is-loading .pdfp-pages { opacity: 0.25; }

.pdfp-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: #36b3d6;
  border-radius: 50%;
  animation: pdfp-spin 0.7s linear infinite;
}

@keyframes pdfp-spin { to { transform: rotate(360deg); } }

.pdfp-measure {
  position: fixed;
  top: 0;
  left: -20000px;
  visibility: hidden;
  pointer-events: none;
}

/* Page */
.pdfp-page {
  position: relative;
  flex: none;
  overflow: hidden;
  color: #1c1d1e;
  background: #fff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35), 0 1px 3px rgba(0, 0, 0, 0.25);
}

.pdfp-page--overflow { height: auto !important; min-height: 1056px; overflow: visible; }
.pdfp-page--overflow .pdfp-body { position: relative !important; top: 0 !important; height: auto !important; padding: 74px 0 70px; }

.pdfp-body {
  position: absolute;
  overflow: hidden;
  box-sizing: border-box;
}

.pdfp-body.article-html {
  max-width: none;
  margin: 0;
  padding: 0;
  font-size: 13.5px;
  line-height: 1.55;
  background: none;
  border: 0;
  box-shadow: none;
}

.pdfp-body > :first-child { margin-top: 0; }
.pdfp-body .pdfp-continued > :first-child { margin-top: 0; }
.pdfp-body .editable:hover,
.pdfp-body .editable:focus { background: none; outline: none; box-shadow: none; }
.pdfp-body .creator-name-btn,
.pdfp-body .affil-line,
.pdfp-body .keywords-trigger {
  padding: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  background: none;
  border: 0;
  cursor: default;
}

.pdfp-body .change-insert,
.pdfp-body .change-delete {
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.pdfp-run {
  position: absolute;
  right: 68px;
  left: 68px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font: 500 9.5px/1.3 var(--pp-ui, system-ui, sans-serif);
  letter-spacing: 0.02em;
  color: #7a8794;
}

.pdfp-run span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.pdfp-run--head { top: 34px; padding-bottom: 8px; border-bottom: 0.5px solid #d9dee3; }
.pdfp-run--foot { bottom: 30px; padding-top: 8px; border-top: 0.5px solid #d9dee3; }
.pdfp-run-title { max-width: 70%; font-style: italic; }

/* Author queries appendix */
.pdfp-queries { margin-top: 28px; }
.pdfp-body h2.pdfp-queries-title { margin: 0 0 12px; font-size: 16px; }
.pdfp-body h2.pdfp-queries-title::before { content: none; }

.pdfp-query {
  margin-bottom: 10px;
  padding: 10px 12px;
  font-size: 12.5px;
  background: #f7f9fb;
  border: 1px solid #e3e8ed;
  border-left: 3px solid #6d3fd1;
  border-radius: 4px;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.pdfp-query-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; font-size: 11px; color: #5b6b79; }
.pdfp-query-head strong { color: #13202b; }

.pdfp-query-status {
  margin-left: auto;
  padding: 1px 7px;
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  border-radius: 999px;
  background: #fff4dd;
  color: #a35c00;
}

.pdfp-query-status--answered { background: #e5f0ff; color: #1d4ed8; }
.pdfp-query-status--resolved { background: #e5f5eb; color: #15803d; }
.pdfp-body .pdfp-query p { margin: 0; text-align: left; }
.pdfp-body .pdfp-query .pdfp-query-answer { margin-top: 6px; color: #334452; }

@media (max-width: 1100px) {
  .pdfp-bar { flex-wrap: wrap; }
  .pdfp-bar-controls { order: 3; width: 100%; }
  .pdfp-thumbs { display: none; }
}

/* Print: output only the laid-out pages, one per sheet. */
@media print {
  html,
  body.pdfp-printing {
    height: auto !important;
    overflow: visible !important;
    background: #fff !important;
  }

  body.pdfp-printing { display: block !important; }
  body.pdfp-printing > :not(.pdfp-overlay) { display: none !important; }

  body.pdfp-printing .pdfp-overlay {
    position: static;
    display: block;
    background: none;
    animation: none;
  }

  body.pdfp-printing :is(.pdfp-bar, .pdfp-thumbs, .pdfp-measure, .pdfp-loading) { display: none !important; }
  body.pdfp-printing :is(.pdfp-workspace, .pdfp-stage) { display: block; overflow: visible; }

  body.pdfp-printing .pdfp-pages {
    display: block;
    padding: 0;
    zoom: 1 !important;
    opacity: 1 !important;
  }

  body.pdfp-printing .pdfp-page {
    margin: 0;
    box-shadow: none;
    break-after: page;
  }

  body.pdfp-printing .pdfp-page[data-size="a4"] { width: 210mm !important; height: 296.5mm !important; }
  body.pdfp-printing .pdfp-page[data-size="letter"] { width: 215.9mm !important; height: 279mm !important; }
  body.pdfp-printing .pdfp-page:last-child { break-after: auto; }
}
