/**
 * EquityBankLoan HEI Compare.
 *
 * Reuses the site palette from equitybankloan-core (ebl-site.css and
 * ebl-compare.css). Every variable has a fallback so the section still reads
 * correctly if core is inactive.
 *
 * House rules: no side accent stripes, no shadow bars, no quote bars.
 * Emphasis uses full-cell backgrounds and full borders only.
 */

.ebl-hei-cmp {
	--hei-ink: var(--ebl-ink, #1b2230);
	--hei-soft: #55636f;
	--hei-line: var(--ebl-line, #e0e5ec);
	--hei-faint: #eef2f6;
	--hei-alt: var(--ebl-surface-alt, #f6f8fa);
	--hei-navy: var(--ebl-navy, #001d49);
	--hei-unknown: #3f4a8a;
	--hei-unknown-bg: #f0f1fa;
	--hei-flag: #7a4a12;
	--hei-flag-bg: #fbf4ea;
	--hei-radius: var(--ebl-radius, 6px);

	color: var(--hei-ink);
	margin: 2.4rem 0 1.8rem;
}

/* Prose keeps the reading measure; the table may use the full width. */
.ebl-hei-cmp > h2,
.ebl-hei-cmp > h3,
.ebl-hei-cmp > p,
.ebl-hei-cmp > ul,
.ebl-hei-cmp__explainer {
	max-width: var(--ebl-measure, 800px);
}

.ebl-hei-cmp__explainer {
	background: var(--hei-alt);
	border: 1px solid var(--hei-line);
	border-radius: var(--hei-radius);
	margin: 0 0 1.25em;
	padding: 1em 1.2em;
}

.ebl-hei-cmp__explainer p {
	margin: 0 0 0.7em;
}

.ebl-hei-cmp__explainer p:last-child {
	margin-bottom: 0;
}

.ebl-hei-cmp__scenario {
	font-size: 0.95em;
	margin: 0 0 1em;
}

.ebl-hei-cmp__stale {
	background: var(--hei-flag-bg);
	border: 1px solid var(--hei-line);
	border-radius: var(--hei-radius);
	color: var(--hei-flag);
	font-weight: 600;
	padding: 0.7em 1em;
}

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

.ebl-hei-cmp__wrap {
	margin: 0 0 0.9em;
	max-width: none;
}

.entry-content .ebl-hei-cmp__table,
.ebl-hei-cmp__table {
	border-collapse: collapse;
	font-size: 0.9em;
	margin: 0;
	table-layout: auto;
	width: 100%;
}

.ebl-hei-cmp__table th,
.ebl-hei-cmp__table td {
	border: 1px solid var(--hei-line);
	padding: 0.6em 0.65em;
	text-align: left;
	vertical-align: top;
}

.ebl-hei-cmp__table thead th {
	background: var(--hei-alt);
	color: var(--hei-soft);
	font-size: 0.82em;
	font-weight: 600;
	letter-spacing: 0.02em;
	text-transform: uppercase;
}

.ebl-hei-cmp__table thead th.ebl-hei-cmp__company {
	color: var(--hei-ink);
	font-size: 1em;
	letter-spacing: 0;
	text-transform: none;
	width: 27%;
}

.ebl-hei-cmp__table tbody th {
	background: var(--hei-alt);
	font-weight: 600;
	width: 19%;
}

.ebl-hei-cmp__name {
	color: var(--hei-navy);
	display: block;
	font-size: 1.1em;
	font-weight: 650;
}

.ebl-hei-cmp__calls {
	color: var(--hei-soft);
	display: block;
	font-size: 0.85em;
	font-weight: 400;
}

.ebl-hei-cmp__value {
	display: block;
	font-weight: 600;
}

/* "Not published" is an answer, the same weight as a figure. */
.ebl-hei-cmp__unpublished {
	color: var(--hei-unknown);
	display: block;
	font-weight: 600;
}

.ebl-hei-cmp__flag {
	background: var(--hei-flag-bg);
	border: 1px solid #ead9bf;
	border-radius: 3px;
	color: var(--hei-flag);
	display: inline-block;
	font-size: 0.8em;
	font-weight: 600;
	margin-top: 0.3em;
	padding: 0.1em 0.45em;
}

.ebl-hei-cmp__note,
.ebl-hei-cmp__checked {
	color: var(--hei-soft);
	display: block;
	font-size: 0.85em;
	line-height: 1.45;
	margin-top: 0.25em;
}

.ebl-hei-cmp__sources {
	display: block;
	font-size: 0.9em;
	line-height: 1.5;
}

.ebl-hei-cmp__list {
	border: 0;
	margin-top: 0.3em;
}

.entry-content .ebl-hei-cmp__list summary,
.ebl-hei-cmp__list summary {
	font-size: 0.85em;
	min-height: 0;
	padding: 0.15em 0;
}

.ebl-hei-cmp__list p {
	font-size: 0.85em;
	margin: 0.3em 0 0;
}

.ebl-hei-cmp__caveat {
	color: var(--hei-soft);
	font-size: 0.85em;
	line-height: 1.55;
	margin: 0 0 1.5em;
}

/* Companies with fewer published terms ------------------------------------ */

.ebl-hei-cmp__subhead {
	font-size: 1.2em;
	margin: 1.4em 0 0.6em;
}

.ebl-hei-cmp__cards {
	display: none;
	list-style: none;
	margin: 0 0 1em;
	padding: 0;
}

.ebl-hei-cmp__cards .ebl-hei-cmp__card {
	margin: 0 0 1em;
}

.ebl-hei-cmp__limited {
	display: grid;
	gap: 1em;
	grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
	list-style: none;
	margin: 0 0 1.5em;
	padding: 0;
}

.ebl-hei-cmp__card {
	border: 1px solid var(--hei-line);
	border-radius: var(--hei-radius);
	margin: 0;
	padding: 0.9em 1em;
}

.ebl-hei-cmp__card-head .ebl-hei-cmp__name,
.ebl-hei-cmp__card-head .ebl-hei-cmp__calls {
	display: block;
}

.ebl-hei-cmp__card-head {
	border-bottom: 1px solid var(--hei-faint);
	margin: 0 0 0.6em;
	padding-bottom: 0.5em;
}

.ebl-hei-cmp__facts {
	font-size: 0.92em;
	margin: 0 0 0.5em;
}

.ebl-hei-cmp__facts dt {
	color: var(--hei-soft);
	font-size: 0.85em;
	font-weight: 600;
	margin-top: 0.5em;
}

.ebl-hei-cmp__facts dd {
	margin: 0.1em 0 0;
}

.ebl-hei-cmp__card-source {
	font-size: 0.9em;
	margin: 0.6em 0 0;
}

.ebl-hei-cmp__next li {
	margin-bottom: 0.45em;
}

/* Narrow screens: the table is swapped for one card per company --------- */

@media (max-width: 860px) {

	.ebl-hei-cmp__wrap {
		display: none;
	}

	.ebl-hei-cmp__cards {
		display: block;
	}
}

/* Pillar guide tables (/heloc-vs-home-equity-investment/): tint the label column. */
.entry-content > .wp-block-table.ebl-hei-compare tbody td:first-child,
.entry-content > .wp-block-table.ebl-hei-providers tbody td:first-child {
	background: var(--ebl-surface-alt, #f6f8fa);
}

@media (max-width: 700px) {
	.entry-content > .wp-block-table.ebl-hei-compare table,
	.entry-content > .wp-block-table.ebl-hei-providers table {
		min-width: 620px;
	}
}
