/**
 * SBC Jurisdiction Requirements Library — front-end styles.
 *
 * Self-contained: no framework, no web fonts, no CDN. Everything is scoped
 * under .sbc-jl so it cannot collide with a theme and survives a theme change.
 * The palette matches the SBC Quick Code Reference matrix so the two tables
 * read as one family.
 */

.sbc-jl {
	--sbc-jl-head: #074a53;
	--sbc-jl-topic: #0e8b98;
	--sbc-jl-line: #d5dde0;
	--sbc-jl-stripe: #f4f8f9;
	--sbc-jl-text: #16242a;
	--sbc-jl-muted: #5d7076;
	--sbc-jl-focus: #0e8b98;

	box-sizing: border-box;
	color: var(--sbc-jl-text);
	font-size: 15px;
	line-height: 1.45;
	margin: 0 0 2rem;
}

.sbc-jl *,
.sbc-jl *::before,
.sbc-jl *::after {
	box-sizing: inherit;
}

/* ------------------------------------------------------------------ tools */

.sbc-jl__tools {
	align-items: flex-end;
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem 1rem;
	justify-content: space-between;
	margin: 0 0 0.85rem;
}

.sbc-jl__search {
	display: block;
	flex: 1 1 16rem;
	max-width: 26rem;
}

.sbc-jl__search-label {
	color: var(--sbc-jl-muted);
	display: block;
	font-size: 0.8rem;
	font-weight: 700;
	letter-spacing: 0.03em;
	margin-bottom: 0.25rem;
	text-transform: uppercase;
}

.sbc-jl__search-input {
	border: 1px solid var(--sbc-jl-line);
	border-radius: 4px;
	font: inherit;
	padding: 0.45rem 0.6rem;
	width: 100%;
}

.sbc-jl__search-input:focus {
	border-color: var(--sbc-jl-focus);
	outline: 2px solid var(--sbc-jl-focus);
	outline-offset: 1px;
}

.sbc-jl__count {
	color: var(--sbc-jl-muted);
	font-size: 0.85rem;
	margin: 0;
}

.sbc-jl__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.sbc-jl__button {
	background: var(--sbc-jl-head);
	border: 1px solid var(--sbc-jl-head);
	border-radius: 4px;
	color: #fff;
	cursor: pointer;
	display: inline-block;
	font: inherit;
	font-size: 0.85rem;
	font-weight: 600;
	line-height: 1.3;
	padding: 0.5rem 0.9rem;
	text-decoration: none;
}

.sbc-jl__button:hover,
.sbc-jl__button:focus {
	background: #05343a;
	border-color: #05343a;
	color: #fff;
	text-decoration: none;
}

.sbc-jl__button:focus-visible {
	outline: 2px solid var(--sbc-jl-focus);
	outline-offset: 2px;
}

/* ------------------------------------------------------------------ table */

.sbc-jl__scroll {
	border: 1px solid var(--sbc-jl-line);
	border-radius: 4px;
	overflow-x: auto;
	position: relative;
}

.sbc-jl__scroll:focus-visible {
	outline: 2px solid var(--sbc-jl-focus);
	outline-offset: 2px;
}

.sbc-jl__table {
	border-collapse: separate;
	border-spacing: 0;
	margin: 0;
	width: 100%;
}

.sbc-jl__table th,
.sbc-jl__table td {
	border-bottom: 1px solid var(--sbc-jl-line);
	border-right: 1px solid var(--sbc-jl-line);
	font-size: 0.88rem;
	padding: 0.5rem 0.65rem;
	text-align: left;
	vertical-align: top;
}

.sbc-jl__table th:last-child,
.sbc-jl__table td:last-child {
	border-right: 0;
}

.sbc-jl__table tbody tr:last-child th,
.sbc-jl__table tbody tr:last-child td {
	border-bottom: 0;
}

/*
 * The header row is deliberately not sticky vertically. The theme already has
 * a fixed site header, and a second sticky band underneath it collides with
 * that one. Only the Topic column freezes, and only horizontally.
 */
.sbc-jl__th {
	background: var(--sbc-jl-head);
	color: #fff;
	font-weight: 700;
}

.sbc-jl__th--topic {
	left: 0;
	min-width: 16rem;
	position: sticky;
	z-index: 7;
}

/* Topic column: green with white letters, frozen to the left edge. */

.sbc-jl__topic {
	background: var(--sbc-jl-topic);
	color: #fff;
	font-weight: 600;
	left: 0;
	min-width: 16rem;
	position: sticky;
	z-index: 3;
}

.sbc-jl__topic a {
	color: #fff;
	text-decoration: underline;
}

.sbc-jl__topic a:hover,
.sbc-jl__topic a:focus {
	color: #fff;
	text-decoration: none;
}

.sbc-jl__topic a:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

/* The two right-hand columns stay light. */

.sbc-jl__cell {
	background: #fff;
}

.sbc-jl__cell--state {
	font-weight: 600;
	white-space: nowrap;
}

.sbc-jl__cell a {
	color: #0a6a75;
}

.sbc-jl__table tbody tr:nth-child(even) .sbc-jl__cell {
	background: var(--sbc-jl-stripe);
}

.sbc-jl__table tbody tr:hover .sbc-jl__cell {
	background: #eef6f7;
}

.sbc-jl__row--hidden {
	display: none;
}

.sbc-jl__empty {
	color: var(--sbc-jl-muted);
	margin: 1rem 0 0;
}

/* ----------------------------------------------------------------- narrow */

@media ( max-width: 782px ) {

	.sbc-jl__tools {
		align-items: stretch;
		flex-direction: column;
	}

	.sbc-jl__search {
		max-width: none;
	}

	.sbc-jl__th--topic,
	.sbc-jl__topic {
		min-width: 11rem;
	}

	.sbc-jl__table th,
	.sbc-jl__table td {
		font-size: 0.82rem;
		padding: 0.4rem 0.5rem;
	}
}

/* ------------------------------------------------------------------ print */

@media print {

	.sbc-jl__tools {
		display: none !important;
	}

	.sbc-jl__scroll {
		border: 0;
		overflow: visible;
	}

	.sbc-jl__table {
		font-size: 8pt;
	}

	.sbc-jl__th,
	.sbc-jl__topic {
		position: static;
	}

	.sbc-jl__th {
		-webkit-print-color-adjust: exact;
		background: #074a53 !important;
		color: #fff !important;
		print-color-adjust: exact;
	}

	.sbc-jl__topic {
		-webkit-print-color-adjust: exact;
		background: #0e8b98 !important;
		color: #fff !important;
		print-color-adjust: exact;
	}

	.sbc-jl__table thead {
		display: table-header-group;
	}

	.sbc-jl__table tr {
		break-inside: avoid;
		page-break-inside: avoid;
	}
}
