/* Colours of C syntax highlighting (static/js/zvyraznenie_dom.js): the classes .zv-<kind> on <span>s inside code blocks of the lessons, the
   locked parts of the editor and the overlay of the editor (the textarea over its coloured copy). The overlay is here and
   not in interakcie/editor_c.css on purpose: a test (test_vlastnici_vstupneho_riadka_...) forbids `caret-color` and `text-indent` in
   that file, where only the console's input line may be tuned, and the overlay needs both for the code window. Colours only from the --zv-* tokens (tokeny.css); the dark theme follows them.
   Colour alone carries the kinds in the editor overlay (no weight or slant there, so the overlay stays glyph-for-glyph as wide as the textarea). */

.zv-direktiva { color: var(--zv-direktiva); }
.zv-klucove { color: var(--zv-klucove); }
.zv-retazec { color: var(--zv-retazec); }
.zv-escape, .zv-format { color: var(--zv-specialny); }
.zv-cislo { color: var(--zv-cislo); }
.zv-komentar { color: var(--zv-komentar); }

/* in a lesson and in the locked parts the keywords are also bold (no italics: the mono font has none, a slanted fake looks bad) */
.content pre:not(.ec-zvyraznenie) .zv-klucove { font-weight: 700; }

/* ---- the overlay of the editor ---- */
/* The overlay of the colouring: the coloured copy (.ec-zvyraznenie) and the textarea sit in one grid cell, the textarea on top with
   transparent text, so only its caret and selection show. Both have the same font, line height, tab size, padding and
   white-space, which makes the letters lie on each other; the copy only has colour (no bold, no italics), so no glyph can be wider than
   in the textarea. The textarea is the one that scrolls sideways (its own scrollbar, no wrapping), the browser keeps the caret in view;
   the script copies its scrollLeft to --ec-posun (on .ec-okno) and the copy is shifted by that much. Vertically nothing scrolls. */
.ec .ec-okno .ec-pole-obal { display: grid; grid-template-columns: minmax(0, 1fr); background: var(--bg); }
.ec .ec-okno .ec-pole, .ec .ec-okno .ec-zvyraznenie {
  grid-area: 1 / 1; box-sizing: border-box; margin: 0; padding: 0 var(--s-3); border: 0; border-radius: 0;
  font: inherit; white-space: pre; tab-size: 4; letter-spacing: normal; word-spacing: normal; text-indent: 0; text-align: start;
}
.ec .ec-okno .ec-zvyraznenie { min-width: 0; overflow: hidden; background: none; color: var(--text); pointer-events: none; user-select: none; }
.ec .ec-okno .ec-zvyraznenie { position: relative; }
.ec .ec-okno .ec-mierka { position: absolute; visibility: hidden; }
.ec .ec-okno .ec-zvyraznenie code { display: block; width: max-content; font: inherit; transform: translateX(calc(-1 * var(--ec-posun, 0px))); }
.ec .ec-okno .ec-pole {
  position: relative; display: block; width: 100%; min-height: 0;
  outline: 0; background: transparent; color: transparent; caret-color: var(--text); resize: none; scroll-padding-right: 3ch; overflow-x: auto; overflow-y: hidden;
}
.ec .ec-okno .ec-pole:focus { background: transparent; }
.ec .ec-okno .ec-pole::selection { background: var(--zv-vyber); color: transparent; }

/* Printing and forced colours (high contrast): the transparent text of the textarea would print blank, and two copies of the text
   would show on top of each other; so the coloured copy is dropped and the textarea shows its own text in the system colour. */
@media print, (forced-colors: active) {
  .ec .ec-okno .ec-zvyraznenie { display: none; }
  .ec .ec-okno .ec-pole { color: CanvasText; }
  .ec .ec-okno .ec-pole::selection { background: Highlight; color: HighlightText; }
}
