// Standard/Desktop Heights
$toolbar-tools-height: 64px !default;
$toolbar-height: 64px !default;
$toolbar-medium-tall-height: 88px !default;
$toolbar-tall-height: 128px !default;

// Mobile portrait heights
$toolbar-tools-height-mobile-portrait: 56px !default;
$toolbar-height-mobile-portrait: 56px !default;

// Mobile landscape heights
$toolbar-tools-height-mobile-landscape: 48px !default;
$toolbar-height-mobile-landscape: 48px !default;


$toolbar-indent-margin: 64px !default;
$toolbar-padding: 16px !default;

$icon-button-margin-offset: rem(-0.800) !default;

md-toolbar {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;

  position: relative;
  z-index: 2;

  font-size: rem(2.0);
  min-height: $baseline-grid * 8;
  width: 100%;

  &.md-whiteframe-z1-add, &.md-whiteframe-z1-remove {
    transition: box-shadow $swift-ease-in-out-duration linear;
  }

  md-toolbar-filler {
    width: 9 * $baseline-grid;
  }

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

  &.md-tall {
    height: $toolbar-tall-height;
    min-height: $toolbar-tall-height;
    max-height: $toolbar-tall-height;
  }

  &.md-medium-tall {
    height: $toolbar-medium-tall-height;
    min-height: $toolbar-medium-tall-height;
    max-height: $toolbar-medium-tall-height;

    .md-toolbar-tools {
      height: 48px;
      min-height: 48px;
      max-height: 48px;
    }
  }

  > .md-indent {
    margin-left: $toolbar-indent-margin;
  }

  ~ md-content {
    > md-list {
      padding: 0;

      md-list-item:last-child {
        md-divider {
          display: none;
        }
      }
    }
  }
}

.md-toolbar-tools {
  font-size: $title-font-size-base;
  letter-spacing: 0.005em;
  box-sizing: border-box;
  font-weight: 400;
  display: flex;
  align-items: center;
  flex-direction: row;

  width: 100%;
  height: $toolbar-tools-height;
  max-height: $toolbar-tools-height;
  padding: 0 $toolbar-padding;
  margin: 0;

  h1, h2, h3 {
    font-size: inherit;
    font-weight: inherit;
    margin: inherit;
  }

  a {
    color: inherit;
    text-decoration: none;
  }
  .fill-height {
    display: flex;
    align-items: center;
  }
  .md-button {
    margin-top: 0;
    margin-bottom: 0;
  }
  &> .md-button:first-child {
    margin-left: $icon-button-margin-offset;
  }
  &> .md-button:last-child {
    margin-right: $icon-button-margin-offset;
  }

  &> md-menu:last-child {
    margin-right: $icon-button-margin-offset;
    & > .md-button {
      margin-right: 0;
    }
  }

  @media screen and (-ms-high-contrast: active) {
    border-bottom: 1px solid #fff;
  }
}

// Handle mobile portrait
@media only screen and (min-width: 0) and (max-width: $layout-breakpoint-sm - 1) and (orientation: portrait) {
  md-toolbar {
    min-height: $toolbar-height-mobile-portrait;
  }

  .md-toolbar-tools {
    height: $toolbar-height-mobile-portrait;
    max-height: $toolbar-height-mobile-portrait;
  }
}

// Handle mobile landscape
@media only screen and (min-width: 0) and (max-width: $layout-breakpoint-sm - 1) and (orientation: landscape) {
  md-toolbar {
    min-height: $toolbar-height-mobile-landscape;
  }

  .md-toolbar-tools {
    height: $toolbar-height-mobile-landscape;
    max-height: $toolbar-height-mobile-landscape;
  }
}

