/*
 * WP Table Builder tables (academic calendar) matched to the old site:
 * https://buildemo.com/fusioncollegewp/academic-calendar/
 *
 * Light grey grid, white/grey zebra down the block rows, a white header and a
 * white merged Terms column, everything bold at 12px with the header and term
 * labels at 14px, and the break rows in orange.
 *
 * TWO selector prefixes, because there are two DOMs. WPTB prints
 * .wptb-container-legacy > table.wptb-preview-table server-side, then its
 * frontend script REBUILDS the whole thing on load as
 * .wptb-root > .wptb-table-wrapper > .wptb-table-container > table.wptb-table,
 * dropping every class and inline style it did not write itself. Styling only
 * the server markup leaves the finished page untouched - which is why the
 * colours never appeared. The legacy prefix stays so the table does not flash
 * unstyled before that script runs.
 *
 * Rows are addressed by position rather than class for the same reason: the
 * rebuild strips added classes. Each term is three rows - two study blocks then
 * a break - so :nth-child(3n+1) after the header is always the break row.
 *
 * The plugin writes the zebra and its black borders as element styles, so
 * everything that overrides those needs !important.
 *
 * The Terms column merge (rowspan) is markup, not style - the rebuild preserves
 * it, but it has to be in the source first: see inc/wptb-calendar.php.
 */

.wptb-container-legacy,
.wptb-root .wptb-table-wrapper {
	max-width: 100%;
	margin: 0 0 1.5rem;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.wptb-container-legacy .wptb-preview-table,
.wptb-root .wptb-table {
	margin: 0 auto !important;
	border: 1px solid #e0e0e0 !important;
	border-collapse: collapse !important;
	color: #3c4249;
}

.wptb-container-legacy .wptb-preview-table td,
.wptb-root .wptb-table td {
	padding: 10px !important;
	border: 1px solid #e0e0e0 !important;
	vertical-align: middle;
	font-size: 12px !important;
	font-weight: 700 !important;
	line-height: 1.4;
	text-align: left;
}

/* Header row: white behind it, a size larger, darker ink. */
.wptb-container-legacy .wptb-preview-table tr:first-child,
.wptb-container-legacy .wptb-preview-table tr:first-child td,
.wptb-root .wptb-table tr:first-child,
.wptb-root .wptb-table tr:first-child td {
	background: #fff !important;
}

.wptb-container-legacy .wptb-preview-table tr:first-child td,
.wptb-root .wptb-table tr:first-child td {
	color: #1a1a1a !important;
	font-size: 14px !important;
}

/*
 * The merged Terms cell stays white whatever the zebra does to its row - that
 * column reads as a spine down the left, not as a striped cell.
 */
.wptb-container-legacy .wptb-preview-table td[rowspan]:not([rowspan="1"]),
.wptb-root .wptb-table td[rowspan]:not([rowspan="1"]) {
	background: #fff !important;
	font-size: 14px !important;
}

/* Break rows: the third row of every term group. */
.wptb-container-legacy .wptb-preview-table tr:nth-child(3n+1):not(:first-child) td,
.wptb-root .wptb-table tr:nth-child(3n+1):not(:first-child) td {
	color: #ff5d00 !important;
}

/* The plugin wraps each cell's text in its own block; strip its spacing. */
.wptb-container-legacy .wptb-text-container,
.wptb-container-legacy .wptb-text-container > div,
.wptb-container-legacy .wptb-text-container p,
.wptb-root .wptb-cell-content,
.wptb-root .wptb-cell-content > div,
.wptb-root .wptb-cell-content p {
	margin: 0 !important;
	padding: 0 !important;
	color: inherit !important;
	font-size: inherit !important;
	font-weight: inherit !important;
}
