/* StatuteWorks Small Claims Map — styles */

.scl-map {
	--scl-color-bg: #fff;
	--scl-color-border: #ccc;
	--scl-color-tooltip-bg: rgba(33, 33, 33, 0.95);
	--scl-color-tooltip-fg: #fff;
	--scl-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. */
.scl-map:not(.scl-map--embed) {
	width: 100% !important;
	max-width: 100% !important;
	margin: 1.5em 0 !important;
}

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

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

.scl-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. */
.scl-map .scl-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: ... }`. */
.scl-map .scl-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. */
.scl-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. */
.scl-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. */
.scl-callout {
	cursor: pointer;
	outline: none;
}
.scl-callout__line {
	stroke: #475569;
	stroke-width: 1px;
	fill: none;
}
.scl-callout__box {
	stroke: #94a3b8;
	stroke-width: 1px;
	transition: stroke 0.15s ease-out, stroke-width 0.15s ease-out;
}
.scl-callout:hover .scl-callout__box,
.scl-callout:focus .scl-callout__box {
	stroke: #1e40af;
	stroke-width: 2px;
}
.scl-callout:hover .scl-callout__line,
.scl-callout:focus .scl-callout__line {
	stroke: #1e40af;
}
.scl-callout:focus {
	outline: 2px solid #1e40af;
	outline-offset: 2px;
}
.scl-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;
}
.scl-callout__label--dark {
	fill: #1f2937 !important;
	stroke: rgba(255, 255, 255, 0.7) !important;
}

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

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

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

.scl-map__tooltip {
	position: absolute;
	background: var(--scl-color-tooltip-bg);
	color: var(--scl-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);
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

/* Embed snippet generator — centered, agency-styled card. */
.scl-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;
}

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

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

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

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

.scl-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;
}

.scl-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;
}

.scl-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;
}

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

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

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

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

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

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

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

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

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

.scl-faq {
	margin: 0;
}

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

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

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

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

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