@import '../../_variables.scss';
@import '../../_logical.scss';

.DesktopNav {
  inline-size: 100%;

  input {
    color: var(--inputTopbarText, var(--inputText));
  }

  a {
    color: var(--topBarLink, $fallback--link);
  }

  .inner-nav {
    display: grid;
    grid-template-rows: var(--navbar-block-size);
    grid-template-columns: 2fr auto 2fr;
    grid-template-areas: "nav-left logo actions";
    box-sizing: border-box;
    padding-block: 0;
    padding-inline: 1.2em;
    margin: auto;
    max-inline-size: 1110px;
  }

  &.-logoLeft .inner-nav {
    grid-template-columns: auto 2fr 2fr;
    grid-template-areas: "logo nav-left actions";
  }

  .button-default {
    &, svg {
      color: $fallback--text;
      color: var(--btnTopBarText, $fallback--text);
    }

    &:active {
      background-color: $fallback--fg;
      background-color: var(--btnPressedTopBar, $fallback--fg);
      color: $fallback--text;
      color: var(--btnPressedTopBarText, $fallback--text);
    }

    &:disabled {
      color: $fallback--text;
      color: var(--btnDisabledTopBarText, $fallback--text);
    }

    &.toggled {
      color: $fallback--text;
      color: var(--btnToggledTopBarText, $fallback--text);
      background-color: $fallback--fg;
      background-color: var(--btnToggledTopBar, $fallback--fg)
    }
  }

  .logo {
    grid-area: logo;
    position: relative;
    transition: opacity;
    transition-timing-function: ease-out;
    transition-duration: 100ms;

    @media all and (min-width: 800px) {
      opacity: 1 !important;
    }
    @media all and (min-height: 800px) {
      [class^=#{$writing-mode-vertical}] & {
        opacity: 1 !important;
      }
    }

    .mask {
      mask-repeat: no-repeat;
      mask-position: center;
      mask-size: contain;
      background-color: $fallback--fg;
      background-color: var(--topBarText, $fallback--fg);
      position: absolute;
      inset-block-start: 0;
      inset-block-end: 0;
      inset-inline-start: 0;
      inset-inline-end: 0;
    }

    img {
      display: inline-block;
      block-size: var(--navbar-block-size);
    }
  }

  .nav-icon {
    margin-inline-start: 0.2em;
    inline-size: 2em;
    block-size: 100%;
    text-align: center;

    &.router-link-active {
      font-size: 1.2em;
      margin-block-start: 0.05em;

      .svg-inline--fa {
        font-weight: bolder;
        color: $fallback--text;
        color: var(--selectedMenuText, $fallback--text);
        --lightText: var(--selectedMenuLightText, $fallback--lightText);
      }
    }

    .svg-inline--fa {
      color: $fallback--link;
      color: var(--topBarLink, $fallback--link);
    }
  }

  .-wide {
    .nav-icon {
      margin-inline-start: 0.7em;
    }
  }

  .left {
    padding-inline-start: 5px;
    display: flex;
  }

  .nav-left-wrapper {
    grid-area: nav-left;

    .favicon {
      block-size: 28px;
      vertical-align: middle;
      padding-inline-end: 5px;
    }
  }

  .actions {
    grid-area: actions;
  }

  .item {
    flex: 1;
    line-height: var(--navbar-block-size);
    block-size: var(--navbar-block-size);
    overflow: hidden;
    display: flex;
    flex-wrap: wrap;

    &.right {
      justify-content: flex-end;
      text-align: end;
    }
  }
}
