/*
 * GarfNet Info DB v2 stylesheet.
 *
 * Presentation for tables produced by the [garf-info-2] shortcode.
 */


/* -------------------------------------------------------------
 * Outer table wrapper
 * ------------------------------------------------------------- */

.garf-info-2-table-wrap {
	overflow-x: auto;
	width: 100%;
	margin: 1em 0;
}


/* -------------------------------------------------------------
 * Main table
 * ------------------------------------------------------------- */

.garf-info-2-table {
	width: 100%;
	border-collapse: collapse;
	border-spacing: 0;
	table-layout: auto;
}


/* -------------------------------------------------------------
 * Table headings
 * ------------------------------------------------------------- */

.garf-info-2-table th {
	padding: 0.6em 0.75em;
	text-align: left;
	font-weight: 600;
	vertical-align: bottom;

	border: 0;
	border-bottom: 2px solid #999;

	background: transparent;
	color: inherit;

	white-space: normal;
}


/* -------------------------------------------------------------
 * Sortable headings
 *
 * These are ordinary links because sorting is performed
 * server-side by PHP.
 *
 * Explicitly suppress theme-generated link arrows/icons.
 * ------------------------------------------------------------- */

.garf-info-2-table th a,
.garf-info-2-table th button {
	display: inline;

	padding: 0 !important;
	margin: 0 !important;

	border: 0 !important;
	border-radius: 0 !important;

	background: transparent !important;
	background-image: none !important;

	color: inherit !important;
	font: inherit;
	font-weight: inherit;

	text-decoration: none;

	box-shadow: none !important;
	text-shadow: none;

	cursor: pointer;
}

/*
 * Some WordPress themes add an arrow or icon to links using
 * ::before or ::after. The GarfNet renderer supplies its own
 * sort indicator, so suppress any theme-generated decoration.
 */

.garf-info-2-table th a::before,
.garf-info-2-table th a::after,
.garf-info-2-table th button::before,
.garf-info-2-table th button::after {
	content: none !important;
	display: none !important;
}


/* -------------------------------------------------------------
 * Sortable heading hover/focus
 * ------------------------------------------------------------- */

.garf-info-2-table th a:hover,
.garf-info-2-table th a:focus,
.garf-info-2-table th button:hover,
.garf-info-2-table th button:focus {
	padding: 0 !important;
	margin: 0 !important;

	background: transparent !important;
	color: inherit !important;

	text-decoration: underline;

	box-shadow: none !important;
	outline-offset: 2px;
}


/* -------------------------------------------------------------
 * Sort indicators
 * ------------------------------------------------------------- */

.garf-info-2-sort-indicator {
	display: inline-block;

	margin-left: 0.35em;

	font-size: 0.75em;
	line-height: 1;

	opacity: 0.65;

	vertical-align: middle;
	white-space: nowrap;
}

.garf-info-2-sort {
	white-space: normal;
	text-align: left !important;
}


/* -------------------------------------------------------------
 * Table cells
 * ------------------------------------------------------------- */

.garf-info-2-table td {
	padding: 0.5em 0.75em;

	text-align: left;
	vertical-align: top;

	border: 0;
	border-bottom: 1px solid #ddd;

	overflow-wrap: normal;
	word-break: normal;
	white-space: normal;
}


/* -------------------------------------------------------------
 * Alternating rows
 * ------------------------------------------------------------- */

.garf-info-2-table tbody tr:nth-child(even) {
	background-color: rgba(0, 0, 0, 0.035);
}


/* -------------------------------------------------------------
 * Row hover
 * ------------------------------------------------------------- */

.garf-info-2-table tbody tr:hover {
	background-color: rgba(0, 0, 0, 0.07);
}


/* -------------------------------------------------------------
 * Error messages
 * ------------------------------------------------------------- */

.garf-info-2-error {
	padding: 0.75em 1em;

	border-left: 4px solid #c00;

	background: #f8f8f8;
	color: #333;
}


/* -------------------------------------------------------------
 * Audio controls
 * ------------------------------------------------------------- */

.garf-info-2-table audio {
	max-width: 100%;
}


/* -------------------------------------------------------------
 * Pagination
 * ------------------------------------------------------------- */

.garf-info-2-pagination {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.75em;

	margin: 1em 0;
	padding: 0.25em 0;

	font-size: 0.95em;
	line-height: 1.5;
}


/* -------------------------------------------------------------
 * Pagination status
 * ------------------------------------------------------------- */

.garf-info-2-page-summary {
	margin-right: 0.5em;

	color: inherit;
	font-weight: 500;

	white-space: nowrap;
}


/* -------------------------------------------------------------
 * Pagination links container
 * ------------------------------------------------------------- */

.garf-info-2-page-links {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.35em;
}


/* -------------------------------------------------------------
 * Pagination links
 * ------------------------------------------------------------- */

.garf-info-2-pagination .garf-info-2-page-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;

	min-width: 2.2em;
	min-height: 2.2em;

	padding: 0.25em 0.55em;

	border: 1px solid #ccc;
	border-radius: 4px;

	background: #fff;
	color: inherit;

	text-decoration: none;

	box-sizing: border-box;

	transition:
		background-color 0.15s ease,
		border-color 0.15s ease,
		color 0.15s ease;
}


/* -------------------------------------------------------------
 * Pagination link hover/focus
 * ------------------------------------------------------------- */

.garf-info-2-pagination .garf-info-2-page-link:hover,
.garf-info-2-pagination .garf-info-2-page-link:focus {
	border-color: #888;

	background: #f3f3f3;

	text-decoration: none;
}


/* -------------------------------------------------------------
 * Current page
 * ------------------------------------------------------------- */

.garf-info-2-pagination .garf-info-2-current-page {
	border-color: #666;

	background: #666;
	color: #fff;

	font-weight: 600;
}


/* -------------------------------------------------------------
 * Pagination ellipsis
 * ------------------------------------------------------------- */

.garf-info-2-pagination .garf-info-2-page-gap {
	display: inline-flex;
	align-items: center;
	justify-content: center;

	min-width: 1.5em;

	color: #666;
}


/* -------------------------------------------------------------
 * Previous / next links
 * ------------------------------------------------------------- */

.garf-info-2-pagination .garf-info-2-page-link {
	font-weight: 500;
}


/* -------------------------------------------------------------
 * Small-screen pagination
 * ------------------------------------------------------------- */

@media (max-width: 600px) {

	.garf-info-2-pagination {
		align-items: flex-start;
		flex-direction: column;

		gap: 0.6em;
	}

	.garf-info-2-page-summary {
		margin-right: 0;
	}

	.garf-info-2-page-links {
		width: 100%;
	}

	.garf-info-2-pagination .garf-info-2-page-link {
		min-width: 2.4em;
		min-height: 2.4em;
	}

}
