/* css/drive-viewer.css: Codex copy of the shared Drive file-preview styles
   (pairs with js/drive-viewer.js). Carried verbatim from the legacy
   classvault.css (.cv-renderer-* base) + cv-drive.css (.cv-drive-viewer-* modal)
   so Codex owns the viewer's styling and no longer loads cv-drive.css. The .cv-
   class names are kept (the markup is a faithful port); they are prefix-scoped
   and do not collide with Codex's cdx- styles. All surface/text/border values
   come from CSS custom properties so light + dark themes work unchanged. */

/* ── Renderer iframe (inline mount + modal body) ──────────────────────────── */
.cv-renderer-iframe-wrap {
  position: relative;
  width: 100%;
  height: 100%;
}
.cv-renderer-iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--surface);
  display: block;
}
.cv-renderer-empty {
  padding: 40px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  text-align: center;
}

/* Presentations load the chrome-free Slides /embed player; the clip shell
   (oversize + overflow:hidden) hides its bottom playbar. Drive *files*
   (/preview) keep the plain wrap so their content is never cropped. */
.cv-renderer-iframe-wrap.cv-slides-clip {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
.cv-renderer-iframe-wrap.cv-slides-clip .cv-renderer-iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: calc(100% + 60px);
  border: 0;
}

/* ── File-preview modal (drive-viewer.js openModal) ───────────────────────── */
.cv-drive-viewer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
}
.cv-drive-viewer-modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  width: min(1100px, 100%);
  height: min(80vh, 800px);
  overflow: hidden;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.3);
}
.cv-drive-viewer-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.cv-drive-viewer-title {
  flex: 1;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cv-drive-viewer-close {
  background: transparent;
  border: none;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0 6px;
  border-radius: 6px;
}
.cv-drive-viewer-close:hover {
  background: var(--surface-soft);
  color: var(--text-primary);
}
.cv-drive-viewer-body {
  flex: 1;
  min-height: 0;
  display: flex;
}
.cv-drive-viewer-body .cv-renderer-iframe-wrap,
.cv-drive-viewer-body iframe {
  flex: 1;
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--background);
}
