/**
 * Election Pulse public styles
 *
 * Table of contents
 * 1. Route and widget foundation
 * 2. Election hero
 * 3. Cards and layout
 * 4. Result bars
 * 5. Interactive chart
 * 6. Poll tables and empty states
 * 7. Profiles and detail views
 * 8. Responsive adjustments
 */

/* 1. Route and widget foundation
--------------------------------------------- */
.themespair-ep-route-main {
	padding: clamp(24px, 5vw, 64px) 16px;
	background: #f5f7f6;
}

.themespair-ep-route-container {
	width: min(1180px, 100%);
	margin: 0 auto;
}

.themespair-ep-widget {
	--themespair-ep-ink: #172126;
	--themespair-ep-muted: #647178;
	--themespair-ep-border: #dde5e3;
	--themespair-ep-surface: #fff;
	--themespair-ep-soft: #f4f8f7;
	--themespair-ep-accent: #0f766e;
	--themespair-ep-radius: 18px;
	width: min(1180px, 100%);
	margin: 24px auto;
	color: var(--themespair-ep-ink);
	font-family: inherit;
	line-height: 1.5;
}

.themespair-ep-widget *,
.themespair-ep-widget *::before,
.themespair-ep-widget *::after {
	box-sizing: border-box;
}

/* 2. Election hero
--------------------------------------------- */
.themespair-ep-hero,
.themespair-ep-profile-hero {
	position: relative;
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 36px;
	min-height: 260px;
	margin-bottom: 20px;
	padding: clamp(28px, 5vw, 58px);
	overflow: hidden;
	border-radius: 24px;
	background:
		radial-gradient(circle at 88% 20%, rgba(255,255,255,.15), transparent 28%),
		linear-gradient(135deg, #0c3d39 0%, #0f766e 58%, #113d36 100%);
	color: #fff;
}

.themespair-ep-hero::after {
	content: "";
	position: absolute;
	right: -70px;
	bottom: -130px;
	width: 330px;
	height: 330px;
	border: 1px solid rgba(255,255,255,.13);
	border-radius: 50%;
	box-shadow: 0 0 0 38px rgba(255,255,255,.035), 0 0 0 78px rgba(255,255,255,.025);
}

.themespair-ep-hero-copy {
	position: relative;
	z-index: 1;
	max-width: 760px;
}

.themespair-ep-kicker,
.themespair-ep-eyebrow {
	display: block;
	margin-bottom: 7px;
	font-size: 11px;
	font-weight: 800;
	letter-spacing: .12em;
	text-transform: uppercase;
}

.themespair-ep-kicker {
	color: #bcf2e8;
}

.themespair-ep-eyebrow {
	color: var(--themespair-ep-accent);
}

.themespair-ep-hero h1,
.themespair-ep-profile-hero h1 {
	margin: 0;
	color: #fff;
	font-size: clamp(32px, 5vw, 58px);
	font-weight: 800;
	letter-spacing: -.035em;
	line-height: 1.02;
}

.themespair-ep-description {
	max-width: 680px;
	margin-top: 18px;
	color: rgba(255,255,255,.82);
	font-size: 16px;
}

.themespair-ep-description p {
	margin: 0;
}

.themespair-ep-meta-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px 20px;
	margin-top: 22px;
	color: rgba(255,255,255,.82);
	font-size: 13px;
	font-weight: 650;
}

.themespair-ep-meta-row > span:not(:first-child)::before {
	content: "•";
	margin-right: 20px;
	color: rgba(255,255,255,.36);
}

.themespair-ep-status {
	display: inline-flex;
	align-items: center;
	min-height: 27px;
	padding: 0 10px;
	border: 1px solid rgba(255,255,255,.25);
	border-radius: 99px;
	background: rgba(255,255,255,.12);
	color: #fff;
	font-size: 11px;
	letter-spacing: .04em;
	text-transform: uppercase;
}

.themespair-ep-hero-stat {
	position: relative;
	z-index: 1;
	display: flex;
	flex: 0 0 auto;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	width: 145px;
	height: 145px;
	border: 1px solid rgba(255,255,255,.21);
	border-radius: 50%;
	background: rgba(8, 44, 40, .3);
	backdrop-filter: blur(8px);
	text-align: center;
}

