table {
	/* border-collapse sets the table's elements to share borders, rather than floating as separate "boxes". */
	border-collapse: collapse;
	width: 100%
}

td,
th {
	border: 1px solid var(--nc-bg-3);
	text-align: left;
	padding: .5rem;
}

th, tfoot {
	background: var(--nc-tbg-2);
}

tr:nth-child(even) {
	/* Set every other cell slightly darker. Improves readability. */
	background: var(--nc-tbg-2);
}

table caption {
	font-style: italic;
  font-size: 1.7rem;
	margin-bottom: .5rem;
}

textarea {
	/* Don't let the <textarea> extend off the screen naturally or when dragged by the user */
	max-width: 100%;
}

/* RWD tafla */

@media screen and (max-width: 37.5em) {
    table {
      border: 0;
      width: 98%;
    }
      
    table thead {
      border: none;
      clip: rect(0 0 0 0);
      height: 1px;
      margin: -1px;
      overflow: hidden;
      padding: 0;
      position: absolute;
      width: 1px;
    }
    
    table tr {
      border-bottom: 3px solid #ddd;
      display: block;
      margin-bottom: .625em;
    }
    
    table td {
      border-bottom: 1px solid #ddd;
      display: block;
      font-size: .8em;
      text-align: right;
    }
    
    table td::before {
      /*
      * aria-label has no advantage, it won't be read inside a table
      content: attr(aria-label);
      */
      content: attr(data-label);
      float: left;
      font-weight: bold;
      text-transform: uppercase;
    }
    
    table td:last-child {
      border-bottom: 0;
    }
  }