/* ========================================================================== *\
   Objects -> Tables ($objects-tables)
\* ========================================================================== */

/**
 * Wrap a <table> with a `.table-container` element to add horizontal scrolling
 * if the <table> contents overflow its grandparent.
 */

.table-container {
  .momentum-scrolling();
}

/* Default, borderless */
.table {
  width: 100%;
  max-width: 100%;

  caption {
    font-weight: @table-caption-font-weight;
    font-style: @table-caption-font-style;
    .to-rem(padding-bottom, @table-caption-padding-bottom);
    //padding-bottom: (@base-spacing-unit * 0.375);
  }

  th,
  tfoot td {
    font-weight: 700;
    text-align: left;
    color: @table-header-footer-text-color;
  }

  thead th,
  tfoot td {
    background-color: @table-header-footer-bg-color;
  }

  th,
  td {
    .to-rem(padding, @table-cell-padding);
    //padding: (@base-spacing-unit * 0.625);
    vertical-align: top;
  }
}

/**
 * Give the <table> element an outer border.
 */

.table-border {
  .to-rem(border, @table-border-width, @table-border-style @table-border-color);
}

/**
 * Give the <table> element inner cell borders.
 */

.table-border-cells th,
.table-border-cells td {
  .to-rem(border-top, @table-border-width, @table-border-style @table-border-color);
  .to-rem(border-left, @table-border-width, @table-border-style @table-border-color);
}

/**
 * Give Give the <table> inner row borders.
 */

.table-border-rows th,
.table-border-rows td {
  .to-rem(border-top, @table-border-width, @table-border-style @table-border-color);
}

/**
 * Remove border on 1st-row cells to avoid a double border.
 */

.table-border.table-border-cells thead:first-child tr:first-child th,
.table-border.table-border-cells thead:first-child tr:first-child td,
.table-border.table-border-rows thead:first-child tr:first-child th,
.table-border.table-border-rows thead:first-child tr:first-child td {
  border-top: 0;
}

/**
 * Remove border on 1st cells in every row to create a grid effect.
 */

.table-border-cells tr th:first-child,
.table-border-cells tr td:first-child {
  border-left: 0;
}

/**
 * Remove border on 1st-row cells to create a grid effect.
 */

.table-border-cells tr:first-child th,
.table-border-cells thead:first-child tr:first-child th {
  border-top: 0;
}

/**
 * Add a bottom border to the last row in the table.
 */

.table-border-rows tr:last-child td {
  .to-rem(border-bottom, @table-border-width, @table-border-style @table-border-color);
}

/**
 * Alternate `background-color` for all table rows.
 */

.table-striped tbody > tr:nth-child(odd) > td {
  background-color: @table-stripe-background-color;
}
