//----------------------------------------------------------------------------------------------------------------------
// TABLES
//----------------------------------------------------------------------------------------------------------------------

/// Tables.
/// @group components
/// @example markup
///   <table class="table">
///     <thead>
///       <tr>
///         <th>Title</th>
///         <th>Title</th>
///         <th>Title</th>
///       </tr>
///     </thead>
///     <tbody>
///       <tr>
///         <td>Data</td>
///         <td>Data</td>
///         <td>Data</td>
///       </tr>
///       <tr>
///         <td>Data</td>
///         <td>Data</td>
///         <td>Data</td>
///       </tr>
///     </tbody>
///   </table>
.table {
	th {
		font-weight: $font-weight-bold;
		text-align: inherit;
	}

	th, td {
		@include padding(rhythm(.5) rhythm(1))
	}

	// Compact modifier (reduces cell padding)
	&.compact {
		th, td {
			@include padding(0 rhythm(.5))
		}
	}

	// Removes left and right padding
	&.align {
		td, th {
			&:first-child {
				padding-left: 0;
			}
			&:last-child {
				padding-right: 0;
			}
		}
	}

	// Alternating background on table rows
	&.alternate {
		tr:nth-child(odd) {
			& > td, & > th {
				background-color: tint($color-base, 95);
			}
		}
	}
}