/*--------------------------------------------------------------
Misc.
--------------------------------------------------------------*/

#poststuff .cmb-repeatable-group h2 {
  margin: 0;
}

.edit-tags-php,
.profile-php,
.user-edit-php {
  .cmb2-metabox-title {
    font-size: 1.4em;
  }
}

.cmb2-options-page {
  .cmb2-metabox-title {
    font-size: 1.3em;
    margin: 1em 0;
    + p.cmb2-metabox-description {
      margin-top: -1.6em;
      margin-bottom: .8em;
    }
  }
}

.postbox .cmb-spinner {
  float: left;
}









////////////////////
// Custom pxg styles
////////////////////

#postbox-container-2 {
  opacity: 0;

  transition: .3s opacity ease-in;

  .is--loaded & {
    opacity: 1;
  }

  .inside {
    margin-top: 0;
    padding: 30px;
  }

  .cmb-type-title {
    margin: 0 -30px;
    padding-top: 20px;
    padding-bottom: 8px;
    padding-left: 30px;
    padding-right: 30px;
    border-top: 2px solid #EEEEEE;
  }
}

// Various styles
.cmb-row {
  color: $light-gray;
}

.option-details {
  display: block;
  color: $light-gray;
  line-height: 1.5;
  margin-top: 10px;
}

.note {
  margin-top: 30px;
  display: block;
}

.font-loading-section {
  .cmb-row {
    margin: 0 -30px;
    padding: 0 30px;

    background-color: #FCFCFC;

    &:nth-child(n-1),
    &:nth-child(n) {
      padding-bottom: 36px;
      border-bottom: 0;
    }
  }
}

.cmb2-wrap {
  p:last-of-type {
    margin-bottom: 0;
  }

  input[type="text"],
  textarea {
    padding: 12px 12px;

    border-radius: 4px;
    box-shadow: none;

    color: $gray;
  }

  textarea.cmb2-textarea-code.cmb2-textarea-code {
    font-family: "Anonymous Pro", serif;
  }

  input[type="text"],
  textarea {
    &:focus {
      background-color: white;
      //border: 1px solid #DDDDDD;
    }
  }


  input[disabled],
  input[readonly="readonly"] {
    &, &focus {
      background-color: #F1F1F1;
    }
  }

  input[type=radio],
  input[type=checkbox] {
    width: 24px;
    height: 24px;

    margin-right: 10px;
    min-width: 24px;

    border: 1px solid #DDDDDD;

    box-shadow: none;

    &:focus {
      box-shadow: none;
    }
  }

  input[type=radio]:checked {
    border: 1px solid #76C6EC;

    &:before {
      width: 16px;
      height: 16px;
      margin: 3px;

      background-color: #76C6EC;
    }
  }

  input[type=checkbox] {
    border-radius: 2px;

    &:checked {
      border: 1px solid #76C6EC;
      background: #76C6EC;

      &:before {
        color: white;
        margin: 0;
      }
    }
  }
}

ul.cmb2-radio-list {
  margin-bottom: -30px;

  li {
    display: flex;

    input {
      margin-right: 3px;
    }

    label {
      margin-top: 5px;
    }
  }
}

.postbox-container .cmb2-id-fonto-font-source {
  margin-bottom: 0;
}





// Fonts Loading, Fonts Matching icons
.cmb2-id-fonto-fonts-loading-embed-code .cmb2-metabox-title:before,
.cmb2-id-fonto-weights-styles-matching .cmb2-metabox-title:before {
  content: "";

  display: inline-block;
  vertical-align: middle;

  margin-right: 14px;

  background: center center no-repeat;
  background-size: 100% 100%;
}

.cmb2-id-fonto-fonts-loading-embed-code .cmb2-metabox-title:before {
  width: 23px;
  height: 24px;
  margin-top: -3px;

  background-image: url("../../images/loading-icon.svg");
}

.cmb2-id-fonto-weights-styles-matching .cmb2-metabox-title:before {
  width: 34px;
  height: 27px;

  background-image: url("../../images/matching-icon.svg");
}

#fonto_url_path {
  font-weight: 500;
  font-style: italic;

  &, &:focus, &:active {
    background-color: #F1F1F1;
  }
}





// Webfont Service embed code textarea
.cmb2-id-fonto-embed-code-font-service,
.cmb2-id-fonto-embed-code-self-hosted {
  .cmb2-textarea-code {
    margin: 25px 0 5px 0;
    min-height: 150px;
  }
}





