/* ==========================================================
   HITU DISPLAY — Document detail page with inline PDF viewer
   File: /ledsync/assets/css/pdf-viewer.css
   ========================================================== */
.pv-page {
  --ink: #0b0d12; --ink-2: #151922; --text: #12151c; --muted: #6b7280;
  --line: #e6e8ec; --line-strong: #d3d7de; --bg: #f6f7f9; --card: #fff;
  --accent: #2f6bff; --accent-2: #00d1ff; --accent-soft: #eaf0ff;
  --stage: #3a3f48;
  font-family: "Inter", -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased;
}
.pv-page *, .pv-page *::before, .pv-page *::after { box-sizing: border-box; }
.pv-wrap { max-width: 1320px; margin: 0 auto; padding: 0 32px; }

/* ---------- Hero ---------- */
.pv-hero {
  position: relative; overflow: hidden; color: #fff; padding: 104px 0 88px;
  background:
    radial-gradient(800px 380px at 92% -20%, rgba(47,107,255,.38), transparent 60%),
    radial-gradient(600px 300px at 0% 120%, rgba(0,209,255,.16), transparent 60%), var(--ink);
}
.pv-hero::before {
  content: ""; position: absolute; inset: 0; opacity: .45; pointer-events: none;
  background-image: radial-gradient(rgba(255,255,255,.14) 1px, transparent 1.4px); background-size: 14px 14px;
  -webkit-mask-image: linear-gradient(180deg,#000,transparent 85%); mask-image: linear-gradient(180deg,#000,transparent 85%);
}
.pv-hero .pv-wrap { position: relative; }
.pv-crumb { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 26px; font-size: 13px; color: rgba(255,255,255,.5); }
.pv-crumb a { color: rgba(255,255,255,.78); text-decoration: none; }
.pv-crumb a:hover { color: #fff; }
.pv-hero-grid { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; }
.pv-hero-main { min-width: 0; max-width: 860px; }
.pv-tags { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.pv-tag { padding: 5px 12px; border-radius: 999px; font: 600 11px/1 "Inter", sans-serif; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-2); background: rgba(0,209,255,.12); border: 1px solid rgba(0,209,255,.3); }
.pv-fmt { font: 600 12px/1 "Inter", sans-serif; letter-spacing: .1em; color: rgba(255,255,255,.6); }
.pv-title { margin: 0 0 16px; font: 700 clamp(30px, 4vw, 46px)/1.12 "Space Grotesk", "Inter", sans-serif; letter-spacing: -.02em; color: #fff; }
.pv-intro { margin: 0 0 22px; max-width: 700px; font-size: 17px; line-height: 1.65; color: rgba(255,255,255,.66); }
.pv-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; font-size: 13px; color: rgba(255,255,255,.62); }
.pv-meta span { display: inline-flex; align-items: center; gap: 7px; }
.pv-meta svg { opacity: .8; }
.pv-hero-actions { display: flex; gap: 10px; flex: none; }

/* ---------- Buttons ---------- */
.pv-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  height: 46px; padding: 0 22px; font: 600 14px "Inter", sans-serif; text-decoration: none; white-space: nowrap;
  border-radius: 10px; border: 1px solid transparent; cursor: pointer; transition: background .2s, box-shadow .2s, border-color .2s, color .2s;
}
.pv-btn-primary { color: #fff; background: var(--accent); box-shadow: 0 10px 28px -10px rgba(47,107,255,.8); }
.pv-btn-primary:hover { background: #1f58e6; }
.pv-btn-ghost { color: #fff; background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.22); }
.pv-btn-ghost:hover { background: rgba(255,255,255,.16); }
.pv-btn-dark { color: #fff; background: var(--ink); }
.pv-btn-dark:hover { background: var(--accent); }
.pv-btn-line { color: var(--text); background: #fff; border-color: var(--line-strong); }
.pv-btn-line:hover { border-color: var(--accent); color: var(--accent); }
.pv-btn-block { width: 100%; }
.pv-btn[aria-disabled="true"] { background: #e9ebef; color: #9aa1ad; box-shadow: none; pointer-events: none; }

/* ---------- Viewer ---------- */
.pv-stage { position: relative; z-index: 2; margin-top: -44px; }
.pv-viewer {
  position: relative; display: flex; flex-direction: column; height: 86vh; min-height: 600px; max-height: 1100px;
  background: var(--stage); border-radius: 18px; overflow: hidden; outline: none;
  border: 1px solid rgba(11,13,18,.5); box-shadow: 0 30px 70px -28px rgba(11,13,18,.55);
}
.pv-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex: none;
  padding: 10px 14px; background: var(--ink-2); color: #fff; border-bottom: 1px solid rgba(255,255,255,.08);
}
.pv-tb-group { display: flex; align-items: center; gap: 6px; min-width: 0; }
.pv-tb-sep { width: 1px; height: 22px; margin: 0 6px; background: rgba(255,255,255,.14); }
.pv-ib {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 36px; height: 36px; padding: 0 10px;
  font: 500 13px "Inter", sans-serif; color: #e8ebf1; text-decoration: none; background: transparent; border: 0; border-radius: 8px; cursor: pointer; transition: background .15s;
}
.pv-ib:hover { background: rgba(255,255,255,.1); }
.pv-ib.is-on { background: rgba(47,107,255,.35); }
.pv-ib-dl { background: var(--accent); color: #fff; padding: 0 14px; font-weight: 600; }
.pv-ib-dl:hover { background: #1f58e6; }
.pv-pager { display: flex; align-items: center; gap: 8px; font-size: 13px; color: rgba(255,255,255,.7); }
.pv-pager input {
  width: 48px; height: 32px; text-align: center; font: 600 13px "Inter", sans-serif; color: #fff;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16); border-radius: 7px; outline: none;
}
.pv-pager input:focus { border-color: var(--accent-2); }
.pv-zoom-label { min-width: 52px; text-align: center; font: 600 13px "Inter", sans-serif; color: #fff; }
.pv-progress { position: absolute; left: 0; top: 0; height: 3px; width: 0; z-index: 5; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .2s; }
.pv-viewer.is-ready .pv-progress { opacity: 0; transition: opacity .6s .2s; }

.pv-body { position: relative; display: flex; flex: 1; min-height: 0; }
.pv-thumbs { display: none; flex: none; width: 164px; padding: 14px 12px; overflow-y: auto; background: #2a2e36; border-right: 1px solid rgba(255,255,255,.07); }
.pv-viewer.show-thumbs .pv-thumbs { display: block; }
.pv-thumb { display: block; width: 100%; margin: 0 0 14px; padding: 0; text-align: center; background: none; border: 0; cursor: pointer; color: rgba(255,255,255,.65); font: 500 12px "Inter", sans-serif; }
.pv-thumb-box { display: flex; align-items: center; justify-content: center; margin-bottom: 6px; background: #fff; border-radius: 3px; border: 2px solid transparent; overflow: hidden; min-height: 150px; }
.pv-thumb canvas { display: block; width: 100%; height: auto; }
.pv-thumb.is-active .pv-thumb-box { border-color: var(--accent-2); }
.pv-thumb.is-active { color: #fff; }

.pv-scroller { position: relative; flex: 1; min-width: 0; overflow: auto; padding: 24px 0 48px; scroll-behavior: auto; -webkit-overflow-scrolling: touch; }
.pv-pages { display: flex; flex-direction: column; align-items: center; gap: 16px; min-width: max-content; padding: 0 24px; margin: 0 auto; }
.pv-sheet { position: relative; flex: none; background: #fff; box-shadow: 0 6px 24px rgba(0,0,0,.35); }
.pv-sheet canvas { display: block; width: 100%; height: 100%; }
.pv-sheet::after { content: attr(data-n); position: absolute; right: 12px; bottom: 10px; padding: 3px 9px; font: 600 11px "Inter", sans-serif; color: #fff; background: rgba(11,13,18,.55); border-radius: 999px; opacity: 0; transition: opacity .2s; pointer-events: none; }
.pv-sheet:hover::after { opacity: 1; }
.pv-sheet.is-loading::before { content: ""; position: absolute; top: 50%; left: 50%; width: 30px; height: 30px; margin: -15px 0 0 -15px; border: 3px solid #e3e6ec; border-top-color: var(--accent); border-radius: 50%; animation: pvspin .8s linear infinite; }
@keyframes pvspin { to { transform: rotate(360deg); } }

/* loading / error overlay */
.pv-overlay { position: absolute; inset: 0; z-index: 4; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 32px; text-align: center; color: #fff; background: var(--stage); }
.pv-viewer.is-ready .pv-overlay-loading, .pv-viewer.is-error .pv-overlay-loading { display: none; }
.pv-overlay-error { display: none; }
.pv-viewer.is-error .pv-overlay-error { display: flex; }
.pv-overlay h3 { margin: 0; font: 600 20px "Space Grotesk", sans-serif; }
.pv-overlay p { margin: 0 0 6px; max-width: 420px; color: rgba(255,255,255,.65); font-size: 14px; line-height: 1.6; }
.pv-overlay-loading .pv-spin { width: 38px; height: 38px; border: 3px solid rgba(255,255,255,.18); border-top-color: var(--accent-2); border-radius: 50%; animation: pvspin .8s linear infinite; }
.pv-overlay-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }

.pv-viewer:fullscreen { height: 100vh; max-height: none; border-radius: 0; }
.pv-viewer:-webkit-full-screen { height: 100vh; max-height: none; border-radius: 0; }
.pv-hint { margin: 12px 4px 0; font-size: 12px; color: var(--muted); text-align: center; }
.pv-hint kbd { padding: 2px 6px; font: 500 11px "Inter", monospace; background: #fff; border: 1px solid var(--line-strong); border-radius: 5px; }

/* ---------- Non-PDF / empty fallback ---------- */
.pv-fallback { padding: 96px 32px; text-align: center; background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 24px 60px -28px rgba(11,13,18,.3); }
.pv-fallback h3 { margin: 18px 0 8px; font: 600 22px "Space Grotesk", sans-serif; }
.pv-fallback p { margin: 0 0 24px; color: var(--muted); }

/* file icon */
.pv-ico { flex: none; position: relative; display: flex; align-items: flex-end; justify-content: center; width: 56px; height: 64px; margin: 0 auto; padding-bottom: 9px; border-radius: 10px; font: 700 11px/1 "Inter", sans-serif; letter-spacing: .06em; color: #fff; background: #e5484d; }
.pv-ico::before { content: ""; position: absolute; top: 0; right: 0; width: 16px; height: 16px; background: linear-gradient(225deg, #fff 50%, rgba(255,255,255,.35) 50%); border-bottom-left-radius: 6px; }
.pv-ico.sm { width: 40px; height: 48px; margin: 0; font-size: 10px; padding-bottom: 7px; border-radius: 8px; }
.pv-ico.sm::before { width: 12px; height: 12px; }

/* ---------- Content + sidebar ---------- */
.pv-main { padding: 48px 0 120px; }
.pv-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 32px; align-items: start; }
.pv-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 28px; }
.pv-card + .pv-card { margin-top: 20px; }
.pv-kicker { margin: 0 0 8px; font: 600 11px/1 "Inter", sans-serif; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); }
.pv-h2 { margin: 0 0 18px; font: 600 24px/1.25 "Space Grotesk", "Inter", sans-serif; letter-spacing: -.01em; }
.pv-card-h { margin: 0 0 18px; font: 600 11px/1 "Inter", sans-serif; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }

.pv-richtext { font-size: 16px; line-height: 1.75; color: #2b303b; }
.pv-richtext h2, .pv-richtext h3 { margin: 1.6em 0 .6em; font-family: "Space Grotesk", sans-serif; color: var(--text); line-height: 1.3; }
.pv-richtext p { margin: 0 0 1.1em; }
.pv-richtext img { max-width: 100%; height: auto; border-radius: 10px; }
.pv-richtext table { width: 100%; border-collapse: collapse; margin: 1.2em 0; font-size: 14px; }
.pv-richtext th, .pv-richtext td { padding: 10px 14px; border: 1px solid var(--line); text-align: left; }
.pv-richtext th { background: var(--bg); font-weight: 600; }
.pv-richtext a { color: var(--accent); }

.pv-topics { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line); }
.pv-topics > span { font-size: 13px; color: var(--muted); margin-right: 4px; }
.pv-topics a { padding: 6px 12px; font-size: 13px; color: #3b4250; text-decoration: none; background: var(--bg); border-radius: 999px; transition: background .2s, color .2s; }
.pv-topics a:hover { background: var(--accent-soft); color: var(--accent); }

.pv-side { position: sticky; top: 96px; display: flex; flex-direction: column; gap: 20px; }
.pv-side .pv-card + .pv-card { margin-top: 0; }
.pv-note { margin: 12px 0 0; text-align: center; font-size: 12px; color: var(--muted); }
.pv-dl-actions { display: flex; flex-direction: column; gap: 10px; }
.pv-share-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pv-share-row .pv-btn { height: 42px; font-size: 13px; padding: 0 12px; }

.pv-facts { margin: 0; padding: 0; list-style: none; }
.pv-facts li { display: flex; justify-content: space-between; gap: 16px; padding: 13px 0; font-size: 14px; border-bottom: 1px solid var(--line); }
.pv-facts li:first-child { padding-top: 0; }
.pv-facts li:last-child { padding-bottom: 0; border-bottom: 0; }
.pv-facts span:first-child { color: var(--muted); }
.pv-facts span:last-child { font-weight: 500; text-align: right; word-break: break-word; }

.pv-list { display: flex; flex-direction: column; gap: 2px; margin: -8px; }
.pv-item { display: flex; align-items: center; gap: 14px; padding: 10px 8px; border-radius: 12px; color: var(--text); text-decoration: none; transition: background .2s; }
.pv-item:hover { background: var(--bg); }
.pv-item-img { flex: none; width: 64px; height: 48px; border-radius: 8px; overflow: hidden; background: var(--bg); }
.pv-item-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pv-item b { display: block; font: 500 14px/1.4 "Inter", sans-serif; }
.pv-item small { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); }
.pv-rank { flex: none; width: 28px; font: 700 15px "Space Grotesk", sans-serif; color: #c3c8d2; }

.pv-cta { position: relative; overflow: hidden; padding: 28px; color: #fff; border-radius: 16px; background: radial-gradient(420px 220px at 100% 0%, rgba(47,107,255,.5), transparent 65%), var(--ink); }
.pv-cta .pv-kicker { color: var(--accent-2); }
.pv-cta h3 { margin: 0 0 10px; font: 600 22px/1.25 "Space Grotesk", sans-serif; }
.pv-cta p { margin: 0 0 20px; font-size: 14px; line-height: 1.6; color: rgba(255,255,255,.66); }
.pv-cta .pv-btn { width: 100%; }

.pv-mobilebar { display: none; }
.pv-toast { position: fixed; left: 50%; bottom: 32px; z-index: 9999; padding: 12px 20px; font: 500 14px "Inter", sans-serif; color: #fff; background: var(--ink); border-radius: 10px; box-shadow: 0 16px 40px -12px rgba(0,0,0,.5); transform: translate(-50%, 20px); opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; }
.pv-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .pv-grid { grid-template-columns: 1fr; }
  .pv-side { position: static; }
  .pv-hero-grid { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 720px) {
  .pv-wrap { padding: 0 16px; }
  .pv-hero { padding: 84px 0 76px; }
  .pv-hero-actions { display: none; }
  .pv-viewer { height: 74vh; min-height: 460px; border-radius: 12px; }
  .pv-toolbar { flex-wrap: wrap; padding: 8px; }
  .pv-ib .pv-lbl, .pv-hide-sm { display: none; }
  .pv-pages { padding: 0 8px; }
  .pv-scroller { padding-top: 12px; }
  .pv-thumbs { position: absolute; z-index: 3; top: 0; bottom: 0; left: 0; width: 132px; }
  .pv-hint { display: none; }
  .pv-card { padding: 22px; }
  .pv-main { padding-bottom: 150px; }
  .pv-mobilebar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; display: flex; gap: 10px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: rgba(255,255,255,.96); border-top: 1px solid var(--line); backdrop-filter: blur(10px); }
  .pv-mobilebar .pv-btn { flex: 1; height: 48px; }
}
@media print { .pv-hero-actions, .pv-toolbar, .pv-side, .pv-mobilebar { display: none !important; } }
