/* ================================================================
   PDF CAPTURE MODE — applied to the offscreen clone during capture.
   These rules ONLY affect elements inside .pdf-capture-mode.
   They have ZERO effect on the live editor.
   ================================================================ */

/* --- Global capture overrides --- */
.pdf-capture-mode,
.pdf-capture-mode *,
.pdf-capture-mode *::before,
.pdf-capture-mode *::after {
  animation: none !important;
  animation-delay: 0s !important;
  animation-duration: 0s !important;
  transition: none !important;
  transition-delay: 0s !important;
  transition-duration: 0s !important;
}

.pdf-capture-mode {
  position: fixed !important;
  left: -9999px !important;
  top: 0 !important;
  z-index: -1 !important;
  pointer-events: none !important;
  overflow: visible !important;
  /* Render at native A4-at-96dpi width — no zoom, no scale */
  width: 794px !important;
  zoom: 1 !important;
  transform: none !important;
}

/* --- Remove editor chrome --- */
.pdf-capture-mode .live-field-editor,
.pdf-capture-mode .live-field-editor-wrap,
.pdf-capture-mode .live-field-suffix,
.pdf-capture-mode .live-item-editor {
  display: none !important;
}

/* --- Clear editor interaction states --- */
/* These use high-specificity selectors to beat template-scoped rules like
   .tpl-midnight [data-field].live-hover { color: ... !important } */
.pdf-capture-mode .is-editing,
.pdf-capture-mode [data-field].is-editing,
.pdf-capture-mode [data-item-index].is-editing {
  background: transparent !important;
  outline: none !important;
}

.pdf-capture-mode .live-hover,
.pdf-capture-mode [data-field].live-hover,
.pdf-capture-mode [data-item-index].live-hover {
  color: inherit !important;
  font-style: inherit !important;
  cursor: default !important;
  background: transparent !important;
  outline: none !important;
  min-height: 0 !important;
}

.pdf-capture-mode [contenteditable] {
  caret-color: transparent !important;
  outline: none !important;
  cursor: default !important;
}

/* --- Hide empty-field placeholder styling --- */
/* Covers both base and template-scoped .is-empty rules */
.pdf-capture-mode [data-field].is-empty,
.pdf-capture-mode .is-empty[data-field] {
  color: transparent !important;
  opacity: 0 !important;
}

.pdf-capture-mode img[data-field="logo"].is-empty {
  visibility: hidden !important;
}

/* --- Remove editor-injected controls --- */
.pdf-capture-mode .live-add-item-btn,
.pdf-capture-mode .live-add-item-row,
.pdf-capture-mode .live-item-delete,
.pdf-capture-mode .live-field-error {
  display: none !important;
}

/* --- Remove paper shadow (not part of the invoice content) --- */
.pdf-capture-mode.shadow-paper,
.pdf-capture-mode .shadow-paper {
  box-shadow: none !important;
  border-radius: 0 !important;
}

/* --- Ensure the template shell fills the capture container --- */
.pdf-capture-mode .template-shell {
  min-height: 1123px;
  overflow: visible !important;
}

/* --- Nuclear safety: never render brandline in PDF (handled by jsPDF) --- */
.pdf-capture-mode .template-brandline,
.pdf-capture-mode .template-mobile-brandline {
  display: none !important;
}

/* Keep capture CSS generic. Template-specific capture rules belong in the template. */
