/*!
 * Copyright © [Alinkeo, LLC] [2024].
 * All rights reserved. Unauthorized copying, distribution, or modification of this code is strictly prohibited.
 */

/********************************************************/
/* Prosemirror related CSS from the prosemirror css at  */
/* https://prosemirror.net/css/editor.css at            */
/*******************************************************/

/* This file is intended to make style changes to the ProseMirror editor */

:root {
  /**
  #ccd4d8
  #e5e9eb
  #e0e5e7
  #eff2f3
  */
  font-size: 14pt;
  --editor-bg-color: #e5e9eb;
  --margin-for-line-number-border: 7.5px;
  /* --editor-width: calc(8.5in + 30px + 2ch + var(--margin-for-line-number-border)); */
  --editor-width: 80ch;
}

#editor>.ProseMirror {
  padding-right: 0 !important;
}

.ProseMirror {
  position: relative;
  word-wrap: break-word;
  white-space: pre-wrap;
  white-space: break-spaces;
  -webkit-font-variant-ligatures: none;
  font-variant-ligatures: none;
  font-feature-settings: "liga"0;
  /* the above doesn't seem to work in Edge */
  /* the following is for the ACR */
  /* border: 0px solid hsl(0, 0%, 80%); */
  line-height: 1;
  /* Sets line height for 50 lines */
  font-family: "Courier New, Courier, monospace";
  font-size: 14pt;
  margin-top: 0px;
  margin-bottom: 0px;
  padding-top: 0px !important;
  padding-bottom: 0px !important;
  padding-left: 0ch;
  /*
  text-indent: 4ch;
  line-height: 2;
  padding-top: 20px;
  */
}

.ProseMirror pre {
  white-space: pre-wrap;
}

.ProseMirror li {
  position: relative;
}

.ProseMirror-hideselection *::selection {
  background: transparent;
}

.ProseMirror-hideselection *::-moz-selection {
  background: transparent;
}

.ProseMirror-hideselection {
  caret-color: transparent;
}

/* See https://github.com/ProseMirror/prosemirror/issues/1421#issuecomment-1759320191 */
.ProseMirror [draggable][contenteditable=false] {
  user-select: text
}

.ProseMirror-selectednode {
  outline: 2px solid #8cf;
}

/* Make sure li selections wrap around markers */

li.ProseMirror-selectednode {
  outline: none;
}

li.ProseMirror-selectednode:after {
  content: "";
  position: absolute;
  left: -32px;
  right: -2px;
  top: -2px;
  bottom: -2px;
  border: 2px solid #8cf;
  pointer-events: none;
}

/* Protect against generic img rules */

img.ProseMirror-separator {
  display: inline !important;
  border: none !important;
  margin: 0 !important;
}

.ProseMirror-textblock-dropdown {
  min-width: 3em;
}

/*******************************************/
/* Prosemirror related CSS specific to acr */
/*******************************************/

/* Default styling for all acrProceedings and acrSpeakerLabels */
.acrpro,
.acrsl {
  font-family: "Courier New", Courier, monospace;
  font-size: 14pt;
  line-height: 2;
  margin-top: 0px !important;
  margin-bottom: 0px !important;
  padding-top: 0px !important;
  padding-bottom: 0px !important;
  padding-left: 0ch;
  margin-top: 0px;
  margin-bottom: 0px;
  scroll-margin: 0;
  scroll-snap-align: start;
  scroll-snap-type: both mandatory;
  text-align: left;
  text-indent: 0ch;
}

/* Interaction-specific styling adjustments */
.acrpro.co {
  text-indent: 5ch;
  margin-left: calc(15ch + var(--margin-for-line-number-border));
}

.acrpro.ex {
  text-indent: 5ch;
  margin-left: calc(10ch + var(--margin-for-line-number-border));
}

.acrpro.uf,
.acrpro.by,
.acrpro.rn {
  text-indent: 0ch;
  margin-left: calc(5ch + var(--margin-for-line-number-border));
}

.acrpro.ti {
  text-align: center !important;
}

.align-left {
  text-align: left;
}

.align-right {
  text-align: right;
}

.align-center {
  text-align: center;
}

