/*
 * AP Tables — Client Theme
 *
 * Visual customisation only.
 * Interactive behaviour remains controlled by the plugin.
 */


/* ==========================================================================
   TYPOGRAPHY
   ==========================================================================

   Keep this section separate so the client's new site typography can be
   adjusted without changing the table's visual treatment.
   */

.ap-table {
	font-family: "Noto Sans",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";
	font-size: 1.5rem;
	line-height: 1.5;
	color: #1d0000;
}

.ap-table th {
	font-size: 1.6rem;
	font-weight: 700;
	line-height: 1.4;
}

.ap-table td {
	line-height: 1.5;
}

.ap-table .ap-table-column-label,
.ap-table-entry-head {
	font-size: 1.5rem;
	font-weight: 700;
}


/* ==========================================================================
   TABLE
   ========================================================================== */

.ap-table-scroll {
	width: 100%;
}

.ap-table table {
	border-collapse: collapse;
	width: max-content;
	min-width: 100%;
}

.ap-table th,
.ap-table td {
	border: 1px solid #949494;
	padding: 1rem;
	vertical-align: top;
	text-align: left;
}

.ap-table td {
	min-width: 250px;
}


/* ==========================================================================
   HEADER
   ========================================================================== */

.ap-table thead th {
	font-weight: 700;
}

/* Keep the header visible while scrolling vertically. */
.ap-table thead th {
	position: sticky;
	top: 0;
	z-index: 10;
}


/* ==========================================================================
   COLUMN COLOURS
   ==========================================================================

   Column 1 is the row-label column.
   Columns 2–14 use the original client's pastel palette.

   These are intentionally nth-child based so the colours continue to follow
   the physical columns when the frontend column controls hide/show columns.
   */

.ap-table thead th {
	background: #d3d3d3;
}

.ap-table thead th:nth-child(13n+2) {
	background: #CEBEC2;
}

.ap-table thead th:nth-child(13n+3) {
	background: #C0C8CB;
}

.ap-table thead th:nth-child(13n+4) {
	background: #BFCAC3;
}

.ap-table thead th:nth-child(13n+5) {
	background: #CBCAC0;
}

.ap-table thead th:nth-child(13n+6) {
	background: #C0C0CB;
}

.ap-table thead th:nth-child(13n+7) {
	background: #CFBCBC;
}

.ap-table thead th:nth-child(13n+8) {
	background: #BBC5D1;
}

.ap-table thead th:nth-child(13n+9) {
	background: #C2CABF;
}

.ap-table thead th:nth-child(13n+10) {
	background: #C8C8B3;
}

.ap-table thead th:nth-child(13n+11) {
	background: #C8C0CB;
}

.ap-table thead th:nth-child(13n+12) {
	background: #C1C6C7;
}

.ap-table thead th:nth-child(13n) {
	background: #D0C8B9;
}

/* Body uses a lighter version of the same palette. */

.ap-table tbody td:nth-child(1) {
	background: #ffffff;
}

.ap-table tbody td:nth-child(13n+2) {
	background: #EEE9EA;
}

.ap-table tbody td:nth-child(13n+3) {
	background: #EAECED;
}

.ap-table tbody td:nth-child(13n+4) {
	background: #E9EDEB;
}

.ap-table tbody td:nth-child(13n+5) {
	background: #EDEDEA;
}

.ap-table tbody td:nth-child(13n+6) {
	background: #EAEAED;
}

.ap-table tbody td:nth-child(13n+7) {
	background: #EFE8E8;
}

.ap-table tbody td:nth-child(13n+8) {
	background: #E8EBEF;
}

.ap-table tbody td:nth-child(13n+9) {
	background: #EAEDE9;
}

.ap-table tbody td:nth-child(13n+10) {
	background: #EDECE9;
}

.ap-table tbody td:nth-child(13n+11) {
	background: #ECEAED;
}

.ap-table tbody td:nth-child(13n+12) {
	background: #EAECEC;
}

.ap-table tbody td:nth-child(13n) {
	background: #EFECE7;
}


/* ==========================================================================
   ROW LABEL / FIRST COLUMN
   ========================================================================== */

.ap-table tbody td:first-child {
	font-weight: 700;
}


/* ==========================================================================
   TOOLBAR
   ========================================================================== */

.ap-table-toolbar {
	margin-bottom: 2rem;
}

.ap-table-toolbar,
.ap-table-toolbar button,
.ap-table-search,
.ap-table-column-chooser {
	font-size: 1rem;
}

.ap-table-toolbar button {
	font: inherit;
}

.ap-table-search input {
	font: inherit;
}


/* ==========================================================================
   COLUMN CHOOSER
   ========================================================================== */

.ap-table-column-chooser {
	border: 1px solid #949494;
	padding: 2rem;
	background: #fff;
}

.ap-table-column-chooser label {
	color: #1d0000;
	font-weight: 700;
}

.ap-table-column-chooser-actions {
	margin-top: 2rem;
}


/* ==========================================================================
   SORTING
   ========================================================================== */

.ap-table-sort-button {
	color: inherit;
}

.ap-table-sort-button:hover {
	text-decoration: underline;
}


/* ==========================================================================
   HIDDEN COLUMNS
   ========================================================================== */

.ap-table .ap-table-column-hidden {
	display: none;
}


/* ==========================================================================
   FIT MODE
   ========================================================================== */

.ap-table--fit table {
	width: 100%;
	min-width: 100%;
}

.ap-table--fit th,
.ap-table--fit td {
	min-width: 0;
}

/* ==========================================================================
   SEARCH
   ========================================================================== */

.ap-table-search-input {
	border: 1px solid #bbbbbb;
	background: #fff;
}

.ap-table-search-input::placeholder { color: #8C8C8C; }

.ap-table-search-input:focus {
	border-color: #2271b1;
	outline: 1px solid #2271b1;
}

.ap-table-search-clear {
	color: #1d0000;
}

.ap-table-search-clear:hover {
	color: #111;
}

.ap-table-search-clear:focus {
	outline: 1px solid #2271b1;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 64.06125em) {

	.ap-table-scroll {
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
	}

	.ap-table th,
	.ap-table td {
		padding: 1.5rem;
	}

	.ap-table td {
		min-width: 250px;
	}

}

/* ==========================================================================
   CONTROLS
   ========================================================================== */

.ap-table button:not(.ap-table-sort-button):not(.ap-table-search-clear) {
	 color: #1d0000;
	 border-radius: 100px;
	 border-width: 1px;
	 border-style: solid;
	 border-color: #1d0000;
	 position: relative;

	 &::after {

		 content: '';
		 position: absolute;
		 inset: -1.5px;
		 border-width: 2px;
		 border-style: dotted;
		 border-radius: 100px;
		 border-color: #1d0000;
		 border-color: transparent;

	 }

 }

 .ap-table button:not(.ap-table-sort-button):not(.ap-table-search-clear):hover {

	 border-color: transparent;

	 &::after {
		 border-color: #1d0000;
	 }

 }

 .ap-table button:not(.ap-table-sort-button):not(.ap-table-search-clear):hover {
	  background: white;
  }

.ap-table-column-option { font-weight: 700; color: #1d0000; }

.ap-table-column-option input[type="checkbox"] {
	border-color: #b93045;
	background: #fff;
}

.ap-table-column-option input[type="checkbox"]:checked {
	background: #b93045;
	border-color: #b93045;
}

.ap-table-column-option input[type="checkbox"]:checked::before {
	border-color: #fff;
}

.ap-table-row-toggle::before {
	color: #fff;
	background: #1d0000;
}


.ap-table-disclaimer { margin-top: 1em; }
