/*
 * Atuna Tables
 *
 * Reproduces the appearance the tables had under wpDataTables' light skin:
 * white header with a heavy bottom rule, striped body, grey hover, right
 * aligned whole numbers, and pagination on the right. Written from the
 * measurements of the rendered result rather than copied, so nothing here
 * depends on that plugin remaining installed.
 */

.atbl-wrap {
	margin-bottom: 20px;
}

.atbl-title {
	margin: 0 0 10px;
}

/* Narrow screens scroll the table rather than breaking the layout. The mobile
   collapse is applied by script on top of this; without script the table is
   still reachable by scrolling. */
.atbl-scroll {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

table.atbl-table {
	width: 100%;
	margin: 0 auto 10px;
	border-collapse: collapse;
	border-spacing: 0;
	background-color: transparent;
	table-layout: auto;
	border: none;
	clear: both;
}

/* --- Header --- */

table.atbl-table > thead > tr > th {
	color: #333;
	background: #fff none;
	border: 1px solid #ccc;
	border-bottom-width: 2px;
	font-weight: 700;
	padding: 7px 10px;
	text-align: left;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	transition: .5s;
}

table.atbl-table > thead > tr > th.atbl-num {
	text-align: right;
}

table.atbl-table > thead > tr > th.atbl-sort {
	cursor: pointer;
	padding-right: 18px;
}

table.atbl-table > thead > tr > th.atbl-sort:hover,
table.atbl-table > thead > tr > th.atbl-sort-asc,
table.atbl-table > thead > tr > th.atbl-sort-desc {
	background-color: #f0f0f0;
}

/* The sort caret is a CSS triangle, so there is no icon font to load. */
table.atbl-table > thead > tr > th.atbl-sort::after {
	content: "";
	display: inline-block;
	width: 0;
	height: 0;
	font-size: 0;
	line-height: 0;
	border: 5px solid transparent;
	border-bottom-color: #333;
	border-top-width: 0;
	vertical-align: 3px;
	margin: 0 0 0 10px;
	opacity: .6;
}

table.atbl-table > thead > tr > th.atbl-sort-desc::after {
	border-bottom-width: 0;
	border-top-width: 5px;
	border-top-color: #333;
	border-bottom-color: transparent;
}

table.atbl-table > thead > tr > th.atbl-sort:hover::after,
table.atbl-table > thead > tr > th.atbl-sort-asc::after,
table.atbl-table > thead > tr > th.atbl-sort-desc::after {
	opacity: 1;
}

/* --- Body --- */

table.atbl-table > tbody > tr > td {
	border: 1px solid #e0e0e0;
	height: 25px;
	padding: 3px 10px;
	text-align: left;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	transition: .5s;
}

table.atbl-table > tbody > tr > td.atbl-num {
	text-align: right;
}

table.atbl-table > tbody > tr > td:first-child {
	border-left-color: #c6c6c6;
}

table.atbl-table > tbody > tr > td:last-child {
	border-right-color: #c6c6c6;
}

table.atbl-table > tbody > tr:last-child > td {
	border-bottom-color: #c6c6c6;
}

table.atbl-table > tbody > tr.atbl-odd > td {
	background-color: #f5f5f5;
}

table.atbl-table > tbody > tr.atbl-even > td {
	background-color: #fff;
}

table.atbl-table > tbody > tr:hover > td {
	background-color: #e8e8e8;
}

/* --- Footer: count and pagination --- */

.atbl-foot::after {
	content: "";
	display: table;
	clear: both;
}

.atbl-info {
	float: left;
	clear: both;
	margin-top: 10px;
	padding: 3px 0;
	font-size: 11px;
}

.atbl-paging {
	float: right;
	font-family: sans-serif;
	font-size: 13px;
}

.atbl-paging button {
	display: inline-block;
	min-width: 1.5em;
	padding: .6em 1.164em .4em;
	margin: 0;
	border: 0;
	background: none;
	color: #666;
	font: inherit;
	line-height: 1;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	transition: .5s;
}

.atbl-paging button:hover:not(:disabled) {
	background-color: #f5f5f5;
	color: #666;
}

.atbl-paging button.atbl-current,
.atbl-paging button.atbl-current:hover {
	background-color: #e8e8e8;
	color: #666;
}

.atbl-paging button:disabled {
	opacity: .4;
	cursor: default;
}

.atbl-paging .atbl-ellipsis {
	margin: 0 2px;
	color: #666;
}

.atbl-notice {
	padding: 8px 12px;
	border-left: 4px solid #d63638;
	background: #fcf0f1;
}

/* --- Mobile collapse ---
   Columns past the first fold into a child row behind an expander, which is
   how the tables behaved before. Applied by script, which adds the classes. */

table.atbl-table td.atbl-hidden,
table.atbl-table th.atbl-hidden {
	display: none;
}

table.atbl-table td.atbl-expander {
	padding-left: 30px;
	position: relative;
	cursor: pointer;
}

table.atbl-table td.atbl-expander::before {
	content: "+";
	position: absolute;
	left: 8px;
	top: 50%;
	transform: translateY(-50%);
	display: inline-block;
	width: 14px;
	height: 14px;
	line-height: 13px;
	text-align: center;
	font-weight: 700;
	color: #fff;
	background: #337ab7;
	border-radius: 14px;
	font-size: 12px;
}

table.atbl-table tr.atbl-open td.atbl-expander::before {
	content: "\2212";
}

table.atbl-table tr.atbl-child td {
	white-space: normal;
	padding: 8px 10px;
}

table.atbl-table tr.atbl-child ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

table.atbl-table tr.atbl-child li {
	padding: 3px 0;
}

table.atbl-table tr.atbl-child li span.atbl-child-label {
	display: inline-block;
	min-width: 40%;
	font-weight: 700;
}
