/* ============================================
   BANJO TABLEPRESS STYLING
   ============================================ */
/* --- Colour and spacing variables --- */
.tablepress {
	--style-variation: custom;
	--text-color: #30003c;
	--head-text-color: #ffffff;
	--head-bg-color: #30003c;
	--head-active-bg-color: #30003c;
	--hover-text-color: #ffffff;
	--hover-bg-color: #595d5d;
	--even-bg-color: #f1efeb;
	--odd-bg-color: #ffffff;
	--border-color: #000000;
	--padding: .8rem;
}

/* --- Force table wrappers to fill their Oxygen section --- */
/* Oxygen's .ct-section-inner-wrap is a flex container, so the
   shortcode div shrinks to fit unless stretched */
.ct-section-inner-wrap > .ct-shortcode {
	width: 100% !important;
	align-self: stretch !important;
}

.tablepress-scroll-buttons-wrapper,
.tablepress-scroll-wrapper {
	width: 100% !important;
}

/* --- Table frame --- */
.tablepress {
	font-family: 'Inter', sans-serif !important;
	border-collapse: collapse !important;
	border: 1px solid var(--border-color) !important;
	width: 100% !important;
}

/* --- Fixed layout so column widths are respected --- */
/* Skipped on tables with merged cells, which need auto layout */
.tablepress:not(:has([colspan])):not(:has([rowspan])) {
	table-layout: fixed !important;
}

/* --- All cells --- */
.tablepress th,
.tablepress td {
	font-family: 'Inter', sans-serif !important;
	text-align: center !important;
	vertical-align: middle !important;
	border: 1px solid var(--border-color) !important;
	padding: var(--padding) !important;
}

/* --- Header row --- */
.tablepress thead th {
	background-color: var(--head-bg-color) !important;
	color: var(--head-text-color) !important;
	font-weight: 700 !important;
}

/* --- Bullet blocks --- */
/* Wrap bullet content in the table cell like this:
<span class="bullets">&bull; Item one<br>&bull; Item two</span> */
.tablepress td:has(.bullets) {
	text-align: left !important;
}

.tablepress .bullets,
.tablepress td .bullets,
.tablepress th .bullets,
.tablepress tbody tr td span.bullets {
	display: inline-block !important;
	text-align: left !important;
}

/* --- Consistent label column across tables --- */
.tablepress th:first-child:not([colspan]),
.tablepress td:first-child:not([colspan]) {
	width: 20% !important;
}

/* --- Even distribution of remaining columns --- */
/* 2 columns total: one value column takes the rest */
.tablepress tr > :nth-child(2):nth-last-child(1):not([colspan]) {
	width: 80% !important;
}

/* 3 columns total: two value columns at 40% each */
.tablepress tr > :nth-child(2):nth-last-child(2):not([colspan]),
.tablepress tr > :nth-child(2):nth-last-child(2) ~ :not([colspan]) {
	width: 40% !important;
}

/* 4 columns total: three value columns at 26.66% each */
.tablepress tr > :nth-child(2):nth-last-child(3):not([colspan]),
.tablepress tr > :nth-child(2):nth-last-child(3) ~ :not([colspan]) {
	width: 26.66% !important;
}

/* 5 columns total: four value columns at 20% each */
.tablepress tr > :nth-child(2):nth-last-child(4):not([colspan]),
.tablepress tr > :nth-child(2):nth-last-child(4) ~ :not([colspan]) {
	width: 20% !important;
}

/* 6 columns total: five value columns at 16% each */
.tablepress tr > :nth-child(2):nth-last-child(5):not([colspan]),
.tablepress tr > :nth-child(2):nth-last-child(5) ~ :not([colspan]) {
	width: 16% !important;
}

/* 7 columns total: six value columns at 13.33% each */
.tablepress tr > :nth-child(2):nth-last-child(6):not([colspan]),
.tablepress tr > :nth-child(2):nth-last-child(6) ~ :not([colspan]) {
	width: 13.33% !important;
}

/* --- Alternating rows --- */
.tablepress tbody tr:nth-child(even) td,
.tablepress tbody tr.even td {
	background-color: var(--even-bg-color) !important;
}

.tablepress tbody tr:nth-child(odd) td,
.tablepress tbody tr.odd td {
	background-color: var(--odd-bg-color) !important;
}

/* --- Row hover --- */
.tablepress tbody tr:hover td {
	background-color: var(--hover-bg-color) !important;
	color: var(--hover-text-color) !important;
}

/* --- Responsive scroll wrapper --- */
.tablepress-scroll-wrapper {
	width: 100% !important;
}

/* ============================================
   PER-TABLE OVERRIDES
   Must stay at the end of this file.
   ============================================ */
/* --- Business Loan Pricing Structure --- */
/* This table has no merged cells, so the fixed-layout rule above
   catches it, and the 7-column rule pins its six rate columns to
   13.33% each. On a 430px viewport that is roughly 45px per column,
   well under the ~150px that a value like 13.95% needs at 16px Inter.
   Fixed layout ignores minimum content width, so the text overflows
   and overlaps instead of wrapping.
   Fix: opt this one table out and let it size to its content, then
   scroll horizontally using the wrapper that is already in the DOM.
   Everything else on the site is unaffected. */
#tablepress-BusinessLoan-Pricing {
	table-layout: auto !important;
	width: auto !important;
	min-width: 100% !important;
	max-width: none !important;
}

/* Clears the 20% and 13.33% width rules above for this table only */
#tablepress-BusinessLoan-Pricing th,
#tablepress-BusinessLoan-Pricing td {
	width: auto !important;
	white-space: nowrap;
}

/* Label column holds long text, so let it wrap */
#tablepress-BusinessLoan-Pricing th.column-1,
#tablepress-BusinessLoan-Pricing td.column-1 {
	white-space: normal;
	min-width: 140px;
	max-width: 240px;
}