/* ==========================================================================
   PDF publications — university catalogues, institutional profiles, reports
   Page editor widgets "PDF document" (reader · feature · card) and "Publications shelf" (shelf · list), and the
   Downloads page's "Read online". Markup: resources/views/snu-site/pdf/*; behaviour: extra/pdf-viewer.js.
   Colours come from the University palette (extra/palette.css); every text pairing meets WCAG 2.2 AA.
   ========================================================================== */
.pdf-block { --pdf-navy: var(--navy, #0a3b5e); --pdf-ink: var(--ink, #14212e); --pdf-muted: var(--muted, #4b5b6b); --pdf-line: var(--line, #dfe5ea);
  --pdf-gold: var(--gold, #c29a3b); --pdf-paper: #fff; --pdf-desk: #eef1f4; --pdf-radius: 12px; margin: 0; }
.pdf-block > .block-title:first-child { margin-top: 0; }
.pdf-intro { color: var(--pdf-muted); max-width: 70ch; margin: -.25rem 0 1.5rem; }

/* ---- buttons ---- */
.pdf-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.25rem; }
.pdf-actions-sm { gap: .4rem; margin-top: .75rem; }
.pdf-btn { display: inline-flex; align-items: center; gap: .5rem; min-height: 44px; padding: .6rem 1.15rem; border-radius: 999px; border: 2px solid var(--navy, #0a3b5e);
  color: var(--navy, #0a3b5e); background: transparent; font-weight: 700; font-size: .95rem; line-height: 1.2; text-decoration: none; cursor: pointer;
  transition: background-color .15s ease, color .15s ease; }
.pdf-btn:hover { background: var(--navy, #0a3b5e); color: #fff; }
.pdf-btn-primary { background: var(--navy, #0a3b5e); color: #fff; }
.pdf-btn-primary:hover { background: var(--navy-900, #062840); border-color: var(--navy-900, #062840); }
.pdf-actions-sm .pdf-btn { min-height: 38px; padding: .4rem .85rem; font-size: .875rem; }
.pdf-btn:focus-visible, .pdf-cover:focus-visible, .doc-read:focus-visible, .pdfv-bar button:focus-visible, .pdfv-bar a:focus-visible, .pdfv-bar input:focus-visible, .pdfv-bar select:focus-visible,
.pdfv-stage:focus-visible, .pdfv-toc a:focus-visible { outline: 3px solid var(--gold, #c29a3b); outline-offset: 2px; }

/* ---- covers: the publication's own image, the PDF's first page, or a University cover ---- */
.pdf-cover { position: relative; display: block; aspect-ratio: 210 / 297; border-radius: 4px 8px 8px 4px; overflow: hidden; background: var(--navy, #0a3b5e);
  box-shadow: 0 1px 2px rgba(10, 30, 50, .18), 0 12px 28px -12px rgba(10, 30, 50, .45); transition: transform .2s ease, box-shadow .2s ease; }
.pdf-cover::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 7px; background: linear-gradient(90deg, rgba(0, 0, 0, .22), rgba(255, 255, 255, .08) 60%, transparent); pointer-events: none; }
a.pdf-cover[data-pdf-open]:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(10, 30, 50, .2), 0 18px 34px -12px rgba(10, 30, 50, .5); }
.pdf-cover-img, .pdf-cover-page { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #fff; }
.pdf-cover-page { opacity: 0; transition: opacity .3s ease; }
.pdf-cover-page.is-ready { opacity: 1; }
.pdf-cover-ph { position: absolute; inset: 0; display: flex; flex-direction: column; gap: .35rem; padding: 14% 12% 12%; color: #fff; text-align: left;
  background: radial-gradient(120% 70% at 100% 0, rgba(255, 255, 255, .12), transparent 60%), linear-gradient(160deg, var(--navy-600, #14507b), var(--navy-900, #062840)); }
.pdf-cover-ph::before { content: ""; position: absolute; left: 12%; right: 12%; bottom: 9%; height: 3px; background: var(--gold, #c29a3b); }
.pdf-cover-ph img { width: 18%; min-width: 22px; height: auto; margin-bottom: auto; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .3)); }
.pdf-cover-ph small { font-size: clamp(.55rem, 1.6cqi, .72rem); letter-spacing: .12em; text-transform: uppercase; color: var(--gold-400, #d9b866); font-weight: 700; }
.pdf-cover-ph b { font-family: var(--font-serif, Georgia, serif); font-size: clamp(.8rem, 2.4cqi, 1.25rem); line-height: 1.2; margin-bottom: 14%; }
.pdf-cover-ph em { position: absolute; left: 12%; bottom: 12%; font-style: normal; font-size: .7rem; opacity: .85; }
.pdf-cover { container-type: inline-size; }

/* ---- shared labels ---- */
.pdf-kind { margin: 0 0 .35rem; font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--gold-700, #7a5b10); }
.pdf-edition { margin: .35rem 0 0; color: var(--pdf-muted, #4b5b6b); font-size: .95rem; }
.pdf-meta { display: flex; flex-wrap: wrap; gap: .35rem .9rem; list-style: none; margin: .9rem 0 0; padding: 0; font-size: .85rem; color: var(--pdf-muted, #4b5b6b); }
.pdf-meta li { display: inline-flex; align-items: center; gap: .35rem; }
.pdf-meta li + li::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: currentColor; opacity: .5; margin-right: .55rem; }
.pdf-meta .bi-file-earmark-pdf { color: #b42318; }

/* ---- feature: cover beside the details ---- */
.pdff { display: grid; grid-template-columns: minmax(150px, 260px) 1fr; gap: clamp(1.5rem, 4vw, 3.25rem); align-items: center; padding: clamp(1.25rem, 3vw, 2.25rem);
  background: linear-gradient(135deg, var(--blue-50, #f1f7ff), #fff 70%); border: 1px solid var(--pdf-line, #dfe5ea); border-radius: var(--pdf-radius, 12px); }
.pdff-title { margin: 0; font-size: clamp(1.4rem, 2.6vw, 2rem); line-height: 1.2; color: var(--navy, #0a3b5e); }
.pdff-summary { margin: .9rem 0 0; color: var(--pdf-ink, #14212e); max-width: 62ch; line-height: 1.65; }
@media (max-width: 640px) { .pdff { grid-template-columns: 1fr; text-align: left; } .pdff-cover { max-width: 210px; } }

/* ---- card: one line ---- */
.pdf-list { display: grid; gap: .75rem; }
.pdfc { display: grid; grid-template-columns: 64px 1fr auto; gap: 1rem; align-items: center; padding: .9rem 1rem; background: #fff; border: 1px solid var(--pdf-line, #dfe5ea); border-radius: 10px; }
.pdfc .pdf-cover { width: 64px; border-radius: 2px 5px 5px 2px; }
.pdfc .pdf-cover-ph { padding: 12%; } .pdfc .pdf-cover-ph small, .pdfc .pdf-cover-ph b, .pdfc .pdf-cover-ph em { display: none; }
.pdfc .pdf-cover-ph img { width: 50%; margin: auto; }
.pdfc-title { margin: 0; font-size: 1.05rem; line-height: 1.3; font-family: var(--font-sans, inherit); font-weight: 700; color: var(--pdf-ink, #14212e); }
.pdfc .pdf-meta { margin-top: .35rem; }
.pdfc .pdf-actions { margin: 0; justify-content: flex-end; }
@media (max-width: 720px) { .pdfc { grid-template-columns: 56px 1fr; } .pdfc .pdf-cover { width: 56px; } .pdfc .pdf-actions { grid-column: 1 / -1; justify-content: flex-start; } }

/* ---- shelf: covers in a grid ---- */
.pdf-shelf { display: grid; grid-template-columns: repeat(var(--pdf-cols, 4), minmax(0, 1fr)); gap: clamp(1.25rem, 3vw, 2.25rem) clamp(1rem, 2.5vw, 1.75rem); list-style: none; margin: 0; padding: 0; }
.pdf-cols-2 { --pdf-cols: 2; } .pdf-cols-3 { --pdf-cols: 3; } .pdf-cols-4 { --pdf-cols: 4; } .pdf-cols-5 { --pdf-cols: 5; }
@media (max-width: 1024px) { .pdf-shelf { --pdf-cols: 3; } .pdf-cols-2 { --pdf-cols: 2; } }
@media (max-width: 640px) { .pdf-shelf { --pdf-cols: 2; } }
.pdft { display: flex; flex-direction: column; min-width: 0; }
.pdft .pdf-cover { margin-bottom: 1rem; }
.pdft-title { margin: 0; font-size: 1.02rem; line-height: 1.35; font-family: var(--font-sans, inherit); font-weight: 700; color: var(--pdf-ink, #14212e); }
.pdft .pdf-meta { margin-top: .5rem; font-size: .8rem; }
.pdft .pdf-actions { margin-top: auto; padding-top: .75rem; }
@media (max-width: 420px) { .pdft .pdf-actions .pdf-btn { flex: 1 1 100%; justify-content: center; } }

/* ---- nothing chosen (page editor only) ---- */
.pdf-empty { display: flex; gap: 1rem; align-items: center; padding: 1.5rem; border: 2px dashed var(--line-2, #c5d0d9); border-radius: 12px; color: var(--muted, #4b5b6b); background: #fafbfc; }
.pdf-empty i { font-size: 2rem; color: #b42318; } .pdf-empty p { margin: 0; }

/* ---- Downloads page ---- */
.doc-read { display: inline-flex; align-items: center; gap: .3rem; margin-left: .75rem; font-size: .875rem; font-weight: 600; color: var(--blue-700, #075478); }

/* ==========================================================================
   The reader
   ========================================================================== */
.pdfv { --pdfv-h: min(78vh, 900px); position: relative; margin: 0; display: flex; flex-direction: column; background: var(--pdf-desk, #eef1f4);
  border: 1px solid var(--pdf-line, #dfe5ea); border-radius: var(--pdf-radius, 12px); overflow: hidden; color: var(--ink, #14212e); }
.pdfv-h-lg { --pdfv-h: min(92vh, 1200px); }
.pdfv-h-a4 { --pdfv-h: auto; }
.pdfv-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .35rem; padding: .45rem .6rem; background: var(--navy, #0a3b5e); color: #fff; position: relative; z-index: 2; }
.pdfv-bar[hidden], .pdfv-bar [hidden] { display: none !important; }
.pdfv-bar .pdfv-grp { display: inline-flex; align-items: center; gap: .15rem; }
.pdfv-bar .pdfv-grp + .pdfv-grp { padding-left: .35rem; margin-left: .15rem; border-left: 1px solid rgba(255, 255, 255, .2); }
.pdfv-bar .pdfv-sp { flex: 1 1 auto; }
.pdfv-bar button, .pdfv-bar a { display: inline-flex; align-items: center; justify-content: center; gap: .35rem; min-width: 40px; height: 40px; padding: 0 .55rem;
  border: 0; border-radius: 8px; background: transparent; color: #fff; font: inherit; font-size: .9rem; text-decoration: none; cursor: pointer; }
.pdfv-bar button:hover, .pdfv-bar a:hover, .pdfv-bar button[aria-pressed="true"], .pdfv-bar button[aria-expanded="true"] { background: rgba(255, 255, 255, .14); }
.pdfv-bar button:disabled { opacity: .4; cursor: default; background: transparent; }
.pdfv-bar .bi { font-size: 1.1rem; }
.pdfv-title { font-weight: 700; font-size: .92rem; max-width: 34ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 .35rem; }
.pdfv-pg { display: inline-flex; align-items: center; gap: .35rem; font-size: .9rem; white-space: nowrap; }
.pdfv-pg input { width: 3.6em; height: 32px; padding: 0 .35rem; border: 1px solid rgba(255, 255, 255, .35); border-radius: 6px; background: rgba(255, 255, 255, .1); color: #fff; text-align: center; font: inherit; }
.pdfv-zoom select { height: 32px; padding: 0 .4rem; border: 1px solid rgba(255, 255, 255, .35); border-radius: 6px; background: var(--navy, #0a3b5e); color: #fff; font: inherit; font-size: .85rem; }
.pdfv-find { display: flex; align-items: center; gap: .4rem; flex: 1 1 100%; padding: .2rem 0 .1rem; }
.pdfv-find[hidden] { display: none; }
.pdfv-find input { flex: 1 1 auto; min-width: 0; height: 34px; padding: 0 .6rem; border: 1px solid rgba(255, 255, 255, .35); border-radius: 6px; background: #fff; color: var(--ink, #14212e); font: inherit; }
.pdfv-find output { font-size: .85rem; min-width: 9ch; }
@media (max-width: 720px) { .pdfv-title, .pdfv-hide-sm { display: none !important; } .pdfv-bar .pdfv-sp { display: none; } }

.pdfv-body { position: relative; display: flex; min-height: 0; flex: 1 1 auto; }
.pdfv-stage { position: relative; flex: 1 1 auto; height: var(--pdfv-h); overflow: auto; overscroll-behavior: contain; scroll-behavior: smooth; padding: 1rem; outline: none; }
.pdfv-h-a4 .pdfv-stage { height: auto; aspect-ratio: 210 / 297; max-height: 95vh; }
@media (prefers-reduced-motion: reduce) { .pdfv-stage { scroll-behavior: auto; } .pdf-cover, .pdf-cover-page { transition: none; } }
.pdfv-pages { display: flex; flex-direction: column; align-items: center; gap: 1rem; min-width: min-content; margin: 0 auto; }
.pdfv-page { position: relative; flex: none; background: #fff; box-shadow: 0 1px 3px rgba(10, 30, 50, .15), 0 6px 18px -8px rgba(10, 30, 50, .3); }
.pdfv-page canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.pdfv-page.is-loading::before { content: ""; position: absolute; left: 50%; top: 50%; width: 28px; height: 28px; margin: -14px; border: 3px solid var(--line, #dfe5ea);
  border-top-color: var(--navy, #0a3b5e); border-radius: 50%; animation: pdfv-spin .8s linear infinite; }
@keyframes pdfv-spin { to { transform: rotate(360deg); } }
/* the PDF's own links, over the page */
.pdfv-links { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.pdfv-links a { position: absolute; pointer-events: auto; border-radius: 2px; }
.pdfv-links a:hover { background: rgba(255, 196, 0, .18); box-shadow: inset 0 0 0 1px rgba(170, 126, 0, .5); }
.pdfv-links a:focus-visible { outline: 3px solid var(--gold, #c29a3b); }

/* contents (the PDF's bookmarks) */
.pdfv-toc { flex: 0 0 min(300px, 80%); max-height: var(--pdfv-h); overflow: auto; background: #fff; border-right: 1px solid var(--pdf-line, #dfe5ea); padding: .75rem .5rem; font-size: .9rem; }
.pdfv-h-a4 .pdfv-toc { max-height: 80vh; position: sticky; top: 0; }
.pdfv-toc[hidden] { display: none; }
.pdfv-toc h2 { font-family: var(--font-sans, inherit); font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted, #4b5b6b); margin: .25rem .5rem .5rem; }
.pdfv-toc ul { list-style: none; margin: 0; padding: 0; } .pdfv-toc ul ul { padding-left: .9rem; }
.pdfv-toc a { display: block; padding: .4rem .5rem; border-radius: 6px; color: var(--ink, #14212e); text-decoration: none; line-height: 1.35; }
.pdfv-toc a:hover, .pdfv-toc a[aria-current="true"] { background: var(--blue-50, #f1f7ff); color: var(--navy, #0a3b5e); }
@media (max-width: 720px) { .pdfv-toc { position: absolute; inset: 0 auto 0 0; z-index: 3; box-shadow: 8px 0 24px rgba(0, 0, 0, .2); } }

/* the cover and links shown before the pages load, or instead of them */
.pdfv-fallback { display: flex; align-items: center; gap: clamp(1rem, 4vw, 2.5rem); max-width: 720px; margin: clamp(.5rem, 4vh, 3rem) auto; padding: 1rem; }
.pdfv-fallback-cover { position: relative; flex: 0 0 clamp(110px, 22vw, 190px); aspect-ratio: 210 / 297; border-radius: 4px 8px 8px 4px; overflow: hidden; background: var(--navy, #0a3b5e); box-shadow: 0 12px 28px -12px rgba(10, 30, 50, .45); container-type: inline-size; }
.pdfv-fallback-title { margin: 0; font-family: var(--font-serif, Georgia, serif); font-size: clamp(1.15rem, 2.2vw, 1.5rem); font-weight: 700; color: var(--navy, #0a3b5e); }
.pdfv-status { margin: .4rem 0 0; color: var(--muted, #4b5b6b); }
.pdfv.is-ready .pdfv-fallback { display: none; }
@media (max-width: 520px) { .pdfv-fallback { flex-direction: column; text-align: center; } .pdfv-fallback .pdf-actions { justify-content: center; } }

.pdfv-cap { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem .9rem; padding: .7rem 1rem; background: #fff; border-top: 1px solid var(--pdf-line, #dfe5ea); font-size: .9rem; }
.pdfv-cap-t { font-weight: 700; color: var(--ink, #14212e); }
.pdfv-cap-k { color: var(--muted, #4b5b6b); }
.pdfv-cap-dl { margin-left: auto; display: inline-flex; gap: .35rem; align-items: center; font-weight: 600; color: var(--blue-700, #075478); }

/* full screen, and the reader opened over the page */
.pdfv:fullscreen { border: 0; border-radius: 0; --pdfv-h: auto; }
.pdfv:fullscreen .pdfv-stage, .pdfv:fullscreen .pdfv-toc { height: auto; max-height: none; }
.pdfv:fullscreen .pdfv-body { flex: 1 1 auto; } .pdfv:fullscreen .pdfv-cap { display: none; }
.pdfv-dialog { width: min(1200px, 100vw); max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0 auto; padding: 0; border: 0; background: transparent; }
.pdfv-dialog::backdrop { background: rgba(6, 20, 34, .82); }
.pdfv-dialog .pdfv { height: 100%; border-radius: 0; border: 0; --pdfv-h: auto; }
.pdfv-dialog .pdfv-body { flex: 1 1 auto; min-height: 0; }
.pdfv-dialog .pdfv-stage, .pdfv-dialog .pdfv-toc { height: auto; max-height: none; }
@media (min-width: 900px) { .pdfv-dialog { height: calc(100dvh - 2rem); margin-top: 1rem; } .pdfv-dialog .pdfv { border-radius: 12px; } }
html.pdfv-locked { overflow: hidden; }

/* pdf.js text layer: the page's text over the picture, so it can be selected, copied and read by screen readers */
.pdfv .textLayer { position: absolute; inset: 0; overflow: clip; opacity: 1; line-height: 1; text-align: initial; -webkit-text-size-adjust: none; text-size-adjust: none;
  forced-color-adjust: none; transform-origin: 0 0; caret-color: CanvasText; z-index: 1; }
.pdfv .textLayer :is(span, br) { color: transparent; position: absolute; white-space: pre; cursor: text; transform-origin: 0% 0%; }
.pdfv .textLayer > :not(.markedContent), .pdfv .textLayer .markedContent span:not(.markedContent) { z-index: 1; }
.pdfv .textLayer span.markedContent { top: 0; height: 0; }
.pdfv .textLayer ::selection { background: rgba(0, 92, 200, .3); }
.pdfv .textLayer br::selection { background: transparent; }
.pdfv .textLayer span.pdfv-hit { background: rgba(255, 196, 0, .45); border-radius: 2px; }
.hiddenCanvasElement { position: absolute; top: 0; left: 0; width: 0; height: 0; display: none; }

@media print { .pdfv-bar, .pdfv-toc, .pdf-actions { display: none !important; } .pdfv-stage { height: auto; overflow: visible; } }
