@use 'variables' as *;

/*
 * Regenerate the Simplenote Tasks font with the following script.
 * Download the SVG task icons from the Simplecons repo
 *
 * // gen.js
 * const wfg = require('webfonts-generator');
 *
 * wfg({
 * 	files: [
 * 		'svg/task-unchecked.svg',
 * 		'svg/task-checked.svg'
 * 	],
 * 	dest: 'font/',
 * 	fontName: 'Simplenote Tasks',
 * 	types: ['woff'],
 * 	startCodepoint: 0xE000,
 * 	descent: 3, // needed to vertically align the tasks
 * }, () => {} );
 *
 * Once the script finishes copy the output here
 * ~$ node gen.js && cat font/Simplenote\ Tasks.woff | base64 | pbcopy
 */
@font-face {
  font-family: 'Simplenote Tasks';
  src: url('data:application/x-font-woff;charset=utf8-8;base64,d09GRgABAAAAAAQgAAsAAAAABrwAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAADsAAABUIIslek9TLzIAAAFEAAAAPwAAAFYpRjXwY21hcAAAAYQAAABPAAABfmBD5KlnbHlmAAAB1AAAAGAAAACINxFu0WhlYWQAAAI0AAAAMAAAADYV/A6waGhlYQAAAmQAAAAcAAAAJAAtABlobXR4AAACgAAAAAwAAAAMADAAAGxvY2EAAAKMAAAACAAAAAgAIABEbWF4cAAAApQAAAAeAAAAIAEPACJuYW1lAAACtAAAAT8AAAJzQ72hRHBvc3QAAAP0AAAAKgAAAEeHVaHleJxjYGRgYOBiMGCwY2BycfMJYeDLSSzJY5BiYGGAAJA8MpsxJzM9kYEDxgPKsYBpDiBmg4gCACY7BUgAeJxjYGQQYJzAwMrAwMDPIAAkmaE0NwMjAxsDAxMDKzMDVhCQ5prC4PCA4QEjg+j/v0CFogwglYwgOQC9ZgaRAHic7ZCxDYAwDATPiaFAjEFBwTBUzM8mydtmDF66k/7lysACdHEJB3swIrdWy72z5e4ceeOxvzaGTFjd001a+bOnz6+1+FNRnytoE7boCy0AeJxjYGJg+P+fQYxBiIGFQYSBwdxQVNnUXFmJTZZRRMya0cjMltFETZiPj48RCECEAB8fE4QFIhgYEPr5GUSB+tG0squbi5uLC8O1c7EwMrMzCiFM4GMFCjAxAAC/8AuCeJxjYGRgYADiawd0bOP5bb4ycDNIAEUYbidnHEXQ//8ziDEIAbkcDEwgUQA3/ArKeJxjYGRgYBD9/xdISjCAgBgDIwMqYAYAQWsCRQAAAAAAGAAAABgAAAAAAAAAIABEeJxjYGRgYGBmEGNgYgABEMkFhAwM/8F8BgAK7wEyAAB4nIWOy2rCQBSG/3grVWgLQrsrs2oXhXjZFFx2oeuquI860WiSCZNRELrvso/SJ3Dbt+ijFPqbHhCkYIZkvvNfDgFwgy94ODweGcIlXHD64zLpTrhCfhSuooFn4Rqu8SJcxxNehRto4o0bvMolFYUP4RKu8Clcpr4XrpC/hau4xY9wDfdeU7iOidcRbuDBex9FSRbr1DitxkG+zod6sYkDeyqfzhNt88ikquO3j1bhDHSqbeD0XE13Kt8uus6FKrQmUX2TOh3HRmXWrPTM+Uvnsl6rFYruz0yCESIkyBBDI4WB460wRoAca75Dzgts6AewZ9Pn/Alnyzuil9LpwEf739axMyjUQy8onDl7U+z4zbHlv3WpOoScQ2YMNyn0i/2HdMxjqGSFt6Iyo+5jWbQy9NDiCU/yPlPc9As0/naZAHicY2BiwA+YGZkYmRlZGPhKEouzdUvzkjNSk7NTU3jAXCiHgQEAqZ8KXQAA')
    format('woff2');
  unicode-range: U+E000-E001;
}

.note-detail-preview,
.note-content-plaintext.visible {
  padding: 0 calc((100% - 768px) / 2);
}

@media only screen and (width <= 1400px) {
  .note-detail-preview,
  .note-content-plaintext.visible {
    padding: 0 10%;
  }
}

/* Monaco adds the dir='ltr' attribute to rtl languages.
   This does the opposite of what you think it should do.
*/
span[dir='ltr'] {
  float: right;
  margin-right: calc(100% - 768px);
}

.is-line-length-full {
  .note-detail-preview,
  .note-content-plaintext.visible {
    padding: 0 25px;
  }

  span[dir='ltr'] {
    margin-right: 20px;
  }
}

@media only screen and (width <= 1400px) {
  span[dir='ltr'] {
    margin-right: 14%;
  }
}

.react-monaco-editor-container {
  .scrollbar.vertical {
    width: 10px !important;
    right: 0 !important;

    .slider {
      width: 10px !important;
    }
  }
}

// scrollbar search highlights
/* stylelint-disable-next-line selector-class-pattern */
.decorationsOverviewRuler {
  width: 10px !important;
  right: -2px !important;
}

.note-content-editor-shell,
.note-detail-markdown {
  color: var(--primary-color);
  height: 100%;
  width: 100%;
  font-family: 'Simplenote Tasks', $sans, sans-serif;

  .slider {
    border-radius: 10px;
    border: 3px solid gray;
  }

  .search-decoration {
    background-color: var(--search-highlight-color);
  }

  .selected-search {
    background-color: var(--search-selection-color);
    padding: 2px 0;
  }
}

/* Safari requires that it be displayed absolute so that it takes the full height
*/
.note-content-editor-shell {
  height: 100%;
  left: 0;
  position: absolute;
  top: 0;
  width: 100%;
}

.note-detail-textarea .note-content-editor-shell.cursor-pointer div {
  cursor: pointer;
}

.note-content-plaintext {
  display: none;
  font-size: 16px;
  white-space: pre-wrap;

  &.visible {
    display: inherit;
  }
}
