/* Guide tables (seller resources). The push script wraps each table in <div class="fsbo-table">,
   adds data-label to every cell, marks amount columns with .fsbo-num, and adds .fsbo-table--stack
   when the table has 3+ columns that aren't all amounts. Stacked tables turn into one card per row on narrow screens.
   :is(#content, html) beats the theme's #content rules without !important. */

:is(#content, html) .fsbo-table {
	--fsbo-t-navy: var(--fsbo-dash-accent, #2b4c7e);
	--fsbo-t-cream: #f2ebdd;
	--fsbo-t-cream-2: #faf6ee;
	--fsbo-t-ink: #1d2327;
	--fsbo-t-muted: #5d6670;
	--fsbo-t-line: #e2ddd2;
	--fsbo-t-head: Oswald, "Arial Narrow", sans-serif;
	--fsbo-t-body: "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;
	container-type: inline-size;
	margin: 1.5em 0 2em;
	border: 1px solid var(--fsbo-t-line);
	border-radius: 10px;
	overflow-x: auto;
	background: #fff;
}

:is(#content, html) .fsbo-table table {
	width: 100%;
	margin: 0;
	border: 0;
	border-collapse: collapse;
	border-spacing: 0;
	font-family: var(--fsbo-t-body);
	font-size: 0.95em;
	line-height: 1.45;
	color: var(--fsbo-t-ink);
	background: transparent;
	table-layout: auto;
}

:is(#content, html) .fsbo-table th,
:is(#content, html) .fsbo-table td {
	padding: 11px 16px;
	border: 0;
	border-bottom: 1px solid var(--fsbo-t-line);
	text-align: left;
	vertical-align: top;
	background: transparent;
}

:is(#content, html) .fsbo-table thead th {
	background: var(--fsbo-t-navy);
	color: #fff;
	font-family: var(--fsbo-t-head);
	font-weight: 500;
	font-size: 1em;
	letter-spacing: 0.03em;
	text-transform: none;
	white-space: nowrap;
	border-bottom: 0;
}

:is(#content, html) .fsbo-table tbody tr:nth-child(even) td {
	background: var(--fsbo-t-cream-2);
}

:is(#content, html) .fsbo-table tbody tr:last-child td {
	border-bottom: 0;
}

/* First column names the row. */
:is(#content, html) .fsbo-table tbody td:first-child {
	font-weight: 600;
	color: var(--fsbo-t-ink);
}

:is(#content, html) .fsbo-table .fsbo-num {
	text-align: right;
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}

:is(#content, html) .fsbo-table td a {
	color: var(--fsbo-t-navy);
	text-decoration: underline;
	text-underline-offset: 2px;
}

/* Narrow, tables that stay tables (label + amounts): tighter cells and wrapping headers so they fit a phone. */
@container (max-width: 560px) {
	:is(#content, html) .fsbo-table:not(.fsbo-table--stack) th,
	:is(#content, html) .fsbo-table:not(.fsbo-table--stack) td {
		padding: 9px 10px;
	}

	:is(#content, html) .fsbo-table:not(.fsbo-table--stack) table {
		font-size: 0.9em;
	}

	:is(#content, html) .fsbo-table:not(.fsbo-table--stack) thead th {
		white-space: normal;
	}
}

/* Narrow: 3+ column tables become one card per row, each cell labeled by its column. */
@container (max-width: 560px) {
	:is(#content, html) .fsbo-table--stack table,
	:is(#content, html) .fsbo-table--stack tbody,
	:is(#content, html) .fsbo-table--stack tr,
	:is(#content, html) .fsbo-table--stack td {
		display: block;
		box-sizing: border-box;
		width: 100%;
	}

	:is(#content, html) .fsbo-table--stack thead {
		display: none;
	}

	:is(#content, html) .fsbo-table--stack tbody tr {
		padding: 12px 16px;
		border-bottom: 1px solid var(--fsbo-t-line);
	}

	:is(#content, html) .fsbo-table--stack tbody tr:last-child {
		border-bottom: 0;
	}

	:is(#content, html) .fsbo-table--stack tbody tr:nth-child(even) {
		background: var(--fsbo-t-cream-2);
	}

	:is(#content, html) .fsbo-table--stack tbody tr td,
	:is(#content, html) .fsbo-table--stack tbody tr:nth-child(even) td,
	:is(#content, html) .fsbo-table--stack tbody tr td.fsbo-num {
		padding: 3px 0;
		border: 0;
		background: transparent;
		text-align: left;
		white-space: normal;
	}

	:is(#content, html) .fsbo-table--stack td:first-child {
		padding-bottom: 6px;
		font-size: 1.05em;
	}

	:is(#content, html) .fsbo-table--stack td:not(:first-child)[data-label]::before {
		content: attr(data-label);
		display: block;
		font-size: 0.78em;
		font-weight: 700;
		letter-spacing: 0.03em;
		text-transform: uppercase;
		color: var(--fsbo-t-muted);
	}
}

/* Attorney notice (0.15.3): push_guides.py puts it after the intro of guides that cite statutes.
   A solid amber caution box so it can't be missed. */
:is(#content, html) .fsbo-guide-notice {
	position: relative;
	margin: 1.5em 0 2em;
	padding: 18px 22px 18px 64px;
	border: 2px solid #d99a1e;
	border-radius: 10px;
	background: #fde9b3;
	color: #3b2a05;
	font-family: "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;
	font-size: 1.05em;
	line-height: 1.5;
	box-shadow: 0 2px 0 rgba(0, 0, 0, 0.06);
}

:is(#content, html) .fsbo-guide-notice::before {
	content: "!";
	position: absolute;
	top: 18px;
	left: 20px;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	background: #b36b00;
	color: #fff;
	font: 700 20px/30px Oswald, "Arial Narrow", sans-serif;
	text-align: center;
}

:is(#content, html) .fsbo-guide-notice strong {
	display: block;
	margin-bottom: 0.3em;
	color: #7a4300;
	font-family: Oswald, "Arial Narrow", sans-serif;
	font-weight: 600;
	font-size: 1.2em;
	letter-spacing: 0.02em;
	text-transform: uppercase;
}

@media (max-width: 480px) {
	:is(#content, html) .fsbo-guide-notice {
		padding: 16px 16px 16px 56px;
	}
	:is(#content, html) .fsbo-guide-notice::before {
		left: 14px;
	}
}
