//GENERAL
label {
  color: $black;
  font-family: $serviceFont;
  max-width: 100%;
  @extend .small;
  @extend .thick;
  @extend .letter-spacing-2;
  margin-bottom: 0.3em;
}

input,
textarea,
select {
  display: block;
  line-height: initial;
  padding: 7.5px 15px 7.5px 15px;
  margin:auto;//<= fixes https://github.com/presscustomizr/customizr/issues/1784
  border: 1px solid $grey-light;
  border-radius: 2px;
  max-width: 100%;
  font: inherit;
  font-weight: normal;
  //top, left, blur, color, inset, spread
  @include box-shadow( 0px, 2px, 1px, rgba(0, 0, 0, 0.025), true );
  @include transition ( border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s );

}

// adapt for search Gutenberg block
// fixes [Search form] gutenberg search block style is broken #1838
.wp-block-search__input {
  margin: 0;
}

input:focus,
textarea:focus,
select:focus {
  // outline: 0; <= for https://github.com/presscustomizr/customizr/issues/1771
  border-style: solid;
}

input[type=checkbox],
input[type=radio] {
  display: inline-block;
  font-size: 1em;
  margin: 0;
  padding: 0.5em;
  text-align: center;
  line-height: normal;
  vertical-align: middle;
}

input[type=number] {
  @extend .small;
  @if ( true == $is_rtl ) {
    padding-left: 4px;
    padding-right: 8px;
  }
  @else {
    padding-right: 4px;
    padding-left: 8px;
  }
}
//Theme specific style for some input elements
//to avoid plugin conflicts
//see https://github.com/presscustomizr/customizr/issues/1487
.themeform {
  select{
    &::-ms-expand {
      display: none;
    }
    &:not([multiple]) {
      -moz-appearance: none!important;
      -webkit-appearance: none!important;
      background-image: url("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IiB3aWR0aD0iNTBweCIgaGVpZ2h0PSIyMHB4IiB2aWV3Qm94PSIwIDAgNTAgMjAiIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDUwIDIwIiB4bWw6c3BhY2U9InByZXNlcnZlIj48cGF0aCBkPSJNMjIuNiw4YzAtMC4xLDAtMC4yLDAuMS0wLjJsMC41LTAuNWMwLjEtMC4xLDAuMS0wLjEsMC4yLTAuMWMwLjEsMCwwLjIsMCwwLjIsMC4xbDMuNywzLjdsMy43LTMuN2MwLjEtMC4xLDAuMS0wLjEsMC4yLTAuMXMwLjIsMCwwLjIsMC4xTDMyLDcuOEMzMiw3LjksMzIuMSw4LDMyLjEsOGMwLDAuMSwwLDAuMi0wLjEsMC4ybC00LjQsNC40Yy0wLjEsMC4xLTAuMSwwLjEtMC4yLDAuMXMtMC4yLDAtMC4yLTAuMWwtNC40LTQuNEMyMi43LDguMiwyMi42LDguMSwyMi42LDh6Ii8+PC9zdmc+");
    }
    @if ( true == $is_rtl ) {
      padding-left: 30px;
      background-position: -7.5px center;
    }
    @else {
      padding-right: 30px;
      background-position: calc( 100% + 7.5px ) center;
    }
    background-repeat: no-repeat;
    @include box-shadow_none( 'important' );
  }
  @at-root .themeform input[type=radio],
  .themeform input[type=checkbox],
  .comment-form-cookies-consent input[type=checkbox] {
    -webkit-appearance: none!important;
    position: relative !important;
  }
  @at-root .themeform input[type=radio]:checked::before,
  .themeform input[type=checkbox]:checked::before,
  .comment-form-cookies-consent input[type=checkbox]::before {
    font-family: 'Font Awesome\ 5 Free';
    -moz-osx-font-smoothing: grayscale;
    -webkit-font-smoothing: antialiased;
    font-style: normal;
    font-variant: normal;
    text-rendering: auto;
    margin: auto;
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
  }

  input[type=radio] {
    border-radius: 50%;
  }
  input[type=radio]:checked::before {
    content: "";
    border-radius: 100%;
    width: 50%;
    height: 50%;
  }
  @at-root .themeform input[type=checkbox]:checked::before,
  .comment-form-cookies-consent input[type=checkbox]:checked::before {
    content: "\f00c";
    font-weight: 900;
  }
  input[type="search"] {
    @include box-sizing(border-box);
    -webkit-appearance: none;
  }
}//end themeform