.ProseMirror:first-child {
  scroll-margin: 20px !important;
}

.ProseMirror:focus {
  outline: none;
}

.button-group-toolbar sl-button-group:not(:last-of-type) {
  margin-right: var(--sl-spacing-x-small);
  margin-left: 60px;
}

/* Remove the border around .editor-column and #editor */
.editor-column,
#editor {
  scroll-margin: 0;
  scroll-snap-align: start;
  scroll-snap-type: both mandatory;
  border: none;
  padding-top: 0px;
  padding-right: 0px;
  margin-right: 0px;
  padding-bottom: 0px;
}


/* Container to hold both columns */
.container {
  display: flex;
  align-items: stretch;
  border: 1x solid black;
  /* Adjust thickness and color as desired */
  border-radius: 6px;
  /* Optional: Adds rounded corners to the border */
  margin-left: 20px;
  /* Adds space between left border and outer content of container */
  margin-right: 10px;
  /* Adds space between right border and outer content of container */
  padding-top: 0px;
  /* Adds space between top border and inner content of container */
  width: var(--editor-width);
  /* Width of 8.5 inches for portrait aspect ratio */
  height: 11in;
  /* Height of 11 inches */
  max-height: 200vh;
  /* Allows the editor to grow vertically with scrolling */
  max-width: 90vw;
}

/* Style the number column */
.number-column {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  font-family: "Courier New", Courier, monospace;
  font-size: 14pt;
  line-height: 2em;
  /* Sets line spacing for 25 lines */
  height: 100%;
  /* Match the editor height */
  margin-right: 0px;
  background-color: var(--editor-bg-color);
  /* Light gray background */
  padding-right: 20px;
  padding-left: 20px;
  padding-top: 0px;
  padding-bottom: 0px;
}

/* Style each number in the column */
.number-column .numbers-column {
  /* flex-grow: 1; */
  text-align: right;
  line-height: 2em;
  margin-top: 0px;
  margin-bottom: 0px;
  padding-top: 0px;
  padding-bottom: 0px;
  font-family: "Courier New", Courier, monospace;
  font-size: 14pt;

}

/* Style the editor column */
.editor-column {
  flex-grow: 1;
  /* width: 7.5in; /* Width of 8.5 inches for portrait aspect ratio */
  height: 100%;
  /* Height of 11 inches */
  /* max-height: 200vh; /* Allows the editor to grow vertically with scrolling */
  /* max-width: 90vw;
    overflow-y: scroll; /* Allow vertical scrolling */
  overflow-x: hidden;
  /* Hide horizontal overflow */
  border: 1px solid #ccc;
  padding-left: 0px;
  /* Add padding for text in editor */
  padding-right: 0px;
  margin-right: 0px;
  padding-top: 20px;
  padding-bottom: 0px;
  font-family: "Courier New", Courier, monospace;
  font-size: 14pt;
}

/* Adding the default styling for h1-h6 to fix what Bulma's stylesheet breaks. */
h1 {
  display: block;
  font-size: 2em;
  margin-top: 0.67em;
  margin-bottom: 0.67em;
  margin-left: 0;
  margin-right: 0;
  font-weight: bold;
}

h2 {
  display: block;
  font-size: 1.5em;
  margin-top: 0.83em;
  margin-bottom: 0.83em;
  margin-left: 0;
  margin-right: 0;
  font-weight: bold;
}

h3 {
  display: block;
  font-size: 1.17em;
  margin-top: 1em;
  margin-bottom: 1em;
  margin-left: 0;
  margin-right: 0;
  font-weight: bold;
}

h4 {
  display: block;
  margin-top: 1.33em;
  margin-bottom: 1.33em;
  margin-left: 0;
  margin-right: 0;
  font-weight: bold;
}

h5 {
  display: block;
  font-size: .83em;
  margin-top: 1.67em;
  margin-bottom: 1.67em;
  margin-left: 0;
  margin-right: 0;
  font-weight: bold;
}

h6 {
  display: block;
  font-size: .67em;
  margin-top: 2.33em;
  margin-bottom: 2.33em;
  margin-left: 0;
  margin-right: 0;
  font-weight: bold;
}