/* Resources (PDF library) styles — loaded alongside /insights/assets/insights.css,
   which supplies all the shared tokens, header/footer, card, button, badge,
   form and admin-table styles. This file only adds what's specific to a
   PDF resource: the upload form, the review/preview area, the generated
   page's "looks like the PDF" reading view, and the pdf.js fallback viewer. */

/* ---- Upload form ---- */
.pdf-upload-field{
  border:2px dashed var(--border);border-radius:var(--radius);padding:1.5rem;text-align:center;background:var(--muted);
}
.pdf-upload-field input[type=file]{display:block;margin:0 auto;font-size:.9rem}
.pdf-upload-current{font-size:.85rem;color:var(--muted-foreground);margin-top:.5rem}

/* ---- Mode indicator on the admin's published-resources list ---- */
.badge-mode{background:var(--teal-soft);color:var(--teal-deep)}

/* ---- A resource post reads better wider than an ordinary blog column. ---- */
.wrap-wide{max-width:56rem;margin:0 auto;padding:0 1.25rem}

/* ---- Resource article header bits ---- */
.pdf-excerpt{font-size:1.08rem;color:var(--muted-foreground);margin:0 0 1.5rem}
.pdf-download-row{margin:1.25rem 0}
.pdf-download-row-bottom{border-top:1px solid var(--border);padding-top:1.75rem;margin-top:2.5rem}

/* ---- "text" mode: a positioned, real-text reconstruction of each PDF page ----
   Each page is one fixed-size "sheet" (sized in pt, matching the PDF's own
   page size) holding absolutely-positioned real text spans, filled rects,
   rule lines and images -- not a picture of the page, actual selectable
   HTML styled to sit exactly where the PDF put it. */
.pdf-doc{width:100%}
/* The black page border lives on .pdf-sheet-wrap, not .pdf-sheet:
   .pdf-sheet is what gets transform:scale(--fit-scale)'d to fit narrow
   viewports, and a border on a scaled/transformed element gets resampled
   along with it, which can blur one edge into gray instead of solid
   black. .pdf-sheet-wrap is never transformed, so a border here always
   paints crisp. That in turn only works if the *wrap's own box* lands on
   a whole device pixel -- render.php now rounds the wrap's width to an
   integer px for exactly this reason (a raw PDF page width in points,
   e.g. A4's 595.32pt, almost never converts to a whole pixel). The wrap
   uses default content-box sizing, so the border sits *outside* its
   declared (pixel-rounded) width/height, with the sheet -- sized in pt,
   matching the wrap almost exactly but not sub-pixel-exactly -- flush
   against the inside of it. overflow:hidden trims that sub-pixel sliver
   and, more importantly, keeps .pdf-sheet's own box-shadow (a soft drop
   shadow around the page) from bleeding across the border itself and
   washing it out at the edge where the two would otherwise overlap. */
.pdf-sheet-wrap{margin:0 auto 1.5rem;border:1px solid #000;overflow:hidden}
.pdf-sheet-wrap:last-child{margin-bottom:0}
.pdf-sheet{position:relative;background:#fff;box-shadow:0 1px 4px rgba(0,0,0,.15)}
.pdf-sheet .pdf-run{position:absolute;white-space:pre;line-height:1;margin:0;-webkit-font-smoothing:antialiased}
.pdf-sheet .pdf-rect{position:absolute}
.pdf-sheet .pdf-line{position:absolute}
.pdf-sheet .pdf-img{position:absolute;width:100%;height:100%;object-fit:fill}
.pdf-sheet .pdf-path{position:absolute;overflow:visible}

/* ---- "image" mode: pdf.js-rendered canvases, one per PDF page (fallback
   for the rare PDF this reconstruction can't faithfully handle -- rotated/
   sheared content, or an image format we can't decode server-side). ---- */
.pdf-viewer{display:flex;flex-direction:column;align-items:center;gap:1.25rem;padding:1rem 0}
.pdf-viewer-pages{display:flex;flex-direction:column;align-items:center;gap:1.25rem;width:100%}
.pdf-page-canvas{max-width:100%;height:auto;border-radius:6px;box-shadow:0 4px 24px rgba(0,0,0,.12);border:1px solid var(--border)}
.pdf-viewer-status{padding:2rem 0}

/* ---- Admin review: preview + actions ---- */
.review-preview{max-height:70vh;overflow:auto;padding:1.5rem}
.pdf-source-embed{width:100%;height:70vh;border:1px solid var(--border);border-radius:var(--radius);background:var(--muted)}
.mode-note{font-size:.82rem;color:var(--muted-foreground);background:var(--muted);border-radius:.5rem;padding:.75rem 1rem;margin-bottom:1rem}