.comment-form-cookies-consent {
  label {
    display: inline;
    @if ( true == $is_rtl ) {
      padding-right: 5px;
    }
    @else {
      padding-left: 5px;
    }
  }
  input[type="checkbox" ] {
    margin-top: -.2em;
    border-color: $grey;
  }
}

input[type="file"],
input[type="range"] {
  background-color: transparent !important;
  padding: 0;
  border: 0;
  @include box-shadow_none();
  width: auto;
}

textarea {
  width: 100%;
}

select {
  max-width: 100%;
  // previously was min-width: 100%;
  // changed to fix the issue https://github.com/presscustomizr/customizr/issues/1636
  width: 100%;
  text-overflow: initial;
  outline: none;
}


//.czr-form is used for the search form
//and the comment reply
form.czr-form {
  &.search-form {
    .form-group {
      display: -webkit-box;
      display: -ms-flexbox;
      display: flex;
    }
    label {
      @include clearfix;
      position: relative!important;
      // width: calc(75% - 5px);
      margin-right: 5px;
      -webkit-box-flex:1;
      -ms-flex:1;
      flex:1;

      input {
        padding-left: 26px;
        line-height: 30px;
        width: 100%;
      }

    }//label
    button[type=submit] {
      padding: 0 10px;
      font-weight: 600;
      @extend .small;
      display: inline-block;
      cursor: pointer;
      -webkit-border-radius: 3px;
      border-radius: 3px;
      line-height: 31px;
      font-size: 15px;
      height: 35px;
      text-transform: none;
      // width: 25%;
      &:hover {
        background-color: white;
      }
    }

    @at-root .czr-overlay .overlay-content .search__wrapper {
      label input {
        line-height: 40px;
      }
      button[type=submit] {
        font-size: 16px;
        line-height: 44px;
        height: 45px;
        padding: 0px 14px;
      }
    }
  }//.search-form



  label {
    @extend .caps;
    font-size: ms(0);
    i {
      @if ( true == $is_rtl ) {
        float: left;
        text-align: left;
      }
      @else {
        float: right;
        text-align: right;
      }
      width: 2em;
      height: 2em;

      &::before {
        margin: 0;
      }
    }
  }


  input:not([type='submit']):not([type='button']):not([type='number']):not([type='checkbox']):not([type='radio']), textarea {
    // outline: none; <= for https://github.com/presscustomizr/customizr/issues/1771
    border: none;
    border-bottom: 2px solid $black;
    padding: 0 0 2px;
    color: #202020;
    position: relative;
    @include box-shadow_none;
    width: 100%;
    background: transparent;
    #czr-comments & {
      background: #fff;
      padding: 0.5rem;
    }
  }
  fieldset {
    margin-top: 3em
  }

  .czr-focus {

    position: relative;
    margin-top: $base-line-height*2;

    label {
        display: block;
        position: absolute;
        z-index: 1;
        color: $grey-mid-light;
        @include transition-transform(0.3s ease);
        span {
          @if ( true == $is_rtl ) {
              float: right;
          }
          @else {
              float: left;
          }
        }
        #czr-comments & {
          padding: 0.5rem;
        }
    }
    &:not(.in-focus) label {
      cursor: pointer;
    }

    .czr-focusable {
      @include transition(all 600ms);
    }
    &:not(.in-focus) > .czr-focusable {
      color: transparent;
    }

    &.in-focus > label {
      z-index: 1;
      @include transform(translateY(-110%));
      color: $grey;

      /* search form */
      i.icn-search {
        @include opacity(0);
      }
      i.icn-close {
        @include opacity(1);
        @include transform(translateY(110%));
        cursor: pointer;
      }
    }
  }

}//form.czr-form

/* search form */
.czr-search-field {
  &::-ms-clear {
      display: none;
  }
  @if ( true == $is_rtl ) {
      padding-left: 2em;
  }
  @else {
      padding-right: 2em;
  }
}
// hack to remove webkit autofill background
// https://stackoverflow.com/a/37432260
// which is particularly annoying when clicking the close icon in our search form
@-webkit-keyframes autofill {
   to {
       background: transparent;
       color: inherit;
   }
}
.czr-search-field:-webkit-autofill {
 -webkit-animation-name: autofill;
 -webkit-animation-fill-mode: both;
}
