/*
 * 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-container-helpers';
@use '../../scss-shared/nx-text-helpers';
@use '../../scss-shared/nx-dark-mode-helpers';

.nx-threat-indicator-legend {
  $max-grid-columns: 6;

  display: grid;
  gap: var(--nx-spacing-2x);
  grid-template-columns: repeat($max-grid-columns, auto);
  margin: var(--nx-spacing-6x) 0;
  max-width: max-content;

  .nx-threat-indicator-legend__header {
    @include nx-text-helpers.bold;
    color: var(--nx-color-threat-indicator-legend-header-text);
    grid-column: span $max-grid-columns;
  }

  .nx-threat-indicator-legend__threat-container {
    @include nx-text-helpers.semi-bold;
    color: var(--nx-color-threat-level-text);

    @include nx-container-helpers.container-horizontal;
  }
}

.nx-threat-indicator-legend--vertical {
  grid-template-columns: none;

  .nx-threat-indicator-legend__header {
    grid-column: auto;
  }
}