.themespair-ep-hero-stat strong {
	color: #fff;
	font-size: 36px;
	font-weight: 800;
	line-height: 1;
}

.themespair-ep-hero-stat span {
	margin-top: 7px;
	color: rgba(255,255,255,.72);
	font-size: 11px;
	letter-spacing: .04em;
	text-transform: uppercase;
}

/* 3. Cards and layout
--------------------------------------------- */
.themespair-ep-section-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 20px;
}

.themespair-ep-card {
	margin-bottom: 20px;
	padding: clamp(20px, 3vw, 32px);
	border: 1px solid var(--themespair-ep-border);
	border-radius: var(--themespair-ep-radius);
	background: var(--themespair-ep-surface);
	box-shadow: 0 8px 28px rgba(23, 36, 40, .045);
}

.themespair-ep-card-heading {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 18px;
	margin-bottom: 25px;
}

.themespair-ep-card-heading h2 {
	margin: 0;
	color: var(--themespair-ep-ink);
	font-size: clamp(21px, 2.2vw, 28px);
	font-weight: 780;
	letter-spacing: -.02em;
	line-height: 1.2;
}

.themespair-ep-info-chip {
	display: inline-flex;
	align-items: center;
	min-height: 28px;
	padding: 0 10px;
	border-radius: 99px;
	background: var(--themespair-ep-soft);
	color: var(--themespair-ep-muted);
	font-size: 11px;
	font-weight: 700;
	white-space: nowrap;
}

/* 4. Result bars
--------------------------------------------- */
.themespair-ep-bars {
	display: grid;
	gap: 21px;
}

.themespair-ep-bar-row {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 9px 14px;
}

.themespair-ep-bar-label {
	display: flex;
	align-items: center;
	min-width: 0;
	gap: 8px;
}