// Self hosted fonts
.cmb2-id-fonto-font-files {
  .cmb-td {
    position: relative;
    text-align: center;
  }

  .cmb2-upload-button {
    position: absolute;
    top: 50%;
    left: 50%;

    transform: translateX(-50%) translateY(-50%);

    padding-top: 50px;
    height: 100px;

    border: 1px solid transparent;
    background: url('../../images/add-fonts-button.png') center 10px no-repeat;
    background-color: transparent;
    box-shadow: none;

    transition: background-color .15s ease-in-out;

    &:hover,
    &:active,
    &:focus {
      box-shadow: none;
      border: 1px solid #F2F2F2;
      background: url('../../images/add-fonts-button.png') center 10px no-repeat;
      background-color: #F7F7F7;
      transform: translateX(-50%) translateY(-50%);
    }
  }

  .cmb-attach-list {
    min-height: 130px;
    padding: 12px 20px;

    border: 1px dashed $borders;
    border-radius: 4px;

    font-size: 13px;
    text-align: left;

    background-color: white;

    li {
      margin-bottom: 10px;
      font-size: 13px;
      color: $gray;

      &, strong {
        font-weight: 100;
      }

      &:last-child {
        margin-bottom: 0;
      }
    }
  }

  //.edit-fonts-icon {
  //  display: none;
  //
  //  &, &:before {
  //    position: absolute;
  //    top: 50%;
  //    left: 50%;
  //
  //    z-index: 1;
  //
  //    transform: translateX(-50%) translateY(-50%);
  //  }
  //
  //  pointer-events: none;
  //  color: #000000;
  //
  //  &:before {
  //    content: "\f464";
  //    display: block;
  //    font-size: 50px;
  //  }
  //}

  // When the list is populated,
  // hide the upload button and
  // enable the list
  .is--populated {
    .cmb-attach-list {;
      pointer-events: auto;

      //&:hover {
      //  opacity: .6;
      //
      //  & + .edit-fonts-icon {
      //    display: block;
      //  }
      //}
    }

    .cmb2-upload-button {
      //display: none;
      position: static;
      transform: none;
      margin-bottom: 15px;
    }
  }
}

.cmb2-id-fonto-url-path {
  position: relative;

  &:before {
    content: "";

    position: absolute;
    bottom: 0;
    left: 30px;
    right: 30px;

    height: 0;

    border-bottom: 1px solid $borders;
  }

  input {
    width: 100%;
  }
}

.cmb2-id-fonto-embed-code-self-hosted {
  .postbox-container & {
    .cmb-td,
    .cmb-th {
      float: none;
      width: 100%;
    }
  }

  .font-loading-section &.cmb-row {
    padding-top: 30px;
  }
}





// Font Family name field
.postbox-container .cmb2-id-fonto-font-name-style {
  .cmb-th,
  .cmb-td {
    float: none;
    width: 100%;
  }

  .cmb-th {
    margin-bottom: 20px;
  }
}

.cmb2-metabox > .cmb-row.cmb-row.cmb2-id-fonto-font-name-style {
  padding-top: 20px;
}

#fonto_font_family_name {
  width: 100%;
}





// Available Font Variations + checkboxes list
.cmb2-id-fonto-font-variations {
  &.cmb-row.cmb2-id-fonto-font-variations {
    border-bottom: 0;
  }

  .cmb2-checkbox-list {
    display: flex;
    flex-wrap: wrap;

    color: $gray;

    li {
      flex-basis: 50%;
      font-size: 16px;
    }
  }
}





// Font Weights & Styles Variations title
#postbox-container-2 .cmb-type-title.cmb2-id-fonto-font-weight-style-variations {
  border-top: 0;

  .cmb2-metabox-title {
    font-size: 16px;
  }

  .cmb2-metabox-description {
    @extend .cmb2-metabox-our-description;
    padding-top: 0;
    margin-bottom: 6px;
    font-style: normal;
  }
}






// Font matching labels
input[value*="100_normal"] + label,
label[for*="100_normal_individual"],
input[value*="100_italic"] + label,
label[for*="100_italic_individual"],
input[value*="200_normal"] + label,
label[for*="200_normal_individual"],
input[value*="200_italic"] + label,
label[for*="200_italic_individual"] {
  font-family: "Open Sans Condensed", sans-serif;
  font-weight: 300;
}

input[value*="300"] + label,
label[for*="300"] {
  font-weight: 300;
}

input[value*="400"] + label,
label[for*="400"] {
  font-weight: 400;
}

input[value*="500"] + label,
label[for*="500"] {
  font-weight: 600;
}

input[value*="600"] + label,
label[for*="600"],
input[value*="700"] + label,
label[for*="700"] {
  font-weight: 700;
}

input[value*="800"] + label,
label[for*="800"],
input[value*="900"] + label,
label[for*="900"] {
  font-weight: 800;
}

input[value*="italic"] + label,
label[for*="italic"] {
  font-style: italic;
}





// Matching Weights & Styles Variations fields
.matching-fields-section {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;

  .cmb-row {
    flex-basis: 47.25%;

    &.cmb-row {
      border-bottom: 0;
      padding-bottom: 15px;
    }

    .cmb-td,
    .cmb-th {
      float: none;
      width: 100%;
    }

    .cmb-td input {
      width: 100%;
    }
  }

  label {
    padding-bottom: 10px;
  }

  input {
    font-weight: 600;

    &[value]:not([value=""]) {
      background-color: #F6FCFF;
      border-color: #BDE4F6;
    }
  }
}
