/* Candidate profile modal (assets/js/person-modal.js). A content card in a
   dimmed overlay, opened from a candidate name in the results card. Follows the
   site's panel theme: dark by default, .pm-light for the light theme. */

.pm-overlay {
	position: fixed; inset: 0; z-index: 4000;
	background: rgba(10, 12, 18, .60);
	display: none; align-items: center; justify-content: center;
	padding: 24px;
	font-family: "Libre Franklin", "Segoe UI", Helvetica, Arial, sans-serif;
}

/* ---- theme tokens ---- */
.pm-modal {
	--pm-bg: #1b1e26; --pm-text: #e7e9ef; --pm-sub: #9aa2b1; --pm-line: rgba(255,255,255,.09);
	--pm-card: #212530; --pm-right-bg: #191c23; --pm-hover: #262b36; --pm-land: #333947;
	--pm-won-bg: rgba(46,158,91,.14);
	--pm-win-c: #74d29a; --pm-win-bg: rgba(46,158,91,.20);
	--pm-loss-c: #99a1b0; --pm-loss-bg: rgba(255,255,255,.07);
	--pm-link: #6fb2ff; --pm-dot-line: rgba(255,255,255,.35);
	--pm-gold: #e6b746; --pm-gold-bg: linear-gradient(180deg,#f0cf6e,#d9a72f);
}
.pm-modal.pm-light {
	--pm-bg: #fff; --pm-text: #23262e; --pm-sub: #667085; --pm-line: #eef1f6;
	--pm-card: #fff; --pm-right-bg: #fafbfd; --pm-hover: #f6f8fc; --pm-land: #d9dde6;
	--pm-won-bg: #f6faf7;
	--pm-win-c: #1e7a3c; --pm-win-bg: #e2f4e8;
	--pm-loss-c: #8892a0; --pm-loss-bg: #eef1f6;
	--pm-link: #1d5fb8; --pm-dot-line: rgba(0,0,0,.45);
	--pm-gold: #a9791a; --pm-gold-bg: linear-gradient(180deg,#f0cf6e,#d9a72f);
}

.pm-modal {
	position: relative; width: 940px; max-width: 96vw; max-height: 92vh; overflow: auto;
	background: var(--pm-bg); color: var(--pm-text); border-radius: 14px;
	box-shadow: 0 24px 70px rgba(4, 7, 16, .6);
}
.pm-x {
	position: absolute; top: 15px; right: 16px; width: 30px; height: 30px; z-index: 2;
	border: 1px solid var(--pm-line); border-radius: 8px; background: transparent; color: var(--pm-sub);
	font-size: 17px; line-height: 27px; text-align: center; text-decoration: none;
}
.pm-x:hover { background: var(--pm-hover); color: var(--pm-text); }
.pm-loading { padding: 60px 26px; text-align: center; color: var(--pm-sub); font-size: 14px; }

.pm-head { padding: 20px 26px 14px; border-bottom: 1px solid var(--pm-line); }
.pm-head h1 { margin: 2px 44px 3px 0; font-size: 25px; letter-spacing: -.01em; }
.pm-sub { color: var(--pm-sub); font-size: 13.5px; }
.pm-sub a { color: var(--pm-link); text-decoration: none; font-weight: 600; }
.pm-merged { color: var(--pm-sub); }

.pm-body { display: flex; }
.pm-left { flex: 1; min-width: 0; padding: 16px 22px 22px; }
.pm-right { width: 300px; flex: none; background: var(--pm-right-bg); border-left: 1px solid var(--pm-line);
	padding: 18px 18px 16px; display: flex; flex-direction: column; align-items: center; }

h2.pm-h { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--pm-sub); margin: 16px 0 10px; }
h2.pm-h:first-child { margin-top: 2px; }

/* contests */
.pm-contests { border: 1px solid var(--pm-line); border-radius: 8px; overflow: hidden; background: var(--pm-card); }
.pm-contest { display: grid; grid-template-columns: 52px 1fr auto 92px; gap: 12px; align-items: center;
	padding: 9px 13px; border-top: 1px solid var(--pm-line); }
