/* StatuteWorks Bar Admission Map — styles */

.swba-map {
	--swba-color-bg: #fff;
	--swba-color-border: #ccc;
	--swba-color-tooltip-bg: rgba(33, 33, 33, 0.95);
	--swba-color-tooltip-fg: #fff;
	--swba-color-focus: #1e40af;
	margin: 1.5em 0;
	font-family: inherit;
}

/* On the hub page, escape any content-width constraint the active theme
   imposes on direct children of `.entry-content` (e.g. GeneratePress's
   `var(--content-width)`). The embed page is unaffected — it's already
   served full-width by the bare embed template. */
.swba-map:not(.swba-map--embed) {
	width: 100% !important;
	max-width: 100% !important;
	margin: 1.5em 0 !important;
}

.swba-map:not(.swba-map--embed) .swba-map__container {
	max-width: 1100px !important;
	margin: 0 auto !important;
}

.swba-map__container {
	position: relative;
	width: 100%;
	max-width: 960px;
	margin: 0 auto;
}

/* View toggle — segmented control above the map. */
.swba-map__toolbar {
	display: flex;
	gap: 0;
	max-width: 540px;
	margin: 0 auto 1em;
	border: 1px solid #cbd5e1;
	border-radius: 6px;
	overflow: hidden;
	background: #f8fafc;
}

.swba-map__view-toggle {
	flex: 1;
	padding: 0.6em 1em;
	background: transparent;
	border: 0;
	border-right: 1px solid #cbd5e1;
	font-family: inherit;
	font-size: 0.95em;
	font-weight: 600;
	color: #475569;
	cursor: pointer;
	transition: background-color 0.15s ease-out, color 0.15s ease-out;
}

.swba-map__view-toggle:last-child { border-right: 0; }

.swba-map__view-toggle:hover {
	background: #e0e7ff;
	color: #1e3a8a;
}

.swba-map__view-toggle.is-active,
.swba-map__view-toggle[aria-selected="true"] {
	background: #1e40af;
	color: #ffffff;
}

.swba-map__view-toggle:focus {
	outline: 2px solid #1e40af;
	outline-offset: -2px;
}

.swba-map__svg {
	width: 100%;
	height: auto;
	max-width: 100%;
	display: block;
}

/* Defensive: many themes set `svg { max-width: ... }` or similar for icons.
   These overrides ensure our map always sizes correctly. */
.swba-map .swba-map__svg {
	width: 100% !important;
	height: auto !important;
	max-width: 100% !important;
	display: block !important;
}

/* Defensive: ensure path fill comes from the inline style we set in JS,
   not from any theme rule like `.entry-content svg path { fill: ... }`. */
.swba-map .swba-state {
	fill-opacity: 1 !important;
	stroke-opacity: 1 !important;
}

/* State abbreviation labels (PA, NJ, NY, etc.) rendered at each state's
   projected centroid by the map JS. White fill with a dark stroke gives
   readable contrast over any tier color. `paint-order: stroke fill` puts
   the stroke behind the fill so it acts as a halo, not a thick outline. */
.swba-state-label {
	font-size: 11px;
	font-weight: 700;
	font-family: inherit;
	fill: #ffffff;
	stroke: rgba(0, 0, 0, 0.55);
	stroke-width: 0.6px;
	paint-order: stroke fill;
	pointer-events: none;
	user-select: none;
}

/* Dark label variant — used for light-tier states (limit < $7,500) and
   for states with no data. Improves contrast against light fills. */
.swba-state-label--dark {
	fill: #1f2937 !important;
	stroke: rgba(255, 255, 255, 0.7) !important;
}

/* Callout labels for small Northeast states (RI, DE, NJ, CT, MA, NH, VT, MD).
   Each callout is a focusable <g> containing a leader line, a tier-colored
   box, and the state abbreviation. The whole group is clickable and
   triggers the same tooltip + navigation as the state path. */
.swba-callout {
	cursor: pointer;
	outline: none;
}
.swba-callout__line {
	stroke: #475569;
	stroke-width: 1px;
	fill: none;
}
.swba-callout__box {
	stroke: #94a3b8;
	stroke-width: 1px;
	transition: stroke 0.15s ease-out, stroke-width 0.15s ease-out;
}
.swba-callout:hover .swba-callout__box,
.swba-callout:focus .swba-callout__box {
	stroke: #1e40af;
	stroke-width: 2px;
}
.swba-callout:hover .swba-callout__line,
.swba-callout:focus .swba-callout__line {
	stroke: #1e40af;
}
.swba-callout:focus {
	outline: 2px solid #1e40af;
	outline-offset: 2px;
}
.swba-callout__label {
	font-size: 12px;
	font-weight: 700;
	font-family: inherit;
	fill: #ffffff;
	stroke: rgba(0, 0, 0, 0.55);
	stroke-width: 0.4px;
	paint-order: stroke fill;
	pointer-events: none;
	user-select: none;
}
.swba-callout__label--dark {
	fill: #1f2937 !important;
	stroke: rgba(255, 255, 255, 0.7) !important;
}

