// Masthead
//================================================== //

.masthead {
  background-color: $masthead-bg-color;
  border-bottom: 1px solid $masthead-border-color;
  height: 40px;
  width: 100%;
  z-index: 9000;

  .masthead-icon {
    border-radius: 0;
    height: 28px;
    width: 28px;
    margin-top: 3px;

    > .icon {
      stroke: transparent;
      height: 28px;
      width: 28px;
    }

    .ripple-effect {
      background-color: transparent;
    }
  }

  [class^='btn'] {
    height: 30px !important;
    min-width: 32px;
    padding-right: 8px;
    min-height: 32px;
    color: $masthead-text-color !important;

    svg.icon {
      color: $masthead-button-color;
      vertical-align: middle;
      margin-inline-start: 1px;

      &.icon-dropdown {
        margin-top: -2px;
      }
    }

    &:hover:not(:disabled),
    &.is-open {
      color: $ids-color-palette-white;
      background-color: transparent;

      svg.icon {
        color: $ids-color-palette-white;
      }
    }

    &:focus:not(.hide-focus) {
      box-shadow: 0 0 0 2px transparent, 0 0 0 1px $masthead-button-focus-color, $header-focus-box-shadow;
    }

    &.collapse-button {
      height: inherit;
    }
  }

  .btn {
    padding: 0 8px;
  }

  .btn-icon,
  .btn-actions,
  .btn-close {
    min-height: 32px;
    min-width: 32px;
    width: 32px;
  }

  .toolbar-searchfield-wrapper {
    > .icon:not(.close, .error) {
      color: $masthead-button-color;
      height: 18px;
      opacity: 1;
    }

    &.has-focus:not(.active) {
      > .icon {
        color: $masthead-button-hover-color;
      }
    }
  }

  .searchfield {
    height: 28px;
  }

  .toolbar {
    height: 100%;
    margin-bottom: 0;

    .popupmenu {
      li {
        &.is-checked > a::before {
          border-color: $popupmenu-checked-color-inverse $popupmenu-checked-color-inverse $popupmenu-checked-color-inverse transparent;
        }
      }
    }

    .title {
      height: 100%;
      padding: 0;
    }

    .buttonset {
      height: 36px;

      > *:not(.toolbar-searchfield-wrapper) {
        margin: 3px 3px 2px 0;
      }

      .btn-menu {
        margin-right: -6px;
      }

      .toolbar-searchfield-wrapper {
        margin: 1px 0 0;
      }
    }

    .btn-actions {
      margin-left: -8px;
      margin-right: 5px;
    }
  }

  .toolbar {
    [class^='btn'] {
      margin: 3px 3px 2px 0;
      vertical-align: top;
    }
  }

  .flex-toolbar {
    height: inherit;

    .toolbar-section {
      &.buttonset [class^='btn'] {
        &.btn-menu {
          margin-right: -8px;
        }

        &:last-child.btn-menu {
          margin-right: -3px;
          vertical-align: top;
        }
      }
    }
  }

  .toolbar,
  .flex-toolbar {
    padding: 0 8px;

    [class^='btn'] {
      background-color: transparent;
      border-color: transparent;
      color: $masthead-text-color;

      &.btn-menu {
        margin-top: 1px;
      }

      .ripple-effect {
        background-color: $ids-color-palette-white;
      }

      &:active {
        border-color: transparent;
      }

      span:not(.audible) {
        color: inherit;
        position: relative;
        top: -1px;
      }

      .icon {
        color: $masthead-button-color;

        &.app-drawer {
          left: -6px;
          position: relative !important;
          top: -6px;
        }
      }

      &:hover:not([disabled]) {
        background-color: transparent !important;
        color: $masthead-button-hover-color !important;

        .icon,
        svg.icon {
          color: $masthead-button-hover-color !important;
        }
      }

      &.is-open,
      &.is-open:hover {
        background-color: transparent;
        color: $masthead-button-hover-color !important;

        .icon {
          color: $masthead-button-hover-color !important;
        }
      }

      &:focus:not(.hide-focus) {
        box-shadow: 0 0 0 2px transparent, 0 0 0 1px $masthead-button-focus-color, $header-focus-box-shadow;

        .icon {
          color: $masthead-button-color;
        }
      }

      &.is-selected {
        &:focus:not(.hide-focus) {
          color: $masthead-button-color;

          .icon {
            color: $masthead-button-color;
          }
        }
      }
    }
  }

  // Support image classes see images/example-photos
  .image-initials,
  .image-round {
    font-size: 1.2rem;
    height: 29px;
    min-height: 29px;
    line-height: 29px;
    margin-left: -4px;
    margin-right: 0;
    width: 29px;
    min-width: 29px;
  }

  .image-user-status {
    height: 31px;
    vertical-align: middle;

    .icon {
      height: 10px;
      margin-left: -9px;
      margin-top: 19px;
      width: 10px;
    }
  }
}

.twelve {
  .masthead {
    position: static;
  }
}

.masthead-appname {
  color: $masthead-text-color;
  display: inline-block;
  font-size: $ids-size-font-px-12;
  font-weight: 600;
  line-height: 38px;
  margin: 0;
  vertical-align: top;
}

// Right to Left Adjustments
html[dir='rtl'] {
  .masthead {
    button {
      margin-left: -3px;
    }

    .image-user-status .icon {
      margin-right: -7px;
    }

    .flex-toolbar {
      .toolbar-section {
        &.buttonset [class^='btn'] {
          &.btn-menu {
            margin-left: -8px;
            margin-right: 0;
          }

          &:last-child.btn-menu {
            margin-left: -3px;
            margin-right: 0;
          }
        }
      }
    }

    [class^='btn'] > * {
      vertical-align: middle;
    }

    [class^='btn']:not(.btn-generative) span + .icon {
      margin-right: 2px !important;
    }
  }
}