.pm-contest:first-child { border-top: none; }
.pm-contest.pm-cwon { background: var(--pm-won-bg); }
.pm-c-year { font-weight: 700; color: var(--pm-text); }
.pm-c-bye { display: block; font-size: 10px; font-weight: 600; color: #c79a2b; text-transform: uppercase; }
.pm-c-main { min-width: 0; }
.pm-c-seat { font-weight: 600; font-size: 14px; }
.pm-c-party { display: block; font-size: 12.5px; color: var(--pm-sub); }
.pm-dot { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 4px; }
.pm-c-votes { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; font-size: 13.5px; }
.pm-c-pct { color: var(--pm-sub); font-size: 12px; }
.pm-c-unopp { color: var(--pm-sub); font-style: italic; font-size: 13px; }
.pm-c-res { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.pm-result { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; padding: 1px 7px; border-radius: 999px; }
.pm-win { color: var(--pm-win-c); background: var(--pm-win-bg); }
.pm-loss { color: var(--pm-loss-c); background: var(--pm-loss-bg); }
.pm-pos { font-size: 11px; color: var(--pm-sub); font-variant-numeric: tabular-nums; }
/* per-term abstention: the mark sits inline with the Won result on its own line,
   the finishing position keeps the line below, so the two never share a slot */
.pm-res-line { display: flex; align-items: center; gap: 7px; justify-content: flex-end; }
.pm-abst { font-size: 11px; font-weight: 600; color: var(--pm-sub);
	border-bottom: 1px dotted var(--pm-sub); cursor: help; white-space: nowrap; }
.pm-abst.pm-sat { font-style: italic; font-weight: 500; }
.pm-none { color: var(--pm-sub); font-size: 13px; padding: 6px 2px; }

/* offices + changes */
.pm-posts { display: flex; flex-direction: column; gap: 9px; }
.pm-post { border-left: 3px solid var(--pm-line); padding: 1px 0 1px 11px; }
/* the inner-cabinet entry(ies) in the Offices column, set off with the gold accent */
.pm-post-inner { border-left-color: var(--pm-gold); }
.pm-post-name { font-weight: 700; font-size: 13.5px; }
.pm-post-dept { font-weight: 400; color: var(--pm-sub); }
.pm-post-when { font-size: 12px; color: var(--pm-sub); }
.pm-changes { display: flex; flex-direction: column; gap: 6px; }
.pm-change { font-size: 13.5px; }
.pm-ch-date { color: var(--pm-sub); font-size: 12.5px; margin-right: 8px; }
.pm-ch-to { font-weight: 600; }
.pm-ch-why { color: var(--pm-sub); font-size: 12.5px; }
.pm-depart-mk { color: var(--pm-loss-c); font-size: 10px; margin-right: 7px; vertical-align: 1px; }

/* maybe-same */
.pm-maybe-note { color: var(--pm-sub); font-size: 12px; margin: -4px 0 8px; }
.pm-maybe { display: flex; flex-direction: column; gap: 4px; }
.pm-maybe-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; color: var(--pm-text);
	border: 1px solid var(--pm-line); border-radius: 7px; padding: 6px 10px; font-size: 13px; }
.pm-maybe-item:hover { background: var(--pm-hover); }
.pm-maybe-tick { display: flex; align-items: center; gap: 8px; cursor: pointer; min-width: 0; }
.pm-maybe-chk { flex: none; cursor: pointer; }
.pm-maybe-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-maybe-right { display: flex; align-items: center; gap: 8px; flex: none; }
.pm-maybe-score { color: var(--pm-sub); font-size: 12px; white-space: nowrap; }
.pm-maybe-open { text-decoration: none; color: var(--pm-link); font-weight: 700; font-size: 14px; line-height: 1;
	padding: 2px 4px; border-radius: 5px; }
.pm-maybe-open:hover { background: var(--pm-hover); }

/* a contest borrowed from a ticked maybe-same record: a subtle left accent and
   a muted chip naming its source, so it reads as "included, not native" */
.pm-contest.pm-cextra { box-shadow: inset 3px 0 0 var(--pm-link); }
.pm-c-src { display: inline-block; margin-left: 7px; padding: 0 6px; border-radius: 9px; font-size: 11px;
	color: var(--pm-sub); background: var(--pm-loss-bg); vertical-align: 1px; }

/* map */
#pm-map-wrap { width: 100%; }
.pm-map { display: block; width: 100%; height: auto; max-height: 62vh; }
.pm-sil path { fill: var(--pm-land); }
.pm-legend { display: flex; gap: 16px; justify-content: center; font-size: 11.5px; color: var(--pm-sub); margin-top: 10px; }
.pm-legend .k { display: flex; align-items: center; gap: 6px; }
.pm-legend .mk { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--pm-bg); box-shadow: 0 0 0 1px var(--pm-dot-line); display: inline-block; }

