/* docview.css — popup PDF + lightbox รูปภาพ (js/docview.js, frontend\components\DocLink) ; ใช้ได้ทั้ง template 1 และ 2 */
.dv-pdf { width: min(1100px, 94vw); height: 92vh; max-width: none; max-height: none; padding: 0; border: 0; border-radius: 14px; background: #fff;
  box-shadow: 0 24px 64px rgba(10, 25, 16, .35); overflow: hidden; }
.dv-pdf[open] { display: flex; flex-direction: column; }
.dv-pdf::backdrop { background: rgba(18, 32, 24, .62); backdrop-filter: blur(2px); }
.dv-pdf-bar { display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 16px; background: #0E3B27; color: #fff; flex-shrink: 0; }
.dv-pdf-icon { padding: 5px 7px; border-radius: 6px; background: #B42318; color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .05em; flex-shrink: 0; }
.dv-pdf-title { flex: 1; min-width: 0; margin: 0; font-size: 15px; font-weight: 600; line-height: 1.35; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dv-pdf-btn { display: inline-flex; align-items: center; height: 34px; padding: 0 14px; border: 1px solid rgba(255, 255, 255, .35); border-radius: 8px; background: transparent;
  color: #fff !important; font: inherit; font-size: 13.5px; font-weight: 600; text-decoration: none !important; cursor: pointer; flex-shrink: 0; }
.dv-pdf-btn:hover, .dv-pdf-btn:focus-visible { background: rgba(255, 255, 255, .14); }
.dv-pdf-close { width: 34px; padding: 0; justify-content: center; }
.dv-pdf-body { position: relative; flex: 1; background: #525659; }
.dv-pdf-body iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; opacity: 0; transition: opacity .15s; }
.dv-pdf.loaded .dv-pdf-body iframe { opacity: 1; }
.dv-pdf-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #E8E8E8; font-size: 14px; }
html.dv-open { overflow: hidden; }

.dv-lb { position: fixed; inset: 0; z-index: 3000; display: grid; grid-template-columns: 64px minmax(0, 1fr) 64px; align-items: center; background: rgba(12, 18, 14, .94); color: #fff; }
.dv-lb[hidden] { display: none; }
.dv-lb button { width: 48px; height: 48px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .12); color: #fff; font-size: 28px; line-height: 1; cursor: pointer; justify-self: center; }
.dv-lb button:hover, .dv-lb button:focus-visible { background: rgba(255, 255, 255, .28); outline: none; }
.dv-lb .dv-x { position: absolute; top: 12px; right: 12px; font-size: 22px; }
.dv-fig { display: flex; flex-direction: column; align-items: center; gap: 10px; min-width: 0; margin: 0; }
.dv-stage { display: flex; align-items: center; justify-content: center; max-width: 100%; max-height: calc(100vh - 110px); }
.dv-stage img { max-width: 100%; max-height: calc(100vh - 110px); object-fit: contain; cursor: zoom-in; background: #222; border-radius: 4px; user-select: none; }
.dv-stage.is-zoom { display: block; width: 100%; height: calc(100vh - 110px); overflow: auto; }
.dv-stage.is-zoom img { max-width: none; max-height: none; cursor: zoom-out; }
.dv-fig figcaption { display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 14px; max-width: 90%; font-size: 14px; text-align: center; }
.dv-n { font-size: 12px; opacity: .75; font-variant-numeric: tabular-nums; }
img.dv-zoomable { cursor: zoom-in; }
img.dv-zoomable:focus-visible { outline: 3px solid #00744B; outline-offset: 2px; }
@media (max-width: 640px) {
  .dv-lb { grid-template-columns: 0 minmax(0, 1fr) 0; }
  .dv-lb .dv-prev, .dv-lb .dv-next { position: absolute; bottom: 14px; z-index: 1; }
  .dv-lb .dv-prev { left: 14px; } .dv-lb .dv-next { right: 14px; }
  .dv-stage, .dv-stage img { max-height: calc(100vh - 150px); }
}
