/* ============================================================
 * DX_PDF 게시판 스킨 — pdf.css  v1.3.2
 * Copyright © DesignOneX — designonex.com · All Rights Reserved.
 * License: DesignOneX License 1.0 (LICENSE.md)
 * style.css(NEW GALLARY 기반 공통 틀) 위에 PDF 전용 부분만 얹습니다.
 * 색·선·글자는 모두 style.css 의 --nb-* 값을 그대로 씁니다. 그림자 없음.
 * ============================================================ */

/* ── 목록 카드 : PDF 첫 쪽이 잘리지 않게 세로형 ── */
.gl55-grid.dxpdf-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.dxpdf-grid .gl55-thumb-wrap { aspect-ratio: 4 / 5; background: var(--nb-hover); }
.dxpdf-grid .gl55-thumb { object-fit: cover; object-position: top center; background: #fff; }
.dxpdf-badge { position: absolute; left: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 3px; background: #20231f; color: #fff; font-size: 10px; font-weight: 800; letter-spacing: .06em; }
.dxpdf-badge i { font-size: 10px; }
.dxpdf-pages { position: absolute; right: 10px; bottom: 10px; padding: 4px 9px; border-radius: 99px; background: rgba(255,255,255,.94); color: #20231f; font-size: 10px; font-weight: 800; }
.dxpdf-grid .gl55-foot-stats-right .fa-download { color: var(--nb-mute); }
.dxpdf-grid .gl55-card-wrap.is-notice .gl55-card { border-color: var(--nb-ink); }
html body.dark .dxpdf-pages { background: rgba(255,255,255,.92); color: #20231f; }
html body.dark .dxpdf-badge { background: #000; }

/* ── 상세 : 뷰어 ── */
.dxpdf-viewer { border-bottom: 1px solid var(--nb-line); background: transparent; }
.dxpdf-vtool { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--nb-line); }
.dxpdf-vtool .grp { display: flex; align-items: center; gap: 8px; }
.dxpdf-pg { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--nb-mute); font-weight: 600; }
.dxpdf-pg input { width: 56px; height: 36px; padding: 0; border: 1px solid var(--nb-line); border-radius: 4px; background: var(--nb-card); color: var(--nb-ink); text-align: center; font: inherit; font-size: 14px; font-weight: 800; outline: none; -moz-appearance: textfield; }
.dxpdf-pg input:focus { border-color: var(--nb-ink); }
.dxpdf-pg input::-webkit-outer-spin-button, .dxpdf-pg input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.dxpdf-zoom { min-width: 50px; text-align: center; font-size: 12px; font-weight: 800; color: var(--nb-mute); }
.dxpdf-vtool .nb-icon-btn { width: 36px; height: 36px; font-size: 12px; }
.dxpdf-vmain { display: flex; background: var(--nb-hover); min-height: 320px; }
.dxpdf-thumbs { flex: 0 0 112px; border-right: 1px solid var(--nb-line); padding: 14px 0; display: flex; flex-direction: column; align-items: center; gap: 12px; max-height: 760px; overflow-y: auto; }
.dxpdf-th { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 0; border: 0; background: transparent; color: var(--nb-mute); font-size: 11px; font-weight: 700; }
.dxpdf-th .im { display: flex; align-items: center; justify-content: center; width: 70px; min-height: 90px; border: 1.5px solid var(--nb-line); border-radius: 3px; background: #fff; overflow: hidden; }
.dxpdf-th .im canvas { display: block; width: 100%; height: auto; }
.dxpdf-th.on { color: var(--nb-ink); font-weight: 900; }
.dxpdf-th.on .im { border-color: var(--nb-ink); }
.dxpdf-pagebox { position: relative; flex: 1; min-width: 0; max-height: 860px; padding: 24px 20px 32px; display: flex; justify-content: center; align-items: flex-start; overflow: auto; }
.dxpdf-pagebox canvas { display: block; flex: none; max-width: none; background: #fff; border: 1px solid var(--nb-line); }
.dxpdf-load { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 20px; text-align: center; font-size: 13px; line-height: 1.7; color: var(--nb-mute); pointer-events: none; }
.dxpdf-load a { pointer-events: auto; }
.dxpdf-spin { width: 26px; height: 26px; margin: 0 auto 10px; border-radius: 50%; border: 3px solid var(--nb-line); border-top-color: var(--nb-ink); animation: dxpdfspin .8s linear infinite; }
@keyframes dxpdfspin { to { transform: rotate(360deg); } }
.dxpdf-empty-view { display: flex; align-items: center; justify-content: center; min-height: 220px; text-align: center; color: var(--nb-mute); font-size: 13px; line-height: 1.8; background: var(--nb-hover); border-bottom: 1px solid var(--nb-line); }
.dxpdf-empty-view i { display: block; margin-bottom: 10px; font-size: 28px; opacity: .5; }
.dxpdf-viewer.is-full { position: fixed; inset: 0; z-index: 99990; display: flex; flex-direction: column; padding: 0 20px; background: var(--nb-card); border: 0; }
.dxpdf-viewer.is-full .dxpdf-vmain { flex: 1; min-height: 0; }
.dxpdf-viewer.is-full .dxpdf-pagebox, .dxpdf-viewer.is-full .dxpdf-thumbs { max-height: none; }
.dxpdf-dl { background: var(--nb-btn) !important; border-color: var(--nb-btn) !important; color: var(--nb-on-btn) !important; }
.dxpdf-dl:hover { background: var(--nb-acid) !important; border-color: var(--nb-acid) !important; color: #20231f !important; }
html body.dark .nb .dxpdf-dl, html body.dark .nb .dxpdf-dl * { background: var(--nb-btn) !important; border-color: var(--nb-btn) !important; color: var(--nb-on-btn) !important; }


/* ── 글쓰기 : PDF 올리기 ── */
.dxpdf-up { display: flex; align-items: center; gap: 14px; margin-top: 12px; padding: 12px 14px; border: 1px solid var(--nb-line); border-radius: 4px; background: var(--nb-card); }
.dxpdf-up .ic { flex: none; width: 48px; height: 64px; border: 1px solid var(--nb-line); border-radius: 3px; background: #fff; overflow: hidden; }
.dxpdf-up .ic canvas { display: block; width: 100%; height: 100%; object-fit: contain; }
.dxpdf-up .bd { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.dxpdf-up .l1 { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.dxpdf-up .l1 b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 800; }
.dxpdf-up .l1 span { flex: none; color: var(--nb-mute); font-size: 12px; }
.dxpdf-up .bar { height: 4px; border-radius: 99px; background: var(--nb-line); overflow: hidden; }
.dxpdf-up .bar i { display: block; width: 0; height: 100%; background: var(--nb-ink); transition: width .2s; }
.dxpdf-up .st { font-size: 12px; font-weight: 700; color: var(--nb-mute); }
.dxpdf-up .st.err { color: var(--nb-danger); }
.dxpdf-covers { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.dxpdf-covers > p { flex-basis: 100%; margin: 0 0 2px; font-size: 12px; color: var(--nb-mute); }
.dxpdf-cv { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 0; border: 0; background: transparent; color: var(--nb-mute); font-size: 11px; font-weight: 700; }
.dxpdf-cv .im { display: flex; align-items: center; justify-content: center; width: 76px; min-height: 100px; border: 1.5px solid var(--nb-line); border-radius: 3px; background: #fff; overflow: hidden; }
.dxpdf-cv .im canvas { display: block; width: 100%; height: auto; }
.dxpdf-cv.on { color: var(--nb-ink); font-weight: 900; }
.dxpdf-cv.on .im { border-color: var(--nb-ink); border-width: 2px; }
.dxpdf-extra { margin-top: 14px; font-size: 13px; }
.dxpdf-extra summary { cursor: pointer; font-weight: 800; }
.dxpdf-extra input[type=file] { display: block; max-width: 100%; margin: 10px 0 4px; font-size: 12px; }
.dxpdf-curfile { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; padding: 10px 12px; border: 1px solid var(--nb-line); border-radius: 4px; background: var(--nb-hover); font-size: 13px; }
.dxpdf-curfile > i { font-size: 18px; color: var(--nb-mute); width: 28px; text-align: center; }
.dxpdf-curfile b { display: block; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dxpdf-curfile small { color: var(--nb-mute); font-size: 11px; }
.dxpdf-exrow { display: flex; margin-top: 8px; }

@media (max-width: 900px) { .dxpdf-thumbs { display: none; } .dxpdf-pagebox { padding: 16px 12px 22px; } }
@media (max-width: 767px) {
  .dxpdf-vtool .zm { display: none; }
  .dxpdf-vtool { justify-content: center; }
  .dxpdf-vmain { min-height: 260px; }
  .dxpdf-pagebox { padding: 12px 8px 16px; max-height: none; }
  .dxpdf-grid .gl55-thumb-wrap { aspect-ratio: 3 / 4; }
}
@media (prefers-reduced-motion: reduce) { .dxpdf-spin { animation: none; } }

/* ── 상세 : 뷰어 카드 + 오른쪽 정보 ── */
.dxpdf-split { display: block; margin-top: 20px; }
.dxpdf-split .dxpdf-viewer { border: 1px solid var(--nb-line); border-radius: 16px; background: var(--nb-card); overflow: hidden; }
.dxpdf-split .dxpdf-vtool { padding: 14px 16px; }
.dxpdf-split .dxpdf-thumbs { padding: 14px 10px; }
.dxpdf-side { display: flex; flex-direction: column; gap: 16px; margin-top: 16px; }
.dxpdf-card { border: 1px solid var(--nb-line); border-radius: 16px; background: var(--nb-card); padding: 22px 22px 20px; min-width: 0; }
.dxpdf-card h3 { margin: 0 0 16px; font-size: 15px; font-weight: 800; color: var(--nb-ink); }
.dxpdf-file { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 12px; background: var(--nb-hover); }
.dxpdf-file .ic { flex: none; width: 44px; height: 44px; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: rgba(224, 60, 90, .1); color: #e03c5a; font-size: 18px; }
.dxpdf-file .tx { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.dxpdf-file b { font-size: 14px; font-weight: 800; color: var(--nb-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dxpdf-file em { font-style: normal; font-size: 12px; color: var(--nb-mute); }
.dxpdf-dl2 { margin: 10px 0 0; }
.dxpdf-dl2 > div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; font-size: 13px; }
.dxpdf-dl2 dt { color: var(--nb-mute); }
.dxpdf-dl2 dd { margin: 0; font-weight: 800; color: var(--nb-ink); }
.dxpdf-desc .dx-post-body { padding: 0; margin: 0; border: 0; min-height: 0; font-size: 14px; line-height: 1.8; }
.dxpdf-desc.dxpdf-nobody { display: none; }
.dx-action-bar { margin-top: 20px; }
.dxpdf-del { color: #d63a3a !important; }
.dxpdf-del i { color: #d63a3a; }
@media (min-width: 1000px) {
  .dxpdf-split.has-side { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 0 20px; align-items: start; }
  .dxpdf-split.has-side .dxpdf-side { margin-top: 0; }
}
@media (max-width: 767px) { .dxpdf-card { padding: 18px 16px; border-radius: 14px; } .dxpdf-split .dxpdf-viewer { border-radius: 14px; } }
.dx-action-bar { border-top: 0 !important; padding-top: 0 !important; margin-top: 24px; }

/* 글 아래 목록도 같은 세로형 PDF 카드 */
.dx-gl-lt-grid.dxpdf-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.dxpdf-grid .dx-gl-lt-thumb-wrap { aspect-ratio: 4 / 5; background: var(--nb-hover); }
.dxpdf-grid .dx-gl-lt-thumb { object-fit: cover; object-position: top center; background: #fff; }
.dxpdf-grid .dx-gl-lt-empty-img { display: flex; align-items: center; justify-content: center; height: 100%; font-size: 30px; color: var(--nb-mute); opacity: .5; }
.dxpdf-grid .dx-gl-lt-now { top: auto !important; bottom: 44px !important; left: 10px !important; }
.dxpdf-grid .dx-gl-lt-cat { top: 10px; bottom: auto; }

/* 위 도구 줄 · 아래 버튼 줄 · 첨부파일 간격 */
.dxpdf-topbar { display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0 0; }
.dx-file-box { margin-top: 32px !important; }
.dx-action-bar { margin-top: 28px !important; }
