@import '../../styles/common';

$button-size: rem(36px);
$skip-vertical-offset: rem(10px);

.Frame {
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: color('sky', 'light');

  @include when-printing {
    background-color: none;
  }
}

.LayoutWithNav{
  width: 100%;
  display: flex;
  flex: 1 0 auto;
  position: relative;
  align-items: stretch;
}

.Navigation {
  @include hidden-when-printing;
  z-index: z-index(nav, $fixed-element-stacking-order);
  display: none;
  flex: 0 0 auto;
  align-items: stretch;
  height: 100%;
  outline: none;
  transform: translateX(0%);

  @include frame-when-nav-displayed {
    z-index: 1;
    display: flex;
  }

  &:focus {
    outline: none;
  }
}

.NavContainer{
  z-index: 999;
}

.Navigation-enter,
.Navigation-enterActive,
.Navigation-exit,
.Navigation-exitActive {
  display: flex;
}

.Navigation-enter {
  transform: translateX(-100%);
}

.Navigation-enterActive {
  transform: translateX(0%);
  transition: transform duration(slow) easing(out);
}

.Navigation-exit {
  transform: translateX(0%);
}

.Navigation-exitActive {
  transform: translateX(-100%);
  transition: transform duration(slow) easing(out);
}

.NavigationDismiss {
  @include hidden-when-printing;
  position: absolute;
  top: -1 * top-bar-height();
  left: 0;
  width: $button-size;
  height: $button-size;
  margin: 1rem;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: var(--top-bar-background);
  opacity: 0;
  pointer-events: none;
  will-change: opacity;
  cursor: pointer;
  transition: opacity duration(fast) easing();

  .Navigation-visible & {
    pointer-events: all;
    opacity: 1;
  }

  &:focus {
    border-radius: border-radius();
    background-color: var(--top-bar-background);
    outline: none;
  }

  @include frame-when-nav-displayed {
    display: none;
  }
}

.TopBar {
  @include hidden-when-printing;
  z-index: z-index(top-bar, $fixed-element-stacking-order);
  width: 100%;
}

.ContextualSaveBar {
  position: fixed;
  z-index: z-index(context-bar, $fixed-element-stacking-order);
  top: 0;
  left: 0;
  width: 100%;
}

.Main {
  flex: 1;
  display: flex;
  align-items: stretch;

  flex-grow: 1;
  position: relative;
  overflow: hidden;

  @include layout-flex-fix;
}

.Content {
  height: 100%;
  position: absolute;
  top: 0;
  width: 100%;
  flex: 1;
  @include layout-flex-fix;
}

.ContentScrollContainer {
  height: 100%;
  overflow: auto;
}

.GlobalRibbonContainer {
  position: fixed;
  z-index: z-index(global-ribbon, $fixed-element-stacking-order);
  bottom: 0;
  width: 100%;

  @include frame-when-nav-displayed {
    .hasNav & {
      left: layout-width(nav);
      @include safe-area-for(left, layout-width(nav), left);
      width: calc(100% - #{layout-width(nav)});
    }
  }
}

.LoadingBar {
  @include hidden-when-printing;
  position: fixed;
  z-index: z-index(small-screen-loading-bar, $fixed-element-stacking-order);
  top: 0;
  right: 0;
  left: 0;

  @include frame-when-nav-displayed {
    .hasTopBar & {
      top: top-bar-height();
      z-index: z-index(loading-bar, $fixed-element-stacking-order);
    }
  }
}

.Skip {
  position: fixed;
  z-index: z-index(skip-to-content, $fixed-element-stacking-order);
  top: $skip-vertical-offset;
  left: spacing(tight);
  opacity: 0;
  pointer-events: none;

  &.focused {
    pointer-events: all;
    opacity: 1;
  }
}

.SkipAnchor {
  @include button-base;
}
