/* ===== Custom PDF viewer for /newsletter detail pages ================
   One-page-at-a-time scroll-snap viewer with floating page indicator
   and zoom controls. Replaces Chrome's native PDF iframe chrome.
   ====================================================================== */

.pism-pdf-viewer {
  position: relative;
  width: 100%;
  background: #15171b;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
}

/* Scroll container — each page snaps to the top of this stage */
.pism-pdf-viewer__stage {
  width: 100%;
  height: 88vh;
  min-height: 720px;
  max-height: 1100px;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
  padding: 32px 0;
  outline: none;
}
.pism-pdf-viewer__stage::-webkit-scrollbar { width: 8px; }
.pism-pdf-viewer__stage::-webkit-scrollbar-track { background: transparent; }
.pism-pdf-viewer__stage::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.22);
  border-radius: 4px;
}
.pism-pdf-viewer__stage::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.35);
}

/* Each rendered PDF page (canvas) */
.pism-pdf-page {
  scroll-snap-align: center;
  scroll-snap-stop: always;
  display: block;
  margin: 0 auto 28px;
  max-width: 92%;
  background: #fff;
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.45);
  border-radius: 4px;
}
.pism-pdf-page:last-child { margin-bottom: 0; }

/* Loading / error message */
.pism-pdf-viewer__status {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.75);
  font-family: "Inter", system-ui, sans-serif;
  font-size: 14px;
  letter-spacing: 0.04em;
  pointer-events: none;
}

/* Floating control bar */
.pism-pdf-viewer__controls {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 6px 8px;
  border-radius: 999px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4),
              inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  z-index: 10;
  user-select: none;
}

.pism-pdf-btn {
  background: transparent;
  color: #fff;
  border: 0;
  border-radius: 999px;
  width: 34px;
  height: 34px;
  cursor: pointer;
  font-size: 18px;
  font-weight: 500;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 180ms ease;
}
.pism-pdf-btn:hover { background: rgba(255, 255, 255, 0.12); }
.pism-pdf-btn:active { background: rgba(255, 255, 255, 0.18); }
.pism-pdf-btn[disabled] { opacity: 0.4; cursor: not-allowed; }
.pism-pdf-btn[disabled]:hover { background: transparent; }

.pism-pdf-page-indicator {
  color: #fff;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  min-width: 70px;
  text-align: center;
  padding: 0 4px;
}

/* Mobile tweaks */
@media (max-width: 767px) {
  .pism-pdf-viewer__stage {
    height: 78vh;
    min-height: 520px;
    padding: 16px 0;
  }
  .pism-pdf-page { max-width: 96%; margin-bottom: 18px; }
  .pism-pdf-viewer__controls { bottom: 14px; padding: 4px 6px; gap: 4px; }
  .pism-pdf-btn { width: 30px; height: 30px; font-size: 16px; }
  .pism-pdf-page-indicator { font-size: 12px; min-width: 60px; }
}
