/* Rochester NH Dems — candidate cards.

   Every candidate card is identical by design. Within a race the only
   permitted variation is factual (a "currently serving" note). Hierarchy is
   carried by the race heading, never by the person. */

.rnh-candidates {
	--rnh-navy: #1a4789;
	--rnh-panel: #f0f4fa;
	--rnh-muted: #555;
	--rnh-line: #d7e0ee;
}

.rnh-candidates__heading {
	color: var(--rnh-navy);
	margin: 3rem 0 1.5rem;
	padding-bottom: 0.5rem;
	border-bottom: 3px solid var(--rnh-navy);
}

.rnh-candidates__empty {
	color: var(--rnh-muted);
	font-style: italic;
}

/* ---- race grouping ---- */

.rnh-race {
	margin-bottom: 2.5rem;
}

.rnh-race__title {
	margin: 0 0 0.15rem;
	font-size: 1.25rem;
	color: var(--rnh-navy);
}

.rnh-race__meta {
	margin: 0 0 1rem;
	font-size: 0.875rem;
	color: var(--rnh-muted);
}

/* ---- the grid: equal columns, equal heights ---- */

.rnh-candidates__grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
	gap: 1.25rem;
	align-items: stretch;
}

/* Keep a lone card from stretching to full width, which would read as
   emphasis rather than as "this race has one candidate". */
.rnh-candidates__grid > .rnh-candidate:only-child {
	max-width: 340px;
}

/* ---- the card ---- */

.rnh-candidate {
	display: flex;
	flex-direction: column;
	background: var(--rnh-panel);
	border: 1px solid var(--rnh-line);
	border-radius: 6px;
	padding: 1.5rem;
	height: 100%;
}

.rnh-candidate__media {
	width: 96px;
	height: 96px;
	margin-bottom: 1rem;
	border-radius: 50%;
	overflow: hidden;
	background: var(--rnh-navy);
	display: flex;
	align-items: center;
	justify-content: center;
	flex: none;
}

.rnh-candidate__photo {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.rnh-candidate__initials {
	color: #fff;
	font-size: 1.75rem;
	font-weight: 700;
	letter-spacing: 0.02em;
	line-height: 1;
}

.rnh-candidate__body {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
}

.rnh-candidate__name {
	margin: 0 0 0.25rem;
	font-size: 1.15rem;
	line-height: 1.25;
}

.rnh-candidate__name a {
	text-decoration: none;
}

.rnh-candidate__name a:hover,
.rnh-candidate__name a:focus-visible {
	text-decoration: underline;
}

.rnh-candidate__badge {
	display: inline-block;
	align-self: flex-start;
	margin: 0 0 0.5rem;
	padding: 0.15em 0.6em;
	border: 1px solid var(--rnh-navy);
	border-radius: 999px;
	font-size: 0.7rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--rnh-navy);
}

.rnh-candidate__office {
	margin: 0 0 0.25rem;
	font-weight: 600;
	font-size: 0.95rem;
}

.rnh-candidate__wards {
	margin: 0 0 0.75rem;
	font-size: 0.875rem;
	color: var(--rnh-muted);
}

.rnh-candidate__bio {
	margin: 0 0 0.75rem;
	font-size: 0.95rem;
}

.rnh-candidate__platform {
	margin: 0 0 1rem;
	padding-left: 1.15rem;
	font-size: 0.925rem;
}

.rnh-candidate__platform li {
	margin-bottom: 0.3rem;
}

/* Links pin to the bottom so cards line up regardless of bio length. */
.rnh-candidate__links {
	margin: auto 0 0;
	padding-top: 1rem;
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.rnh-candidate__link {
	display: inline-block;
	padding: 0.45em 1em;
	border: 1px solid var(--rnh-navy);
	border-radius: 4px;
	font-size: 0.85rem;
	font-weight: 600;
	text-decoration: none;
	color: var(--rnh-navy);
	background: transparent;
}

.rnh-candidate__link:hover,
.rnh-candidate__link:focus-visible {
	background: var(--rnh-navy);
	color: #fff;
}

.rnh-candidate__link--donate {
	border-color: #c0392b;
	color: #c0392b;
}

.rnh-candidate__link--donate:hover,
.rnh-candidate__link--donate:focus-visible {
	background: #c0392b;
	color: #fff;
}

/* ---- current officeholders: a listing, not a ballot ---- */

.rnh-candidate--officeheld {
	background: #fff;
	border-left: 4px solid var(--rnh-navy);
}

@media (prefers-reduced-motion: no-preference) {
	.rnh-candidate__link {
		transition: background-color 120ms ease, color 120ms ease;
	}
}
