/**
 * Fallback styles for classic content tables when the theme leaves them bare.
 *
 * All selectors use :where() (specificity 0) so any real theme rule wins.
 * Disable entirely with: add_filter( 'rsifa_enqueue_content_styles', '__return_false' );
 */

:where(.wp-block-post-content table, .entry-content table, .wp-block-table table) {
	border-collapse: collapse;
	width: 100%;
	margin: 0 0 1.5em;
}

:where(.wp-block-post-content .wp-block-table, .entry-content .wp-block-table, .wp-block-table) {
	overflow-x: auto;
	margin: 0 0 1.5em;
	max-width: 100%;
}

:where(.wp-block-post-content .wp-block-table > table, .entry-content .wp-block-table > table) {
	margin-bottom: 0;
}

:where(
	.wp-block-post-content td,
	.wp-block-post-content th,
	.entry-content td,
	.entry-content th,
	.wp-block-table td,
	.wp-block-table th
) {
	border: 1px solid currentColor;
	padding: 0.5em 0.75em;
	vertical-align: top;
}

:where(.wp-block-post-content thead, .entry-content thead, .wp-block-table thead) {
	border-bottom: 3px solid currentColor;
}

:where(.wp-block-post-content tfoot, .entry-content tfoot, .wp-block-table tfoot) {
	border-top: 3px solid currentColor;
}

:where(.wp-block-post-content th, .entry-content th, .wp-block-table th) {
	font-weight: 700;
}

:where(.wp-block-post-content caption, .entry-content caption, .wp-block-table caption) {
	caption-side: top;
	text-align: center;
	font-size: 0.9em;
	opacity: 0.85;
	padding-bottom: 0.5em;
}

:where(.wp-block-post-content td table, .entry-content td table, .wp-block-table td table) {
	margin: 0.35em 0;
	width: 100%;
}