/* the clickable candidate name in the results card */
.rc-person { color: inherit; text-decoration: none; border-bottom: 1px dotted currentColor; cursor: pointer; }
.rc-person:hover { border-bottom-style: solid; }

@media (max-width: 720px) {
	.pm-body { flex-direction: column; }
	.pm-right { width: auto; border-left: none; border-top: 1px solid var(--pm-line); }
	.pm-map { max-height: 46vh; }
}

/* ---- Road to No. 10 (2.16): PM-only career ladder in place of the lists ---- */
.pm-pmbadge { display: inline-block; vertical-align: 3px; font-size: 11px; font-weight: 800;
	letter-spacing: .04em; text-transform: uppercase; color: #241c00; background: var(--pm-gold-bg);
	padding: 3px 9px; border-radius: 999px; }
.pm-road { border: 1px solid var(--pm-line); border-radius: 10px; background: var(--pm-card); padding: 13px 15px 6px; margin-top: 2px; }
.pm-road-hd { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.pm-road-hd b { font-size: 15px; font-weight: 800; color: var(--pm-text); }
.pm-road-hd span { color: var(--pm-sub); font-size: 12px; }
.pm-road-line { position: relative; padding-left: 4px; }
.pm-road-line::before { content: ""; position: absolute; left: 12px; top: 6px; bottom: 14px; width: 2px; background: var(--pm-line); }
.pm-rn { position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 5px 6px 5px 0;
	text-decoration: none; color: var(--pm-text); border-radius: 7px; }
a.pm-rn-link { cursor: pointer; }
a.pm-rn-link:hover { background: var(--pm-hover); }
.pm-mk { position: relative; z-index: 1; flex: none; width: 15px; height: 15px; border-radius: 50%;
	margin-left: 5px; margin-top: 2px; box-shadow: 0 0 0 3px var(--pm-card); }
.pm-mk.ring { background: var(--pm-card); border: 2.5px solid; }
.pm-mk.cross { border-radius: 3px; transform: rotate(45deg); }
.pm-mk.rung { width: 11px; height: 11px; border-radius: 2px; background: var(--pm-loss-c); margin-left: 7px; margin-top: 4px; }
/* inner cabinet (War Cabinet): a gold diamond rung, echoing the gold used for
   office/PM emphasis, so an inner-cabinet spell reads as a distinct rung */
.pm-mk.inner { width: 11px; height: 11px; border-radius: 2px; background: var(--pm-gold); margin-left: 7px; margin-top: 4px; transform: rotate(45deg); }
.pm-rn-inner .pm-rn-sub { color: var(--pm-sub); font-weight: 400; font-size: 12px; }
.pm-mk.left { display: flex; align-items: center; justify-content: center; background: var(--pm-loss-bg);
	color: var(--pm-loss-c); font-size: 9px; font-weight: 800; }
.pm-mk.door { width: 22px; height: 22px; border-radius: 4px; margin-left: 1px; background: #0d0d0d; color: var(--pm-gold);
	border: 1.5px solid var(--pm-gold); font-size: 11px; font-weight: 800; display: flex; align-items: center; justify-content: center;
	box-shadow: 0 0 0 3px var(--pm-card), 0 0 10px rgba(230,183,70,.3); }
.pm-rn-body { font-size: 13.5px; line-height: 1.35; padding-top: 1px; }
.pm-rn-yr { color: var(--pm-sub); font-variant-numeric: tabular-nums; margin-right: 3px; }
.pm-rn-body b { font-weight: 700; }
.pm-rn-pm .pm-rn-body b { color: var(--pm-gold); }
.pm-rn-sub { color: var(--pm-gold); font-weight: 700; font-size: 12.5px; }
.pm-rn-office .pm-rn-sub, .pm-rn-dept { color: var(--pm-sub); font-weight: 400; font-size: 12px; }
.pm-rn-bye { font-size: 10px; font-weight: 700; color: #c79a2b; text-transform: uppercase; }
.pm-rn-note { display: block; color: var(--pm-sub); font-size: 12px; margin-top: 1px; }
a.pm-rn-link::after { content: "\2197"; position: absolute; right: 8px; top: 6px; color: var(--pm-link); font-size: 12px; opacity: 0; }
a.pm-rn-link:hover::after { opacity: 1; }
