/* TEXT COLORS
 * ------------------------------------------------- */
@cuar-color-text-darker: contrast(@cuar-color-neutral, darken(@cuar-color-neutral, 80%), lighten(@cuar-color-neutral, 60%));
@cuar-color-text-dark: contrast(@cuar-color-neutral, darken(@cuar-color-neutral, 75%), lighten(@cuar-color-neutral, 65%));
@cuar-color-text: contrast(@cuar-color-neutral, darken(@cuar-color-neutral, 70%), lighten(@cuar-color-neutral, 70%));
@cuar-color-text-light: contrast(@cuar-color-neutral, darken(@cuar-color-neutral, 65%), lighten(@cuar-color-neutral, 75%));
@cuar-color-text-lighter: contrast(@cuar-color-neutral, darken(@cuar-color-neutral, 60%), lighten(@cuar-color-neutral, 80%));

/* CHECK THEME LIGHTNESS AND IMPORT DEPENDENCIES
 * ------------------------------------------------- */
.cuar-check-light-or-dark() when (lightness(@cuar-color-neutral) > 43) {
  @cuar-dark-scheme: false;
  @import "colors-for-light-scheme";
}

.cuar-check-light-or-dark() when (lightness(@cuar-color-neutral) <= 57) {
  @cuar-dark-scheme: true;
  @import "colors-for-dark-scheme";
}

.cuar-check-light-or-dark();

/* TEST PALETTES CLASS
 * ------------------------------------------------- *
 If you are working on our build-environment with
 the local URI local.wordpress.dev, a test color
 color palette will popup automatically showing
 all the variables used in this skin
 * ------------------------------------------------- *
 */
#cuar-dev-nuancier {
  position: relative;
  height: 100%;
  width: 200px;
  top: 0;
  left: 0;
  z-index: 999;

  &, &:before, &:after,
  *, *:before, *:after {
    box-sizing: border-box;
    -moz-box-sizing: border-box;
    -webkit-box-sizing: border-box;
  }

  #cuar-dev-nuancier-toggle {
    position: absolute;
    background: #ccc;
    vertical-align: middle;
    cursor: pointer;
    appearance: none;
    left: -100%;
    top: -100%;

    + label {
      position: fixed;
      cursor: pointer;
      background: #BDBDBD;
      width: auto;
      padding: 4px 8px;
      color: #FFF;
      line-height: 20px;
      font-size: 12px;
      text-align: center;
      -webkit-font-smoothing: antialiased;
      margin: 0;
      bottom: 0;
      left: 0;
      border: 0;
    }
    + label:after {
      content: "Open"
    }

    &:checked ~ .cuar-dev-nuancier {
      left: 0;
      right: auto;
    }

    &:checked + label {
      background: #dd6149;
      left: 200px;
    }

    &:checked + label:after {
      content: "Close"
    }
  }

  .cuar-dev-nuancier {
    background: @panel-bg;
    position: fixed;
    height: 100%;
    width: 200px;
    top: 0;
    z-index: 999;
    left: auto;
    right: 100%;

    .cuar-dev-nuancier-wrapper {
      top: 32px;
      overflow-x: hidden;
      overflow-y: scroll;
      width: 100%;
      position: absolute;
      bottom: 0;
      background: repeating-linear-gradient(45deg, #F1F1F1, #F1F1F1 10px, #E4E4E4 10px, #E4E4E4 20px);

      > .cuar-dev-nuance {
        display: block;
        padding: 25px 10px 10px;
        margin: 2px;
        min-height: 30px;
        border: 1px solid @panel-border-color;
        position: relative;

        &:after {
          font-size: 10px;
          top: 100%;
          position: relative;
          font-family: sans-serif;
          background: fade(#000, 85%);
          padding: 2px;
          color: white;
        }

        &:before {
          font-size: 10px;
          position: relative;
          margin-top: -20px;
          margin-bottom: 3px;
          display: block;
          background: fade(@panel-heading-bg, 50%);
          color: @panel-heading-font-color;
          padding: 2px;
          font-family: sans-serif;
          opacity: 0;
        }
        
        &:hover:before {
          opacity: 1;
        }
      }
    }
  }
}