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

.nx-grid-row {
  display: flex;
  margin-top: var(--nx-spacing-6x);
  margin-bottom: var(--nx-spacing-6x);
}

.nx-grid-col {
  border-left: var(--nx-border-grid);
  box-sizing: border-box;
  flex: 1 0;
  overflow-x: hidden;
  padding: 0 var(--nx-spacing-6x);

  overflow-wrap: break-word;

  &:first-child {
    border: none;
    padding-left: 0;
  }

  &:last-child {
    padding-right: 0;
  }

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

@each $percent in (25, 50, 75, 33, 67) {
  .nx-grid-col--#{$percent} {
    @include nx-flexbox-helpers.grid-col-width(#{$percent + '%'});
  }
}

.nx-grid-h-keyline {
  border: none;
  border-top: var(--nx-border-default);
  margin-top: var(--nx-spacing-6x);
  margin-bottom: var(--nx-spacing-6x);
}

// Grid headers
.nx-grid-header {
  margin-bottom: var(--nx-spacing-4x);
  @include nx-container-helpers.container-vertical;
}

.nx-grid-header__title {
  @include nx-text-helpers.truncate-ellipsis;
  @include nx-container-helpers.container-horizontal;
}

.nx-grid-col__section {
  margin-top: var(--nx-spacing-6x);
  margin-bottom: var(--nx-spacing-6x);

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