/*
 * The position page (position.html, js/position.js): bento tiles on the red-to-blue background.
 * Top: the office (violet) and the election countdown (mint). Overview: the race as a matchup
 * (Democrats left, Republicans right, everyone else smaller below) with the visitor's picks; who's in
 * office and the thumbs on their job; the job; its powers; money; the next meeting; news; map; past holders.
 */
.pos { --ink: #1e1a67; --quiet: #4e4a7a; --label: #7d78ab; --lav: #f1effe;
  --tile: 0 2px 4px rgba(38, 27, 143, .05), 0 10px 26px rgba(38, 27, 143, .10);
  width: min(100% - 32px, 1200px); margin: 18px auto 56px; display: grid; gap: 16px; color: var(--ink); }
.pos [hidden] { display: none !important; }
.pos-tile { min-width: 0; margin: 0; padding: 20px; border-radius: 26px; background: #fff; box-shadow: var(--tile);
  transition: transform .35s cubic-bezier(.34, 1.56, .64, 1), box-shadow .2s; }
.pos-tile:hover { transform: translateY(-3px); }
.pos-h { display: block; margin: 0 0 12px; font-size: 18px; font-weight: 800; color: var(--ink); }
.pos-text { margin: 0; color: var(--quiet); font-size: 16px; line-height: 1.55; }
.pos-kicker { margin: 0; color: var(--label); font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.pos-more { display: inline-block; margin-top: 12px; color: #4232d4; font-size: 14px; font-weight: 800; text-decoration: none; }
.pos-more:hover { text-decoration: underline; }
.pos-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pos-chip { padding: 5px 11px; border-radius: 999px; background: var(--lav); color: #21167c; font-size: 13px; font-weight: 700; }
.pos-chip.is-party { color: #fff; background: var(--party-other); }
.pos-chip.is-democrat { background: var(--party-democrat); } .pos-chip.is-republican { background: var(--party-republican); }
.pos-chip.is-warn { background: #fff4d6; color: #7a5200; }
.pos-btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border: 0; border-radius: 14px; background: var(--btn-tint, #d3cdfb);
  color: var(--btn-ink, #150e5e); font: 700 14px/1.1 var(--font-read, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif); text-decoration: none; cursor: pointer; }
.pos-btn:hover { background: var(--btn-tint-hover, #c4bcf8); }
.pos-btn.is-go { background: var(--btn-go, #21167c); color: #fff; } .pos-btn.is-go:hover { background: var(--btn-go-hover, #180f5c); }

/* A person's circle: the photo in their party's ring */
.pos-face { position: relative; display: block; flex: none; width: var(--d, 104px); height: var(--d, 104px); border-radius: 50%;
  background: #fff center / cover no-repeat; color: #8d86c2; font: 800 calc(var(--d, 104px) * .3)/var(--d, 104px) var(--font-read, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif); text-align: center;
  box-shadow: 0 0 0 4px #fff, 0 0 0 8px var(--p, var(--party-other)), 0 10px 22px rgba(38, 27, 143, .18); }
.pos-face[data-party="democrat"] { --p: var(--party-democrat); } .pos-face[data-party="republican"] { --p: var(--party-republican); }
.pos-face.is-small { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--p, var(--party-other)); }
/* the visitor's picks, on the face: 🏆 will win, 💜 want to win */
.pos-badges { position: absolute; top: -6px; right: -10px; display: flex; gap: 2px; }
.pos-badges span { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: #fff; box-shadow: 0 3px 10px rgba(38, 27, 143, .25);
  font-size: 16px; line-height: 1; animation: pos-pop .45s cubic-bezier(.34, 1.56, .64, 1); }
@keyframes pos-pop { from { transform: scale(0); } to { transform: scale(1); } }

/* ---------- the top: the office and the countdown ---------- */
.pos-top { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 1fr); gap: 16px; }
.pos-top:not(:has(.pos-count:not([hidden]))) { grid-template-columns: minmax(0, 1fr); }
.pos-hero { display: grid; align-content: center; gap: 10px; padding: 28px; color: #fff;
  background: radial-gradient(120% 140% at 100% 0%, #8d5be0, #4b33c9 45%, #21167c); }
.pos-hero .pos-kicker { color: #f0b4f1; }
.pos-hero .page-heading { margin: 0; color: #fff; font-size: clamp(32px, 4vw, 52px); font-weight: 800; letter-spacing: -.02em; line-height: 1.08; }
.pos-lede { margin: 0; max-width: 780px; color: rgba(255, 255, 255, .9); font-size: 18px; line-height: 1.5; }
.pos-lede:empty { display: none; }
.pos-hero .pos-chip { background: rgba(255, 255, 255, .16); color: #fff; }
.pos-switch { display: flex; gap: 6px; margin-top: 6px; }
.pos-switch .seg-btn { border: 0 !important; background: rgba(255, 255, 255, .16) !important; color: #fff !important; }
.pos-switch .seg-btn[aria-selected="true"] { background: #fff !important; color: #21167c !important; }
.pos-switch .seg-btn + .seg-btn { margin-left: 0; }
.pos-count { display: grid; align-content: center; gap: 4px; background: linear-gradient(160deg, #e3f5ec, #c9efdd); color: #0a5b43; }
.pos-count .pos-fig, .pos-vs, .pos-money .pos-fig, .pos-cal b, .pos-pick-btn .pos-share { font-weight: 900; font-synthesis: none; }   /* (the figure font has one weight; without it, bold) */
.pos-count .pos-fig { display: block; margin-bottom: 4px; font-family: var(--font-fig, system-ui, sans-serif); font-size: 76px; line-height: 1; }
.pos-count b { display: block; font-size: 17px; } .pos-count small { display: block; color: #2f7a62; font-size: 14px; }
.pos-count .cal-wrap { margin-top: 10px; }
.pos-count .cal-btn { background: rgba(255, 255, 255, .75); }

/* ---------- the overview grid ---------- */
.pos-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; align-items: start; grid-auto-flow: row dense; }
.pos-race { grid-column: span 3; }
.pos-holder { grid-column: span 1; }
.pos-grid:not(:has(.pos-race:not([hidden]))) .pos-holder { grid-column: span 2; }
.pos-grid:has(.pos-race:not([hidden])):not(:has(.pos-holder #posHolderBody:not(:empty))) .pos-race { grid-column: span 4; }
.pos-grid:has(.pos-race:not([hidden])):not(:has(.pos-holder #posHolderBody:not(:empty))) .pos-holder { display: none; }
.pos-job { grid-column: span 2; }
.pos-powers { grid-column: span 2; grid-row: span 2; }
.pos-money, .pos-meet { grid-column: span 1; }
.pos-grid:not(:has(.pos-meet:not([hidden]))) .pos-money, .pos-grid:not(:has(.pos-money:not([hidden]))) .pos-meet { grid-column: span 2; }
.pos-grid:not(:has(.pos-money:not([hidden]))):not(:has(.pos-meet:not([hidden]))) .pos-powers { grid-row: auto; }
.pos-grid:not(:has(.pos-powers:not([hidden]))) .pos-job { grid-column: span 4; }
.pos-news { grid-column: span 2; }
.pos-map { grid-column: span 2; }
.pos-grid:not(:has(.pos-map:not([hidden]))) .pos-news { grid-column: span 4; }
.pos-prev { grid-column: span 4; }

/* ---------- on the ballot: the matchup ---------- */
.pos-race { text-align: center; background: linear-gradient(115deg, rgba(0, 34, 255, .10), #fff 42%, #fff 58%, rgba(255, 0, 0, .10)), #fff; }
.pos-race .pos-h { text-align: left; }
.pos-match { display: flex; justify-content: center; align-items: center; gap: 22px; }
.pos-side { display: flex; justify-content: center; align-items: flex-start; gap: 14px; flex: 1 1 0; min-width: 0; }
.pos-side.is-left { justify-content: flex-end; } .pos-side.is-right { justify-content: flex-start; }
.pos-cand { display: grid; justify-items: center; align-content: start; gap: 8px; width: 160px; max-width: 100%; color: inherit; text-decoration: none; }
.pos-cand b { font-size: 18px; font-weight: 800; line-height: 1.2; }
.pos-cand .pos-face { margin: 8px 0 4px; transition: transform .35s cubic-bezier(.34, 1.56, .64, 1); }
.pos-cand:hover .pos-face { transform: scale(1.05); }
.pos-match.is-crowded .pos-cand { width: 118px; } .pos-match.is-crowded .pos-cand b { font-size: 15px; }
.pos-vs { display: grid; place-items: center; flex: none; width: 74px; height: 74px; border-radius: 50%; background: #21167c; color: #fff;
  font-family: var(--font-fig, system-ui, sans-serif); font-size: 30px; line-height: 1; box-shadow: 0 8px 20px rgba(33, 22, 124, .3); }
.pos-match.is-row { flex-wrap: wrap; gap: 18px; }
.pos-match.is-row .pos-vs { width: 46px; height: 46px; font-size: 18px; }
.pos-solo { margin: 10px 0 0; color: var(--quiet); font-weight: 700; }
.pos-others { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 18px; }
.pos-others:empty { display: none; }
.pos-mini { display: flex; align-items: center; gap: 10px; padding: 8px 14px 8px 8px; border-radius: 18px; background: var(--lav); color: inherit; text-align: left; text-decoration: none; }
.pos-mini b { display: block; font-size: 15px; } .pos-mini .pos-chip { display: inline-block; margin-top: 3px; padding: 2px 8px; font-size: 11px; }
.pos-mini .pos-face { --d: 46px; }
.pos-mini .pos-badges { top: -8px; right: -12px; } .pos-mini .pos-badges span { width: 22px; height: 22px; font-size: 12px; }

/* the picks */
.pos-picks { display: grid; gap: 12px; margin: 20px auto 0; max-width: 820px; padding: 16px; border-radius: 22px; background: rgba(241, 239, 254, .85); text-align: left; }
.pos-pick { display: grid; grid-template-columns: 210px 1fr; gap: 10px; align-items: center; }
.pos-pick > b { font-size: 15px; }
.pos-pick-row { display: flex; flex-wrap: wrap; gap: 8px; }
.pos-pick-btn { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 5px 14px 5px 5px; overflow: hidden; border: 0; border-radius: 999px;
  background: #fff; color: #21167c; font: 700 14px/1.1 var(--font-read, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif); cursor: pointer; transition: transform .3s cubic-bezier(.34, 1.56, .64, 1), box-shadow .2s; }
.pos-pick-btn:hover { transform: translateY(-2px); }
.pos-pick-btn .pos-face { --d: 28px; margin: 0; box-shadow: 0 0 0 2px var(--p, var(--party-other)); }
.pos-pick-btn[aria-pressed="true"] { background: #21167c; color: #fff; box-shadow: 0 6px 16px rgba(33, 22, 124, .3); }
.pos-pick-btn .pos-share { margin-left: 2px; font-family: var(--font-fig, system-ui, sans-serif); font-size: 15px; opacity: .85; }
.pos-pick-btn::before { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--share, 0%); background: rgba(66, 50, 212, .12); }
.pos-pick-note { margin: 0; color: var(--label); font-size: 13px; }
.pos-acts { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 16px; }

/* ---------- in office now ---------- */
.pos-holder { text-align: center; }
#posHolderBody { display: grid; justify-items: center; gap: 8px; }
#posHolderBody .pos-face { margin: 8px 0 8px; }
#posHolderBody > a { text-decoration: none; }
#posHolderBody > b { font-size: 21px; font-weight: 800; }
#posHolderBody .pos-chips { justify-content: center; }
.pos-holder .rt { width: 100%; margin-top: 10px; padding-top: 14px; border-top: 1px solid #ece9fb; }
.pos-holder .rt-q { margin: 0 0 8px; font-size: 14px; font-weight: 800; color: var(--ink); }
.pos-holder .rt-row { justify-content: center; }
.pos-holder .contact-btn { display: inline-flex; align-items: center; gap: 6px; height: auto; padding: 9px 16px; border: 0; border-radius: 14px; background: var(--btn-tint, #d3cdfb); color: var(--btn-ink, #150e5e); font: 700 14px/1.1 var(--font-read, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif); cursor: pointer; }
.pos-holder .contact-btn .nav-label { display: inline; }
.pos-holder .contact-slot { margin: 0; }

/* ---------- the job, powers, money, meeting, news, map, past holders ---------- */
.pos-job .position-appointed { margin-top: 12px; }
.pos-powers .gen-p-more { margin-top: 10px; }
.pos-money .pos-fig { margin: 2px 0 6px; font-family: var(--font-fig, system-ui, sans-serif); font-size: 54px; line-height: 1; color: #21167c; }
.pos-money p { margin: 0; color: var(--quiet); font-size: 14px; line-height: 1.45; }
.pos-meet-row { display: grid; grid-template-columns: 56px 1fr; gap: 12px; align-items: start; }
.pos-cal { display: grid; place-items: center; height: 60px; border-radius: 16px; background: #fff7df; color: #7a5200; line-height: 1; }
.pos-cal small { font-size: 11px; font-weight: 800; text-transform: uppercase; } .pos-cal b { font-family: var(--font-fig, system-ui, sans-serif); font-size: 26px; }
.pos-meet-row b { display: block; font-size: 15px; } .pos-meet-row p { margin: 3px 0 0; color: var(--quiet); font-size: 14px; line-height: 1.4; }
.pos-meet .cal-wrap { margin-top: 12px; }
.pos-news .news-list { margin: 0; }
.pos-map { display: block; color: inherit; text-decoration: none; }
.pos-map .area-mini-map { display: block; height: 240px; border-radius: 18px; overflow: hidden; background: #eef0f6; }
.pos-map .area-mini-canvas { width: 100%; height: 100%; }
.pos-prev-list { display: flex; flex-wrap: wrap; gap: 10px; }
.pos-prev-list a { display: flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; border-radius: 999px; background: var(--lav); color: inherit; font-size: 14px; font-weight: 700; text-decoration: none; }
.pos-prev-list .pos-face { --d: 32px; }

/* ---------- compare ---------- */
.pos-compare { min-width: 0; }

/* ---------- phones ---------- */
@media (max-width: 760px) {
  .pos { width: min(100% - 24px, 1200px); margin-top: 12px; }
  .pos-top, .pos-grid { grid-template-columns: minmax(0, 1fr); }
  .pos-grid > * { grid-column: auto !important; grid-row: auto !important; }
  .pos-hero { padding: 22px 20px; } .pos-lede { font-size: 16px; }
  .pos-count { grid-template-columns: auto 1fr; align-items: center; column-gap: 14px; }
  .pos-count .pos-fig { grid-row: span 3; font-size: 64px; }
  .pos-match { gap: 8px; }
  .pos-side { gap: 8px; }
  .pos-cand { width: 112px; } .pos-cand b { font-size: 15px; }
  .pos-cand .pos-face { --d: 84px !important; }
  .pos-match.is-crowded .pos-cand { width: 76px; } .pos-match.is-crowded .pos-cand .pos-face { --d: 60px !important; }
  .pos-match.is-crowded .pos-cand b { font-size: 13px; } .pos-match.is-crowded .pos-chip { font-size: 11px; padding: 3px 7px; }
  .pos-vs { width: 44px; height: 44px; font-size: 18px; }
  .pos-pick { grid-template-columns: 1fr; }
  .pos-race { padding: 18px 12px; }
}
/* (phones: the red-to-blue background behind everything, as on desktop; the old page kept it behind the view only) */
@media (max-width: 700px) {
  body.position-bg.pos-page { background: transparent; display: block; }
  .pos-page .position-view { margin: 0; padding: 0; background: none; }
}
