/*
 * Contrato visual único del editor: esta hoja se carga en la aplicación y se
 * incrusta sin modificaciones en Chromium al exportar. Cambiar tipografía o
 * métricas aquí cambia, a la vez, la pantalla y el PDF.
 */
:root {
  --editor-a4-height: 297mm;
  --editor-page-gap: 14px;
  --page-gap-fill: #cfd9ea;
  --page-rule-color: #7f97bb;
}

.lex-editor-document {
  box-sizing: border-box;
  color: #111827;
  font-family: Arial, "Liberation Sans", sans-serif;
  font-size: 12pt;
  font-synthesis: weight style;
  line-height: 1.55;
  overflow-wrap: anywhere;
  tab-size: 4;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.rich-document-page {
  position: relative;
  width: 210mm;
  min-height: 297mm;
  margin: 0 auto;
  padding: 25mm 24mm;
  overflow-anchor: none;
  outline: 0;
  background-color: #fff;
  background-image: linear-gradient(to bottom,
    #fff 0,
    #fff calc(var(--editor-a4-height) - 1px),
    var(--page-rule-color) calc(var(--editor-a4-height) - 1px),
    var(--page-rule-color) var(--editor-a4-height),
    var(--page-gap-fill) var(--editor-a4-height),
    var(--page-gap-fill) calc(var(--editor-a4-height) + var(--editor-page-gap))
  );
  background-size: 100% calc(var(--editor-a4-height) + var(--editor-page-gap));
  background-repeat: repeat-y;
  box-shadow: 0 8px 32px rgba(15, 23, 42, .18);
}

.editor-page-number-preview {
  position: absolute;
  left: 24mm;
  right: 24mm;
  height: 7mm;
  z-index: 2;
  pointer-events: none;
  user-select: none;
  color: #64748b;
  font: 9pt/7mm Arial, "Liberation Sans", sans-serif;
}
.editor-page-number-left { text-align: left; }
.editor-page-number-center { text-align: center; }
.editor-page-number-right { text-align: right; }

.lex-editor-document p { margin: 0 0 9pt; }
.lex-editor-document h1 { margin: .65em 0 .4em; font-size: 24pt; }
.lex-editor-document h2 { margin: .65em 0 .4em; font-size: 18pt; }
.lex-editor-document h3 { margin: .65em 0 .4em; font-size: 14pt; }
/*
 * Word y LibreOffice usan a veces <blockquote> como simple bloque sangrado.
 * No le aplicamos decoracion propia: cualquier borde/color debe proceder del
 * documento, nunca ser inventado por LEXpedientes.
 */
.lex-editor-document blockquote {
  margin: 1em 2em;
  padding: 0;
  border: 0;
  color: inherit;
}
.lex-editor-document .editor-tab {
  display: inline-block;
  width: 3.5em;
  min-width: 3.5em;
}
.lex-editor-document .editor-table,
.lex-editor-document table {
  width: 100%;
  margin: 1em 0;
  border-collapse: collapse;
}
.lex-editor-document td,
.lex-editor-document th {
  min-width: 40px;
  padding: 6px;
  border: 1px solid #94a3b8;
  vertical-align: top;
}
.lex-editor-document img { max-width: 100%; height: auto; }

@page { size: A4 portrait; margin: 25mm 24mm; }

html:has(.lex-editor-pdf-body),
.lex-editor-pdf-body {
  margin: 0;
  padding: 0;
  background: #fff;
}
.lex-editor-pdf-document {
  width: auto;
  min-height: 0;
  margin: 0;
  padding: 0;
}
.lex-editor-pdf-document .editor-print-page-break {
  display: block;
  height: 0;
  margin: 0;
  padding: 0;
  break-before: page;
  page-break-before: always;
}

