.godo {
  --menu-item-font-size: 14px;
  --menu-item-height: calc( var(--menu-item-font-size) * 2);
}

.godo--editor {
  min-height: 10em;
  white-space: pre-wrap;
}

.godo--editor > :first-child {
  margin-top: 0;
}

/*
 * Menus
 */

.menuicons {
  font-size: var(--menu-item-font-size);
  position: relative;
  min-width: 2em;
  display: inline-flex;
}
.menuicon, .menuicon:hover {
  --border-width: 0px;
  padding: calc( var(--menu-item-height) / 4 - var(--border-width) ) .33em;
  color:  inherit;
  background-color: #fff;
  min-width: var(--menu-item-height);
  border: var(--border-width) none;
  color: inherit;
  font-family: sans-serif;
  line-height: 1;
}
.menuicon {
  font-weight: 500;
}
.menuicon:hover {
  color:  black;
}
.menuicon.active, .menuicon:active, .menuicon:disabled {
  color: #386EDE;
  background-color: #eee;
}

/* Blocks menu */
.godo-blocks-menu {
  position: sticky;
  top:  0;
  background-color: white;
}
.godo-blocks-menu .menuicon {
  --border-width: 1px;
  color: #555;
  background-color: white;
  border: var(--border-width) solid #eee;
}
.godo-blocks-menu .menuicon:hover {
  color:  black;
  border-color: #555;
}
.godo-blocks-menu .menuicon:disabled {
  background-color: #eee;
  color:  #aaa;
  opacity: 0.8;
}
.godo-blocks-menu .menuicon.active,
.godo-blocks-menu .menuicon:active {
  color: #386EDE;
  border-color: #386EDE;
}

/* Marks menu */
.godo-marks-menu {
  position: fixed;
  top: 0;
  left: 0;
}
.godo-marks-menu.fade {
  display: none;
}
.godo-marks-menu > .menuicons {
  padding-top: 14px;
  margin-left: -50%;
  display: inline-flex;
  border-color: #555;
}
.godo-marks-menu > .menuicons:before {
  content: "";
  display: block;
  position: absolute;
  margin: 0 auto;
  top: 0;
  bottom: auto;
  right: 0;
  left: 0;
  width: 0;
  height: 0;
  border: 7px solid transparent;
  border-bottom-color: #888;
}
.godo-marks-menu .menuicon {
  background-color: #3C3C33;
  color: white;
  border: 2px solid #888;
  border-radius: 0;
  text-transform: none;
}
.godo-marks-menu .menuicon:first-child {
  border-radius: 3px 0 0 3px;
}
.godo-marks-menu .menuicon:last-child {
  border-radius: 0 3px 3px 0;
}
.godo-marks-menu  .menuicon.active {
  background-color: #386EDE;
}
.godo-marks-menu  .menuicon:disabled {
  display: none;
}

.menuicon-b {
  font-weight: 900;
}
.menuicon-i {
  font-weight: 600;
  font-style: italic;
}
.menuicon-hh {
  font-variant: small-caps;
  font-weight: 900;
}
.menuicon-a {
  text-decoration: underline !important;
}


/*
 * Menu dialog
 */

/* dialog normalizer for polyfill */
dialog {
  position: fixed;
  left: 0; right: 0;
  width: -moz-fit-content;
  width: -webkit-fit-content;
  width: fit-content;
  height: -moz-fit-content;
  height: -webkit-fit-content;
  height: fit-content;
  margin: auto;
  border: solid;
  padding: 1em;
  background: white;
  color: black;
  display: block;
}
dialog:not([open]) {
  display: none;
}
dialog::backdrop,
dialog + .backdrop {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  background: rgba(0,0,0,0.3);
}
._dialog_overlay {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
}

.godo-dialog--menu {
  list-style: none;
  display: flex;
  flex-wrap:  wrap;
  justify-content: end;
  margin: 0;
  padding: 0;
}
.godo-dialog--menu button {
  text-transform: capitalize;
}
.godo-dialog--form p {
  margin-bottom: 1em;
}
.godo-dialog--form label {
  display:  block;
}
.godo-dialog--form label > * {
  width: 0;
  min-width: 100%;
  max-width: 100%;
}
.godo-dialog--menuitem:not(:last-child) {
  margin-right: 0.5em;
  margin-bottom: 0.5em;
}


/*
 * Editor typo
 */

div.godo .ProseMirror.godo--editor ul li p {
  margin: 0;
}
div.godo .ProseMirror.godo--editor a {
  text-decoration: underline;
}


/*
 * Editor is form widget
 */

.is-form-widget .godo--editor {
  border: 1px solid gray;
  background-color: white;
  padding: 1em;
  padding-bottom: 3em;
}

/*
 * Editor for HTML Element
 */
.html-edition {
  position: relative;
}
.html-edition .godo--editor {
  outline: none;
}
.html-edition.is-editable {
  --background-color: hsla(0, 0%, 100%, 0.5);
  --padding: 1em;
  outline: 1px solid;
  background-color: var(--background-color);
  margin: calc( -1 * var(--padding) );
  margin-top: calc( -1 * var(--menu-item-height) - var(--padding) );
  margin-bottom: 0;
  padding: var(--padding);
  padding-top: 0;
}
.html-edition.is-editable .godo--editor {
  padding-top: var(--padding);
}
.html-edition.is-editable .godo-blocks-menu {
  background-color: transparent;
}