/* -------------------------------------------------------------------------------------------------
  Formtastic style fully customized
--------------------------------------------------------------------------------------------------*/

.formtastic {
  fieldset {
    > ol,
    > ul {
      margin:0;
      padding:0;
      list-style:none;
    }
  }

  legend {
    white-space:normal;
    font-size:1.3em;
    margin-top:2em;
    margin-bottom:0.5em;
    text-transform: uppercase;
    color: inherit;

    &::before {
      content: " ";
      width:8px;
      height:8px;
      display: inline-block;
      background: var(--color-form-legend);
      margin-right: 0.5em;
      vertical-align: center;

    }
  }


  /* SEMANTIC ERRORS
  --------------------------------------------------------------------------------------------------*/
  .errors {
    color: var(--color-error-form);
    margin:0.5em 0 1.5em 25%;
    list-style:square;

    li {
      padding:0;
      border:none;
      display:list-item;
    }
  }


  /* BUTTONS & ACTIONS
  --------------------------------------------------------------------------------------------------*/
  .buttons,
  .actions {
    padding-left:25%;

    > ol {
      display:flex;
    }
  }

  .button,
  .action {
    padding-right:0.5em;
  }

  .button_action button {
    padding:3px 8px;
  }

  .link_action a {
    display:block;
    padding:3px 0;
  }


  /* INPUTS
  --------------------------------------------------------------------------------------------------*/
  .inputs {
  }

  .input {
    padding:0.5em 0; /* padding and negative margin juggling is for Firefox */
    margin-top:-0.5em;
    margin-bottom:1em;

    /* LEFT ALIGNED LABELS
    --------------------------------------------------------------------------------------------------*/
    .label {
      display:block;
      margin-bottom:0.2em;
    }

    /* INLINE HINTS
    --------------------------------------------------------------------------------------------------*/
    .inline-hints {
      color: var(--color-text-subtle);
      margin:0.5em 0 0 25%;
    }
  }

  /* NESTED FIELDSETS AND LEGENDS (radio, check boxes and date/time inputs use nested fieldsets)
  --------------------------------------------------------------------------------------------------*/

  .choice {
    padding:0;
    border:0;
    margin:0.1em 0 0.5em 0;

    label {
      width:100%;
      line-height:100%;
      padding-top:0;
      margin-bottom:0.6em;

      /* ADJUSTMENTS FOR INPUTS INSIDE LABELS (boolean input, radio input, check_boxes input)
      --------------------------------------------------------------------------------------------------*/
      input {
        margin:0 0.3em 0 0.1em;
        line-height:100%;
      }
    }
  }


  /* INLINE ERRORS
  --------------------------------------------------------------------------------------------------*/
  .inline-errors {
    margin:0;
    color: var(--color-error-form);
  }


  /* STRING, NUMERIC, PASSWORD, EMAIL, URL, PHONE, SEARCH (ETC) OVERRIDES
  --------------------------------------------------------------------------------------------------*/
  .stringish input {
    width:calc(100% - 50px);

    &[size],
    &[max] {
      width:auto;
      max-width:72%;
    }
  }


  /* TEXTAREA OVERRIDES
  --------------------------------------------------------------------------------------------------*/
  .text textarea {
    width:72%;

    &[cols] {
      width:auto;
      max-width:72%;
    }
  }


  /* HIDDEN OVERRIDES
  --------------------------------------------------------------------------------------------------*/
  .hidden {
    display:none;
  }


  /* BOOLEAN LABELS
  --------------------------------------------------------------------------------------------------*/
  .boolean label {
    margin-left:25%;
    display:block;

    /* ADJUSTMENTS FOR INPUTS INSIDE LABELS (boolean input, radio input, check_boxes input) */
    input {
      margin:0 0.3em 0 0.1em;
      line-height:100%;
    }
  }


  /* FRAGMENTED INPUTS (DATE/TIME/DATETIME)
  --------------------------------------------------------------------------------------------------*/
  .fragments {
    position:relative;
  }

  .fragments-group {
    display:flex;
    width:74%;
    margin:0 0 0 25%;
    padding:0;
  }

  .fragment {
    width:auto;
    margin:0 .3em 0 0;
    padding:0;
    border:0;

    label {
      display:none;

      input {
        display:inline;
        margin:0;
        padding:0;
      }
    }
  }
}


/* Lexxy disable some button that we cant disable with config */
lexxy-highlight-dropdown,
[data-command="insertCodeBlock"],
[data-command="insertTable"] {
  display: none !important;
}
