/*
Copyright 2014 Google Inc. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/


@import '../base/variables.css';
@import '../base/custom-media.css';

.Site {
  background: var(--bg-color-light);
  min-height: 100%;
  min-width: var(--sidebar-width);
}

.Site-sidebar {
  background: var(--bg-color-dark-faded);
  bottom: 0;
  box-shadow: 0 0 var(--gap) rgba(0, 0, 0, 0);
  left: -var(--sidebar-width);
  max-width: 100%;
  min-width: var(--sidebar-width);
  overflow-y: auto;
  position: fixed;
  top: 0;
  transform: translate3d(0, 0, 0);
  transition: transform .3s cubic-bezier(.4,0,.2,1);
  width: var(--sidebar-width);
  z-index: 1;
}

.Site.is-expanded {
  overflow: hidden;
}

.Site.is-expanded .Site-sidebar {
  box-shadow: 0 0 var(--gap) rgba(0, 0, 0, 0.5);
  transform: translate3d(var(--sidebar-width), 0, 0);
}


.Site-main {
  /* TODO(philipwalton): fallback for non-flexbox.
  min-height: 100%;
  */
}

@media (--break-md) {
  .Site {
    /* TODO(philipwalton): remove this once Query Explorer is responsive. */
    /* min-width: 768px; */
  }
  .Site-sidebar {
    left: -var(--sidebar-width-md);
    min-width: var(--sidebar-width-md);
    width: var(--sidebar-width-md);
  }
  .Site.is-expanded .Site-sidebar {
    transform: translate3d(var(--sidebar-width-md), 0, 0);
  }
}

@media (--break-lg) {
  .Site {
    display: flex;

    /* TODO(philipwalton): add fallback for non-supporting browsers; */
    /* TODO(philipwalton): Two column, equal height hack for fallback.
    background-image: linear-gradient(
      to right,
      var(--bg-color-dark-faded) 0%,
      var(--bg-color-dark-faded) var(--sidebar-width-lg));
    background-size: var(--sidebar-width-lg) 1px;
    background-repeat: repeat-y;
    */
  }

  .Site-sidebar {
    background: var(--bg-color-dark-faded);
    border-top: .4em solid #222;
    box-shadow: none;
    overflow: visible;
    position: static;
    transition: none;
    z-index: 0;
  }

  .Site.is-expanded .Site-sidebar {
    transform: none;
  }

  .Site-main {
    border-top: .4em solid #f7991c;
    box-shadow: 0 0 1em rgba(0,0,0,.3);
    flex: 1;
    position: relative; /* To get it stacked above the sidebar */

    /* TODO(philipwalton): fallback for non-flexbox
    margin-left: var(--sidebar-width-lg);
    */
  }
}
