/*
* Table component
*
*/

@use './table-mixins.scss' as table-mixins;

.dnb-table {
  &__th__horizontal {
    display: flex;
    align-items: flex-end; // bottom align help-button or other additional elements
  }

  &__th,
  & thead th {
    background-color: var(--table-th-background-color);
  }

  // When we have a "th" with a scope of row, and there is only one td
  & tbody tr:has(th:first-child + td:last-child) th[scope='row'] {
    --table-th-background-color: initial;
  }
  & tbody tr th[scope='row'] + td:last-child {
    width: 100%;
  }

  &__th--highlight {
    --table-th-background-color: var(--table-highlight-background);
  }
  &--border &__th--highlight + &__th--highlight {
    @include table-mixins.tableBorder() {
      border-left: var(--table-border-width) solid
        var(--table-th-highlight-border);
    }
  }
}
