/*
Copyright 2015 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.
*/


.ViewSelector,
.ViewSelector2 {
  display: block
}

.ViewSelector2-item,
/* For the old school view selector. */
.ViewSelector table {
  display: block;
  margin-bottom: 1em;
  width: 100%;
}

.ViewSelector2-item > label,
/* For the old school view selector. */
.ViewSelector td:first-child {
  font-weight: 700;
  margin: 0 .25em .25em 0;
  display: block;
}

.ViewSelector2-item > select {
  width: 100%;
}


/*
 * Additional hacks to get the native ViewSelector component (which uses
 * closure widgets) to look like our custom ViewSelector extension.
 */

.ViewSelector table,
.ViewSelector tbody,
.ViewSelector tr,
.ViewSelector td {
  display: block;
}

.ViewSelector table {
  height: auto!important;
  width: auto!important;
}

.ViewSelector td {
  width: auto!important;
}

.ViewSelector td:last-child * {
  display: block;
  text-align: left;
}

.ViewSelector td:last-child > div {
  font-weight: 400;
  margin: 0;
}

@media (--break-md) {
  .ViewSelector,
  .ViewSelector2 {
    display: flex;
    margin: 0 0 -1em -1em;
    width: calc(100% + 1em);
  }

  .ViewSelector2-item,
  /* For the old school view selector. */
  .ViewSelector table {
    flex: 1 1 calc(100%/3 - 1em);
    margin-left: 1em;
  }
}

/*
 * Force each item onto its own line
 * regardless of the breakpoint.
 */
.ViewSelector2--stacked,
.ViewSelector--stacked {
  display: block;
  margin: 0;
  width: auto;
}

.ViewSelector2--stacked .ViewSelector2-item,
/* For the old school view selector. */
.ViewSelector--stacked table {
  margin-left: 0;
}
