/*
 * Made by Erik Terwan
 * 24th of November 2015
 * MIT License
 *
 * Adadpted for icemac.addressbook in various ways.
 */

@media (max-width: 699px) {

    .menuToggle
    {
      display: block;
      position: relative;
      left: 2px;

      -webkit-user-select: none;
      -moz-user-select: none;
       -ms-user-select: none;
           user-select: none;
    }

    .menuToggle input
    {
      display: block;
      width: 40px;
      height: 32px;
      position: absolute;
      top: -7px;
      left: -5px;

      cursor: pointer;

      opacity: 0; /* hide this */
      z-index: 3; /* and place it over the hamburger */

      -webkit-touch-callout: none;
    }

    .menuToggle.right-side input {
        left: unset;
        right: -5px;
        top: -12px;
    }

    /*
     * Just a quick hamburger
     */
    .menuToggle .bar
    {
      display: block;
      width: 33px;
      height: 4px;
      margin-bottom: 5px;
      margin-left: 0px;
      position: relative;

      background: #cdcdcd;
      border-radius: 3px;

      -webkit-transform-origin: 4px 0px;

              transform-origin: 4px 0px;

      transition: background 0.5s cubic-bezier(0.77,0.2,0.05,1.0),
                  opacity 0.55s ease,
                  -webkit-transform 0.5s cubic-bezier(0.77,0.2,0.05,1.0);

      transition: transform 0.5s cubic-bezier(0.77,0.2,0.05,1.0),
                  background 0.5s cubic-bezier(0.77,0.2,0.05,1.0),
                  opacity 0.55s ease;

      transition: transform 0.5s cubic-bezier(0.77,0.2,0.05,1.0),
                  background 0.5s cubic-bezier(0.77,0.2,0.05,1.0),
                  opacity 0.55s ease,
                  -webkit-transform 0.5s cubic-bezier(0.77,0.2,0.05,1.0);
    }

    .menuToggle .bar:first-child
    {
      -webkit-transform-origin: 0% 0%;
              transform-origin: 0% 0%;
    }

    .menuToggle .bar:nth-last-child(2)
    {
      -webkit-transform-origin: 0% 100%;
              transform-origin: 0% 100%;
    }


    /*
     * Just a quick plus sign.
     */
    .menuToggle .plus
    {
      display: block;
      width: 33px;
      height: 4px;
      margin-bottom: 3px;
      margin-left: 0px;
      position: relative;

      background: #cdcdcd;
      border-radius: 3px;
    }

    .menuToggle .plus.horizontal
    {
      -webkit-transform: rotate(90deg) translate(-7px, 0);
              transform: rotate(90deg) translate(-7px, 0);
    }


    .menuToggle input:checked ~ ul {
        z-index: 1;
    }

    /*
     * Transform all the slices of hamburger
     * into a crossmark.
     */
    .menuToggle input:checked ~ .bar
    {
      margin-left: 8px;
      opacity: 1;
      -webkit-transform: rotate(45deg) translate(-2px, -1px);
              transform: rotate(45deg) translate(-2px, -1px);
      background: #232323;
      z-index: 2;
    }

    .menuToggle input:checked ~ .plus
    {
      margin-left: 8px;
      opacity: 1;
      -webkit-transform: rotate(45deg) translate(-1px, -1px);
              transform: rotate(45deg) translate(-1px, -1px);
      background: #232323;
      z-index: 2;
    }

    .menuToggle input:checked ~ .plus.horizontal
    {
      -webkit-transform: rotate(-45deg) translate(7px, -7px);
              transform: rotate(-45deg) translate(7px, -7px);
    }

    /*
     * But let's hide the middle one.
     */
    .menuToggle input:checked ~ .bar:nth-last-child(3)
    {
      opacity: 0;
      -webkit-transform: rotate(0deg) scale(0.2, 0.2);
              transform: rotate(0deg) scale(0.2, 0.2);
    }

    /*
     * Ohyeah and the last one should go the other direction
     */
    .menuToggle input:checked ~ .bar:nth-last-child(2)
    {
      -webkit-transform: rotate(-45deg) translate(0, -1px);
              transform: rotate(-45deg) translate(0, -1px);
    }

    /*
     * Make this absolute positioned
     * at the top left of the screen
     */
    .menuToggle .abmenu
    {
      position: absolute;
      margin: -50px 0 0 -25px;
      padding: 10px 50px 50px 50px;
      left: 10px;

      background: #ededed;
      list-style-type: none;
      -webkit-font-smoothing: antialiased;
      /* to stop flickering of text in safari */

      -webkit-transform-origin: 0% 0%;
              transform-origin: 0% 0%;
      -webkit-transform: translate(-100%, 0);
              transform: translate(-100%, 0);

      transition: -webkit-transform 0.5s cubic-bezier(0.77,0.2,0.05,1.0);

      transition: transform 0.5s cubic-bezier(0.77,0.2,0.05,1.0);

      transition: transform 0.5s cubic-bezier(0.77,0.2,0.05,1.0),
                  -webkit-transform 0.5s cubic-bezier(0.77,0.2,0.05,1.0);
    }

    .menuToggle.right-side .abmenu {
        left: unset;
        right: 1px;
        display: none;
        margin-top: -28px;
        min-width: 240px;
    }

    .menuToggle .abmenu li
    {
      padding: 10px 0;
      font-size: 22px;
    }

    .menuToggle.right-side .abmenu li
    {
      float: right;
    }

    /*
     * And let's slide it in from the left
     */
    .menuToggle input:checked ~ ul
    {
      -webkit-transform: none;
              transform: none;
    }
    /* The right side menue dies not slide. */
    .menuToggle.right-side input:checked ~ ul
    {
      display: block;
    }
}