.swba-state {
	stroke: var(--swba-color-bg);
	stroke-width: 1;
	cursor: pointer;
	transition: opacity 0.15s ease-out;
}

.swba-state:hover {
	opacity: 0.85;
}

.swba-state:focus {
	outline: 2px solid var(--swba-color-focus);
	outline-offset: -1px;
}

.swba-map__tooltip {
	position: absolute;
	background: var(--swba-color-tooltip-bg);
	color: var(--swba-color-tooltip-fg);
	padding: 8px 12px;
	border-radius: 4px;
	font-size: 13px;
	line-height: 1.4;
	pointer-events: none;
	display: none;
	z-index: 10;
	max-width: 280px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.swba-map__tooltip strong {
	display: block;
	margin-bottom: 4px;
	font-size: 14px;
}

.swba-map__tooltip em {
	font-style: normal;
	color: #cfd8dc;
	font-size: 12px;
}

.swba-map__tooltip small {
	display: block;
	margin-top: 4px;
	color: #b0bec5;
	font-size: 11px;
}

.swba-legend {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin: 1em auto 0;
	align-items: center;
	justify-content: center;
	font-size: 14px;
}

.swba-legend__title {
	font-weight: 600;
}

.swba-legend__item {
	display: inline-flex;
	align-items: center;
	gap: 4px;
}

.swba-legend__swatch {
	display: inline-block;
	width: 16px;
	height: 16px;
	border: 1px solid var(--swba-color-border);
}

.swba-map__table {
	width: 100%;
	border-collapse: collapse;
	margin-top: 1.5em;
	font-size: 14px;
}

.swba-map__table caption {
	text-align: left;
	padding: 6px 0;
	font-weight: 600;
	font-size: 13px;
	color: #555;
}

.swba-map__table th,
.swba-map__table td {
	text-align: left;
	padding: 6px 10px;
	border-bottom: 1px solid var(--swba-color-border);
}

.swba-map__table th {
	background: #f7f7f7;
	font-weight: 600;
}

.swba-map__attribution,
.swba-map__embed-attribution {
	text-align: center;
	font-size: 12px;
	color: #666;
	margin-top: 1em;
}

.swba-map__embed-attribution {
	position: absolute;
	bottom: 8px;
	right: 12px;
	margin: 0;
	background: rgba(255, 255, 255, 0.85);
	padding: 2px 6px;
	border-radius: 3px;
}

.swba-map__embed-attribution a {
	color: #333;
	text-decoration: none;
}

.swba-map__embed-attribution a:hover {
	text-decoration: underline;
}

.swba-map__error {
	padding: 1em;
	background: #fff3cd;
	border: 1px solid #ffeaa7;
	color: #856404;
	border-radius: 4px;
}

/* Embed body — remove default margins, transparent background. */
.swba-embed-body {
	margin: 0;
	padding: 0;
	background: transparent;
}

/* Embed snippet generator — centered, agency-styled card. */
.swba-embed-snippet {
	margin: 3em auto;
	max-width: 720px;
	padding: 2em;
	background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
	box-sizing: border-box;
}

.swba-embed-snippet__title {
	text-align: center;
	margin: 0 0 0.5em;
	font-size: 1.3em;
	font-weight: 700;
	color: #1e293b;
	line-height: 1.3;
}

.swba-embed-snippet__intro {
	text-align: center;
	margin: 0 0 1.5em;
	color: #475569;
	font-size: 0.95em;
	line-height: 1.5;
}

.swba-embed-snippet__controls {
	display: flex;
	align-items: center;
	gap: 0.75em;
	margin-bottom: 1em;
}

.swba-embed-snippet__controls label {
	font-weight: 600;
	color: #334155;
	flex-shrink: 0;
}

.swba-embed-snippet__size {
	flex: 1;
	padding: 0.5em 0.75em;
	border: 1px solid #cbd5e1;
	border-radius: 4px;
	background: #ffffff;
	font-size: 0.95em;
	color: #1e293b;
	font-family: inherit;
}

.swba-embed-snippet__code {
	width: 100%;
	box-sizing: border-box;
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 13px;
	line-height: 1.5;
	padding: 1em;
	border: 1px solid #cbd5e1;
	border-radius: 4px;
	background: #0f172a;
	color: #e2e8f0;
	resize: vertical;
	margin: 0 0 1em;
}

.swba-embed-snippet__copy {
	display: block;
	width: 100%;
	padding: 0.75em 1.5em;
	background: #1e40af;
	color: #ffffff;
	border: none;
	border-radius: 4px;
	font-size: 1em;
	font-weight: 600;
	font-family: inherit;
	cursor: pointer;
	transition: background-color 0.15s ease-out, transform 0.05s ease-out;
}

.swba-embed-snippet__copy:hover { background: #1e3a8a; }
.swba-embed-snippet__copy:active { transform: translateY(1px); }
.swba-embed-snippet__copy:focus { outline: 2px solid #1e40af; outline-offset: 2px; }

/* Per-state page basic styles. Theme is expected to provide layout. */
.swba-jurisdiction-page {
	max-width: 760px;
	margin: 2em auto;
	padding: 0 1em;
}

.swba-lead {
	font-size: 1.15em;
	margin-bottom: 1em;
}

.swba-figure {
	font-size: 2em;
	font-weight: 700;
	margin: 0.2em 0;
}

.swba-disclaimer {
	background: #fffbe6;
	border-left: 4px solid #f0ad4e;
	padding: 0.75em 1em;
	margin: 1em 0;
	font-size: 0.9em;
}

.swba-section {
	margin: 1.5em 0;
}

.swba-section h2 {
	font-size: 1.2em;
	margin-bottom: 0.4em;
}

.swba-local-exception {
	margin: 1em 0;
	padding: 0.75em 1em;
	background: #f9f9f9;
	border-left: 3px solid var(--swba-color-border);
}

.swba-local-exception h3 {
	margin-top: 0;
	font-size: 1.05em;
}

.swba-faq {
	margin: 0;
}

.swba-faq dt {
	font-weight: 600;
	margin-top: 1em;
}

.swba-faq dd {
	margin-left: 0;
	margin-bottom: 0.5em;
	color: #333;
}

.swba-jurisdiction-footer {
	margin-top: 2em;
	padding-top: 1em;
	border-top: 1px solid var(--swba-color-border);
	font-size: 0.85em;
	color: #666;
}

/* AOM / UBE status pills on jurisdiction detail pages. */
.swba-status {
	display: inline-block;
	padding: 0.25em 0.6em;
	border-radius: 4px;
	font-weight: 600;
	font-size: 0.95em;
	color: #fff;
	background: #6b7280;
	margin: 0.25em 0;
}
.swba-status--yes         { background: #2e7d32; }
.swba-status--conditional { background: #f9a825; color: #1f2937; }
.swba-status--no          { background: #9e9e9e; }
.swba-status--unknown     { background: #6b7280; }

.swba-fact-list {
	list-style: disc;
	margin: 0.5em 0 1em 1.25em;
	padding: 0;
}
.swba-fact-list li {
	margin: 0.25em 0;
}

.swba-notes {
	margin: 0.75em 0;
	padding: 0.6em 0.9em;
	background: #f1f5f9;
	border-left: 3px solid #94a3b8;
	font-size: 0.95em;
}

.swba-section--aom h2     { color: #1b5e20; }
.swba-section--ube h2     { color: #1565c0; }
.swba-section--nextgen h2 { color: #6a1b9a; }

/* Responsive: hide map below 640px and show the table instead. */
@media (max-width: 640px) {
	.swba-map__svg,
	.swba-map__tooltip,
	.swba-map__legend {
		display: none !important;
	}
}

@media (min-width: 641px) {
	.swba-map__table {
		display: none;
	}
}

/* Sub-list under MPRE bullet (minimum score + age limit). */
.swba-fact-sublist {
	list-style: circle;
	margin: 0.25em 0 0.25em 1.25em;
	padding: 0;
	font-size: 0.95em;
	color: #475569;
}
.swba-fact-sublist li {
	margin: 0.15em 0;
}

/* Cost breakdown collapsible inside the AOM fact list. */
.swba-cost-breakdown {
	margin-top: 0.35em;
}
.swba-cost-breakdown > summary {
	cursor: pointer;
	color: #1e40af;
	font-size: 0.92em;
	font-weight: 600;
	display: inline-block;
	margin-bottom: 0.25em;
}
.swba-cost-breakdown > summary:hover { text-decoration: underline; }
.swba-cost-breakdown[open] > summary { margin-bottom: 0.5em; }

/* Documents Required subsection inside AOM. */
.swba-subsection-heading {
	margin: 1em 0 0.4em;
	font-size: 1em;
	font-weight: 700;
	color: #1f2937;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}
.swba-documents-list {
	list-style: disc;
	margin: 0 0 0.5em 1.25em;
	padding: 0;
}
.swba-documents-list li {
	margin: 0.2em 0;
}
