/*
 * Copyright (c) 2019-present Sonatype, Inc.
 * This program and the accompanying materials are made available under
 * the terms of the Eclipse Public License 2.0 which accompanies this
 * distribution and is available at https://www.eclipse.org/legal/epl-2.0/.
 */
@use '../../scss-shared/nx-button-helpers';
@use '../../scss-shared/_nx-dark-mode-helpers';

.nx-global-header-2 {
  $header-content-height: 55px;
  align-items: center;
  background-color: var(--nx-color-global-sidebar-2-background);
  border-bottom: var(--nx-border-width) solid var(--nx-color-global-sidebar-2-border);
  display: flex;
  gap: var(--nx-spacing-6x);
  grid-area: header; // see nx-page's grid-template
  height: $header-content-height;
  justify-content: space-between;
  padding-left: var(--nx-spacing-6x);
  padding-right: var(--nx-spacing-3x);

  &__home-link {
    display: contents;
  }

  &__actions {
    align-items: center;
    display: flex;
    flex-shrink: 0;
    gap: var(--nx-spacing-3x);

    // parent class needed for specificity
    .nx-global-header-2 & > * {
      margin-left: 0;
      margin-right: 0;
    }
  }

  &__logo {
    max-height: calc(#{$header-content-height} - 2 * var(--nx-spacing-3x));

    &--dark {
      display: none;

      @include nx-dark-mode-helpers.dark-mode {
        display: initial;
      }
    }

    &--light {
      @include nx-dark-mode-helpers.dark-mode {
        display: none;
      }
    }
  }
}
