/* Quill's own picker only auto-labels its built-in 'serif'/'monospace' font values (quill.snow.css
   has ::before{content:...} rules just for those two) — without a matching rule here, any other
   value in printTemplateEditor.js's FONT_WHITELIST would show as a blank item in the dropdown. */
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="arial"]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="arial"]::before {
  content: "Arial";
  font-family: Arial, sans-serif;
}
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="times-new-roman"]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="times-new-roman"]::before {
  content: "Times New Roman";
  font-family: "Times New Roman", serif;
}
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="georgia"]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="georgia"]::before {
  content: "Georgia";
  font-family: Georgia, serif;
}
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="verdana"]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="verdana"]::before {
  content: "Verdana";
  font-family: Verdana, sans-serif;
}
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="courier-new"]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="courier-new"]::before {
  content: "Courier New";
  font-family: "Courier New", monospace;
}

/* Applies the actual font inside the editor once picked — same idea as quill.snow.css's own
   .ql-font-serif/.ql-font-monospace rules, just for the names added above. */
.ql-editor .ql-font-arial { font-family: Arial, sans-serif; }
.ql-editor .ql-font-times-new-roman { font-family: "Times New Roman", serif; }
.ql-editor .ql-font-georgia { font-family: Georgia, serif; }
.ql-editor .ql-font-verdana { font-family: Verdana, sans-serif; }
.ql-editor .ql-font-courier-new { font-family: "Courier New", monospace; }

/* Line-spacing picker: printTemplateEditor.js registers this format from scratch (Quill has no
   built-in one), so unlike the font picker above there's no default label at all to override —
   every value here, including the unset/default one, needs its own ::before rule or the dropdown
   shows blank items. */
/* Quill's own header/font/size pickers each get an explicit width in quill.snow.css — a custom
   picker like this one has none, and defaults too narrow to fit "По умолчанию" without clipping. */
.ql-snow .ql-picker.ql-lineheight {
  width: 130px;
}
.ql-snow .ql-picker.ql-lineheight .ql-picker-label::before,
.ql-snow .ql-picker.ql-lineheight .ql-picker-item::before {
  content: "По умолчанию";
}
.ql-snow .ql-picker.ql-lineheight .ql-picker-label[data-value="1"]::before,
.ql-snow .ql-picker.ql-lineheight .ql-picker-item[data-value="1"]::before {
  content: "1.0";
}
.ql-snow .ql-picker.ql-lineheight .ql-picker-label[data-value="1-15"]::before,
.ql-snow .ql-picker.ql-lineheight .ql-picker-item[data-value="1-15"]::before {
  content: "1.15";
}
.ql-snow .ql-picker.ql-lineheight .ql-picker-label[data-value="1-5"]::before,
.ql-snow .ql-picker.ql-lineheight .ql-picker-item[data-value="1-5"]::before {
  content: "1.5";
}
.ql-snow .ql-picker.ql-lineheight .ql-picker-label[data-value="2"]::before,
.ql-snow .ql-picker.ql-lineheight .ql-picker-item[data-value="2"]::before {
  content: "2.0";
}

/* Applies the actual spacing inside the editor once picked. */
.ql-editor .ql-lineheight-1 { line-height: 1; }
.ql-editor .ql-lineheight-1-15 { line-height: 1.15; }
.ql-editor .ql-lineheight-1-5 { line-height: 1.5; }
.ql-editor .ql-lineheight-2 { line-height: 2; }

/* quill.snow.css zeroes out every <p>'s margin (".ql-editor p,...{margin:0;padding:0}") to keep
   the editor looking like one continuous block of text. Print/preview never loads that stylesheet,
   so its <p> tags fall back to the plain browser default (roughly 1em top/bottom) instead — the
   same template looks tighter in the editor than what actually gets printed, and there was no way
   to see or control that spacing while editing. Restoring an explicit, equal margin here (loads
   after quill.snow.css, so it wins on equal specificity) makes the editor match what
   PrintTemplateRenderer.EditorCompatibilityStyles applies on the print/preview side — see that
   file for the matching rule, the two values must be kept in sync by hand, same as the font rules
   above. A paragraph typed with Shift+Enter (a soft line break within the same <p>, not a new one)
   still has no gap — that's the way to control/remove spacing between specific lines without
   touching this default. */
.ql-editor p { margin: 0 0 1em 0; }

/* Paragraph-spacing picker: lets a specific paragraph override the 1em default above (smaller or
   larger) — same registered-from-scratch format as the line-spacing picker, so it needs the same
   own-label treatment (no default label exists to override) and its own explicit picker width. */
.ql-snow .ql-picker.ql-pspacing {
  width: 130px;
}
.ql-snow .ql-picker.ql-pspacing .ql-picker-label::before,
.ql-snow .ql-picker.ql-pspacing .ql-picker-item::before {
  content: "По умолчанию";
}
.ql-snow .ql-picker.ql-pspacing .ql-picker-label[data-value="0"]::before,
.ql-snow .ql-picker.ql-pspacing .ql-picker-item[data-value="0"]::before {
  content: "0em";
}
.ql-snow .ql-picker.ql-pspacing .ql-picker-label[data-value="0-5"]::before,
.ql-snow .ql-picker.ql-pspacing .ql-picker-item[data-value="0-5"]::before {
  content: "0.5em";
}
.ql-snow .ql-picker.ql-pspacing .ql-picker-label[data-value="1"]::before,
.ql-snow .ql-picker.ql-pspacing .ql-picker-item[data-value="1"]::before {
  content: "1em";
}
.ql-snow .ql-picker.ql-pspacing .ql-picker-label[data-value="1-5"]::before,
.ql-snow .ql-picker.ql-pspacing .ql-picker-item[data-value="1-5"]::before {
  content: "1.5em";
}
.ql-snow .ql-picker.ql-pspacing .ql-picker-label[data-value="2"]::before,
.ql-snow .ql-picker.ql-pspacing .ql-picker-item[data-value="2"]::before {
  content: "2em";
}

/* Applies the actual spacing inside the editor once picked — a two-class selector (.ql-editor
   .ql-pspacing-0) beats the single-class default rule above regardless of stylesheet order. */
.ql-editor .ql-pspacing-0 { margin-bottom: 0; }
.ql-editor .ql-pspacing-0-5 { margin-bottom: 0.5em; }
.ql-editor .ql-pspacing-1 { margin-bottom: 1em; }
.ql-editor .ql-pspacing-1-5 { margin-bottom: 1.5em; }
.ql-editor .ql-pspacing-2 { margin-bottom: 2em; }
