/**
 * @file
 * IUCN Commissions styles for Tables.
 */

table {
  width: 100%;
  margin: 10px 0 10px;
}

caption {
  text-align: left; /* LTR */
}

[dir="rtl"] caption {
  text-align: right;
}

th {
  padding: 6px 6px;
  text-align: left; /* LTR */
}

[dir="rtl"] th {
  text-align: right;
}

thead th {
  color: #333;
  border: solid #ccc;
  border-width: 1px 0;
  background: #FFF;
}

tr {
  padding: 0.1em 0.6em;
  border-bottom: 1px solid #ccc;
}

thead > tr {
  border-bottom: 1px solid #000;
}

table.no-highlight tr.selected td {
  background: transparent;
}

td,
th {
  vertical-align: middle;
}

td {
  padding: 6px 6px;
  text-align: left; /* LTR */
}

[dir="rtl"] td {
  text-align: right;
}

th > a {
  position: relative;
  display: block;
}

/* 1. Must match negative bottom padding of the parent <th> */
th > a:after {
  position: absolute;
  top: 0;
  right: 0;
  bottom: -10px; /* 1. */
  left: 0;
  display: block;
  content: "";
  -webkit-transition: all 0.1s;
  transition: all 0.1s;
  border-bottom: 2px solid transparent;
}

th.is-active > a {
  color: #004875;
}

th.is-active img {
  position: absolute;
  top: 50%;
  right: 0; /* LTR */
}

[dir="rtl"] th.is-active img {
  right: auto;
  left: 0;
}

th.is-active > a:after {
  border-bottom-color: #004875;
}

th > a:hover,
th > a:focus,
th.is-active > a:hover,
th.is-active > a:focus {
  text-decoration: none;
  color: #008ee6;
}

th > a:hover:after,
th > a:focus:after,
th.is-active > a:hover:after,
th.is-active > a:focus:after {
  border-bottom-color: #008ee6;
}

td .item-list ul {
  margin: 0;
}

/* This is required to win over specificity of [dir="rtl"] .item-list ul */
[dir="rtl"] td .item-list ul {
  margin: 0;
}

td.is-active {
  background: none;
}

/* Force browsers to calculate the width of a 'select all' <th> element. */
th.select-all {
  width: 1px;
}

/**
 * Captions.
 */

.caption {
  margin-bottom: 1.2em;
}

/**
 * Responsive tables.
 */

@media screen and (max-width: 37.5em) { /* 600px */
  th.priority-low,
  td.priority-low,
  th.priority-medium,
  td.priority-medium {
    display: none;
  }
}

@media screen and (max-width: 60em) { /* 920px */
  th.priority-low,
  td.priority-low {
    display: none;
  }
}

/**
 * More details.
 */

.more-details-row h2 {
  font-size: 1.2em;
}

table.dataTable.display tbody tr.shown,
table.dataTable.display tbody tr.more-details-row {
  background-color: #eee;
}

table.dataTable.display tbody tr.shown td,
table.dataTable.display tbody tr.more-details-row td {
  border-width: 0;
}

table.dataTable.display tbody tr.shown td {
  border-top-width: 1px;
}
