/* Shared document viewer — static/js/doc_viewer.js + templates/partials/_doc_viewer.html.
   Design tokens from style.css; navy bar matches the team/portal modals. */
.dv-modal {
    position: fixed; inset: 0; z-index: 1100;
    background: rgba(0, 0, 0, 0.7);
    align-items: center; justify-content: center;
}
.dv-modal[style*="flex"] { display: flex; }
.dv-box {
    width: 92vw; height: 92vh; max-width: 1400px;
    background: #fff; border-radius: var(--radius-md, 8px); overflow: hidden;
    display: flex; flex-direction: column;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}
.dv-bar {
    display: flex; align-items: center; gap: var(--space-3, 12px);
    padding: var(--space-2, 8px) var(--space-3, 12px);
    background: var(--navy, #002147); color: #fff; flex-wrap: wrap;
}
.dv-title {
    font-size: 0.9rem; min-width: 0; flex: 1 1 200px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dv-overlay {
    font-size: 0.8rem; opacity: 0.9; align-items: center;
    gap: 16px; flex-wrap: wrap;
}
.dv-tools { display: flex; align-items: center; gap: 2px; margin-left: auto; flex-wrap: wrap; }
.dv-btn {
    background: transparent; border: 1px solid rgba(255, 255, 255, 0.35);
    color: #fff; border-radius: var(--radius-sm, 4px);
    font-size: 0.8rem; line-height: 1; padding: 6px 8px; cursor: pointer;
    text-decoration: none; display: inline-flex; align-items: center; justify-content: center;
    min-width: 30px; transition: background var(--transition-speed, 0.18s);
}
.dv-btn:hover, .dv-btn:focus { background: rgba(255, 255, 255, 0.15); color: #fff; outline: none; }
/* Keyboard focus must look different from hover (WCAG 2.4.7). */
.dv-btn:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
.dv-stage:focus-visible { outline: 2px solid #fff; outline-offset: -3px; }
.dv-btn:disabled, .dv-btn.dv-disabled { opacity: 0.35; cursor: default; pointer-events: none; }
.dv-btn.dv-close { margin-left: var(--space-2, 8px); }
.dv-zoom-label { min-width: 52px; font-variant-numeric: tabular-nums; }
.dv-counter { font-size: 0.78rem; opacity: 0.9; min-width: 44px; text-align: center; font-variant-numeric: tabular-nums; }
.dv-sep { width: 1px; height: 20px; background: rgba(255, 255, 255, 0.3); margin: 0 4px; }
.dv-stage {
    flex: 1; min-height: 0; overflow: auto; position: relative;
    background: #4a4f57; outline: none;
}
.dv-content { min-width: 100%; min-height: 100%; display: flex; flex-direction: column; align-items: center; padding: var(--space-3, 12px); box-sizing: border-box; }
.dv-content.dv-iframe { padding: 0; display: block; height: 100%; }
.dv-content iframe { width: 100%; height: 100%; border: none; background: #fff; display: block; }
.dv-page { background: #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4); margin-bottom: var(--space-3, 12px); display: block; }
.dv-img-wrap { position: relative; display: flex; align-items: center; justify-content: center; margin: auto; }
.dv-img-wrap img { position: absolute; top: 50%; left: 50%; transform-origin: center center; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4); background: #fff; }
.dv-status {
    position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.75); color: #fff; padding: 10px 16px;
    border-radius: var(--radius-md, 8px); font-size: 0.85rem; text-align: center; max-width: 80%;
}
.dv-hint {
    font-size: 0.7rem; color: #5e6e80;   /* #6c757d was 4.4:1 on #f8f9fa (WCAG 1.4.3) */
    padding: 4px 12px; background: #f8f9fa; border-top: 1px solid #e9ecef; text-align: center;
}
/* Split-screen: with the ISF detail panel open the viewer docks to the LEFT
   of the panel (width set via --fv-dock-right) so the panel stays editable. */
#file-viewer-modal.fv-dock-left { right: var(--fv-dock-right, 760px) !important; background: transparent !important; }
#file-viewer-modal.fv-dock-left #file-viewer-box { width: 100% !important; height: 100% !important; max-width: none !important; border-radius: 0 !important; }
@media (max-width: 700px) {
    .dv-box { width: 100vw; height: 100vh; border-radius: 0; }
    .dv-hint { display: none; }
    .dv-tools { gap: 0; }
    .dv-btn { padding: 6px 6px; min-width: 26px; }
    .dv-sep { display: none; }
}
