/* 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); }
}

/* การ์ดไฟล์ (Excel / Word / PowerPoint / ZIP) */
.dv-file { width: min(440px, 92vw); padding: 32px 28px 24px; border: 0; border-radius: 16px; background: #fff; text-align: center;
  box-shadow: 0 24px 64px rgba(10, 25, 16, .35); color: #14324f; }
.dv-file::backdrop { background: rgba(18, 32, 24, .62); backdrop-filter: blur(2px); }
.dv-file-x { position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; border: 0; border-radius: 50%; background: #eef4f7; color: #14324f; font-size: 16px; cursor: pointer; }
.dv-file-x:hover { background: #dce7ee; }
.dv-file-icon { width: 72px; height: 72px; margin: 0 auto 16px; display: grid; place-items: center; border-radius: 18px; color: #fff; font-size: 15px; font-weight: 800; letter-spacing: .04em; box-shadow: 0 8px 20px rgba(0, 0, 0, .18); }
.dv-file-title { margin: 0 0 6px; font-size: 17px; font-weight: 800; line-height: 1.45; overflow-wrap: anywhere; }
.dv-file-kind { margin: 0 0 22px; color: #62768b; font-size: 13.5px; }
.dv-file-act { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.dv-file-dl, .dv-file-cancel { display: inline-flex; align-items: center; justify-content: center; height: 42px; padding: 0 22px; border-radius: 10px; font: inherit; font-size: 14.5px; font-weight: 700; cursor: pointer; text-decoration: none !important; }
.dv-file-dl { background: #006a3d; color: #fff !important; border: 0; }
.dv-file-dl:hover, .dv-file-dl:focus-visible { background: #004f2e; }
.dv-file-cancel { background: #fff; color: #14324f; border: 1px solid #dce7ee; }
.dv-file-cancel:hover { background: #f6fbf8; }
.dv-file-note { margin: 16px 0 0; color: #62768b; font-size: 12.5px; line-height: 1.6; }
.dv-pdf, .dv-file { font-family: inherit; }