.themespair-ep-bar-label a,
.themespair-ep-bar-label strong {
	overflow: hidden;
	color: var(--themespair-ep-ink);
	font-size: 14px;
	font-weight: 750;
	text-decoration: none;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.themespair-ep-bar-label a:hover {
	color: var(--themespair-ep-accent);
}

.themespair-ep-bar-label small {
	margin-left: auto;
	color: var(--themespair-ep-muted);
	font-size: 11px;
	white-space: nowrap;
}

.themespair-ep-rank {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 21px;
	height: 21px;
	border-radius: 6px;
	background: #f0f3f3;
	color: #718086;
	font-size: 10px;
	font-weight: 800;
}

.themespair-ep-swatch {
	width: 9px;
	height: 9px;
	flex: 0 0 auto;
	border-radius: 50%;
	background: var(--themespair-ep-color, #52606d);
}

.themespair-ep-bar-value {
	display: flex;
	align-items: baseline;
	gap: 5px;
}

.themespair-ep-bar-value strong {
	font-size: 19px;
	line-height: 1;
}

.themespair-ep-bar-value span {
	color: var(--themespair-ep-muted);
	font-size: 10px;
	text-transform: uppercase;
}

.themespair-ep-bar-track {
	grid-column: 1 / -1;
	height: 8px;
	overflow: hidden;
	border-radius: 99px;
	background: #edf1f0;
}

.themespair-ep-bar-track i {
	display: block;
	width: var(--themespair-ep-width, 0%);
	height: 100%;
	border-radius: inherit;
	background: var(--themespair-ep-color, #52606d);
	transform-origin: left;
	animation: themespair-ep-bar-in .7s ease-out both;
}

@keyframes themespair-ep-bar-in {
	from { transform: scaleX(0); }
	to { transform: scaleX(1); }
}

.themespair-ep-method-note {
	margin: 24px 0 0;
	padding-top: 16px;
	border-top: 1px solid var(--themespair-ep-border);
	color: var(--themespair-ep-muted);
	font-size: 11px;
}

/* 5. Interactive chart
--------------------------------------------- */
.themespair-ep-chart-card {
	min-height: 470px;
}

.themespair-ep-chart-legend {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: -8px 0 18px;
}

.themespair-ep-chart-key {
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
	margin: -7px 0 18px;
	color: var(--themespair-ep-muted);
	font-size: 11px;
}

.themespair-ep-chart-key span {
	display: inline-flex;
	align-items: center;
	gap: 7px;
}

.themespair-ep-chart-key i {
	display: inline-block;
	width: 18px;
	height: 0;
	border-top: 3px solid #52606d;
}

.themespair-ep-chart-key .themespair-ep-chart-key-point {
	width: 9px;
	height: 9px;
	border: 2px solid #52606d;
	border-radius: 50%;
	background: #fff;
}

.themespair-ep-legend-button {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	min-height: 30px;
	padding: 0 10px;
	border: 1px solid var(--themespair-ep-border);
	border-radius: 99px;
	background: #fff;
	color: var(--themespair-ep-muted);
	font: inherit;
	font-size: 11px;
	cursor: pointer;
	opacity: .48;
}

.themespair-ep-legend-button.is-active {
	color: var(--themespair-ep-ink);
	opacity: 1;
}

.themespair-ep-legend-button i {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--themespair-ep-legend-color, #52606d);
}

.themespair-ep-chart {
	position: relative;
	width: 100%;
	min-height: 330px;
	overflow-x: auto;
	overflow-y: visible;
}

.themespair-ep-chart-svg {
	display: block;
	width: 100%;
	height: auto;
	overflow: visible;
}

.themespair-ep-grid-line {
	stroke: #e9eeed;
	stroke-width: 1;
}

.themespair-ep-axis-label {
	fill: #7a858b;
	font-family: inherit;
	font-size: 11px;
}

.themespair-ep-series-line,
.themespair-ep-poll-point {
	transition: opacity .2s ease, stroke-width .2s ease;
}

.themespair-ep-poll-point,
.themespair-ep-average-hit {
	cursor: help;
}

.themespair-ep-poll-point:hover,
.themespair-ep-poll-point:focus {
	stroke-width: 4;
	outline: none;
}

.themespair-ep-average-hit:focus {
	stroke: #111827;
	stroke-width: 1.5;
	outline: none;
}

.themespair-ep-chart-tooltip {
	position: absolute;
	z-index: 3;
	display: flex;
	width: max-content;
	max-width: min(260px, calc(100% - 18px));
	flex-direction: column;
	gap: 3px;
	padding: 10px 12px;
	border: 1px solid rgba(255, 255, 255, .16);
	border-radius: 10px;
	background: #152b28;
	box-shadow: 0 12px 30px rgba(11, 35, 31, .2);
	color: #fff;
	font-size: 11px;
	line-height: 1.35;
	pointer-events: none;
	transform: translate(-50%, -100%);
}

.themespair-ep-chart-tooltip[hidden] {
	display: none;
}

.themespair-ep-chart-tooltip strong {
	font-size: 12px;
}

.themespair-ep-chart-tooltip span {
	color: #d8e6e3;
}

/* 6. Poll tables and empty states
--------------------------------------------- */
.themespair-ep-table-scroll {
	overflow-x: auto;
}

.themespair-ep-public-table {
	width: 100%;
	border: 0;
	border-collapse: collapse;
	background: transparent;
}

.themespair-ep-public-table th,
.themespair-ep-public-table td {
	padding: 14px 12px;
	border: 0;
	border-bottom: 1px solid var(--themespair-ep-border);
	text-align: left;
	vertical-align: middle;
}

.themespair-ep-public-table th {
	color: var(--themespair-ep-muted);
	font-size: 10px;
	font-weight: 800;
	letter-spacing: .08em;
	text-transform: uppercase;
}

.themespair-ep-public-table td {
	color: var(--themespair-ep-ink);
	font-size: 13px;
}

.themespair-ep-public-table td:first-child {
	font-weight: 700;
}

.themespair-ep-public-table a {
	color: var(--themespair-ep-ink);
	text-decoration: none;
}

.themespair-ep-public-table a:hover {
	color: var(--themespair-ep-accent);
}

.themespair-ep-public-table small {
	display: block;
	max-width: 320px;
	margin-top: 3px;
	overflow: hidden;
	color: var(--themespair-ep-muted);
	font-weight: 400;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.themespair-ep-table-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: var(--themespair-ep-soft);
	font-size: 17px;
}

.themespair-ep-empty {
	padding: 28px;
	border: 1px dashed #cbd7d4;
	border-radius: var(--themespair-ep-radius);
	background: #fbfdfc;
	color: var(--themespair-ep-muted);
	text-align: center;
}

.themespair-ep-empty p {
	margin: 0;
}

/* 7. Profiles and detail views
--------------------------------------------- */
.themespair-ep-profile-hero {
	--themespair-ep-profile-color: #0f766e;
	align-items: center;
	justify-content: flex-start;
	min-height: 210px;
	background: var(--themespair-ep-profile-color);
	background: linear-gradient(135deg, color-mix(in srgb, var(--themespair-ep-profile-color) 74%, #102f2c), var(--themespair-ep-profile-color));
}

.themespair-ep-profile-mark,
.themespair-ep-profile-image {
	position: relative;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 105px;
	height: 105px;
	flex: 0 0 auto;
	border: 2px solid rgba(255,255,255,.35);
	border-radius: 28px;
	background: rgba(255,255,255,.15);
	color: #fff;
	font-size: 42px;
	font-weight: 850;
	object-fit: cover;
}

.themespair-ep-profile-hero > div:last-child {
	position: relative;
	z-index: 1;
}

.themespair-ep-profile-hero p {
	margin: 10px 0 0;
	color: rgba(255,255,255,.75);
}

.themespair-ep-prose {
	color: #435056;
	font-size: 16px;
}

.themespair-ep-prose > :first-child {
	margin-top: 0;
}

.themespair-ep-prose > :last-child {
	margin-bottom: 0;
}

.themespair-ep-person-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 12px;
}

.themespair-ep-person-grid a {
	display: flex;
	flex-direction: column;
	gap: 5px;
	padding: 16px;
	border: 1px solid var(--themespair-ep-border);
	border-radius: 12px;
	color: var(--themespair-ep-ink);
	text-decoration: none;
}

.themespair-ep-person-grid a:hover {
	border-color: #9bbfba;
}

.themespair-ep-person-grid span {
	color: var(--themespair-ep-muted);
	font-size: 12px;
}

.themespair-ep-detail-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 20px;
}

.themespair-ep-detail-grid > div {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.themespair-ep-detail-grid span {
	color: var(--themespair-ep-muted);
	font-size: 10px;
	font-weight: 800;
	letter-spacing: .07em;
	text-transform: uppercase;
}

.themespair-ep-detail-grid a,
.themespair-ep-detail-grid strong {
	color: var(--themespair-ep-ink);
	font-size: 14px;
	font-weight: 700;
	text-decoration: none;
}

.themespair-ep-source-link {
	text-align: right;
}

.themespair-ep-source-link a {
	color: var(--themespair-ep-accent);
	font-size: 13px;
	font-weight: 700;
}

/* 8. Responsive adjustments
--------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
	.themespair-ep-bar-track i {
		animation: none;
	}
}

@media (max-width: 800px) {
	.themespair-ep-section-grid {
		grid-template-columns: 1fr;
	}

	.themespair-ep-hero {
		align-items: flex-start;
		flex-direction: column;
	}

	.themespair-ep-hero-stat {
		width: auto;
		height: auto;
		align-items: flex-start;
		padding: 13px 18px;
		border-radius: 14px;
	}

	.themespair-ep-hero-stat strong {
		font-size: 25px;
	}

	.themespair-ep-person-grid,
	.themespair-ep-detail-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 540px) {
	.themespair-ep-widget {
		margin: 12px auto;
	}

	.themespair-ep-hero,
	.themespair-ep-profile-hero {
		min-height: auto;
		padding: 27px 22px;
		border-radius: 17px;
	}

	.themespair-ep-profile-hero {
		align-items: flex-start;
		flex-direction: column;
	}

	.themespair-ep-profile-mark,
	.themespair-ep-profile-image {
		width: 78px;
		height: 78px;
		border-radius: 20px;
		font-size: 31px;
	}

	.themespair-ep-meta-row {
		align-items: flex-start;
		flex-direction: column;
		gap: 7px;
	}

	.themespair-ep-meta-row > span:not(:first-child)::before {
		display: none;
	}

	.themespair-ep-card {
		border-radius: 15px;
	}

	.themespair-ep-chart-card {
		min-height: 0;
	}

	.themespair-ep-chart {
		min-height: 265px;
	}

	.themespair-ep-chart-svg {
		min-width: 640px;
	}

	.themespair-ep-bar-label small,
	.themespair-ep-bar-value span {
		display: none;
	}

	.themespair-ep-person-grid,
	.themespair-ep-detail-grid {
		grid-template-columns: 1fr;
	}
}
