/* Vacancies and special elections (special-elections.php). A ruled ledger of seat changes under a ruler of decades, on the paper canvas:
   ink hairlines, serif headings, square cells. Official sources carry a solid ink rule, derived ones a dashed rule, so the difference is
   never carried by colour alone. Tokens only (css/vf-tokens.css). Loads after css/archive-charts.css, which supplies the .ac-* chart pieces. */

.sp-main { padding-bottom: 96px; }
.sp-lead { max-width: 46rem; margin: 0 0 14px; color: var(--vf-ink); font: 600 1.3rem/1.38 var(--vf-font-head); }
.sp-h2 { margin: 0 0 12px; padding-top: 10px; border-top: 2px solid var(--vf-ink); color: var(--vf-ink); font: 700 1.35rem/1.2 var(--vf-font-head); }
.sp-h3 { margin: 26px 0 8px; color: var(--vf-ink); font: 700 1.1rem/1.25 var(--vf-font-head); }
.sp-callout { max-width: 62ch; margin: 0 0 18px; padding: 10px 14px; background: var(--vf-surface); color: var(--vf-ink); font-size: .98rem; line-height: 1.5; }
.sp-note { max-width: 70ch; margin: 8px 0 0; color: var(--vf-mute); font-size: .84rem; line-height: 1.5; overflow-wrap: anywhere; }
.sp-note code { font-size: .8rem; }
.sp-actions { margin: 14px 0 6px; font-size: .95rem; }
.sp-actions a { display: inline-block; padding: 6px 0; color: var(--vf-blue-text); }
.sp-source { max-width: 70ch; margin: 6px 0 0; color: var(--vf-mute); font-size: .8rem; line-height: 1.45; overflow-wrap: anywhere; }
.sp-source a { color: var(--vf-blue-text); }
.sp-source code { font-size: .78rem; }
.sp-gap { color: var(--vf-ink-2); font-style: italic; }
.sp-mute { color: var(--vf-mute); font-size: .88em; }
.sp-summary { max-width: 70ch; margin: 18px 0 14px; color: var(--vf-ink); font-size: 1rem; line-height: 1.5; }
.sp-plain { max-width: 70ch; margin: 0 0 6px; padding-left: 18px; color: var(--vf-ink-2); font-size: .96rem; line-height: 1.5; }
.sp-plain li { margin: 0 0 6px; }

/* source tags: solid rule for an official list, dashed for derived */
.sp-tags { margin: 0 0 14px; }
.sp-src { display: inline-block; margin: 2px 4px 2px 0; padding: 2px 0 2px 8px; color: var(--vf-ink-2); font-size: .78rem; line-height: 1.3; }
.sp-src.sp-derived { border-left-style: dashed; color: var(--vf-mute); }

/* the ruler of decades; scrolls sideways on a phone */
.sp-ruler-list { display: flex; margin: 0; padding: 0; list-style: none; overflow-x: auto; border-top: 2px solid var(--vf-ink); scroll-snap-type: x proximity; }
.sp-ruler-list:focus-visible { outline: 3px solid var(--vf-blue); outline-offset: 2px; }
.sp-tick { flex: 1 0 58px; min-width: 58px; border-left: 1px solid var(--vf-rule-strong); scroll-snap-align: center; position: relative; }
.sp-tick:last-child { border-right: 1px solid var(--vf-rule-strong); }
.sp-tick::before { content: ""; position: absolute; top: 0; left: -1px; width: 1px; height: 12px; background: var(--vf-ink); }
.sp-tick a { display: flex; flex-direction: column; gap: 4px; padding: 22px 4px 8px; color: var(--vf-ink); text-decoration: none; min-height: 68px; }
.sp-tick a:hover .sp-ty { text-decoration: underline; text-underline-offset: 3px; }
.sp-tick a:focus-visible { outline: 3px solid var(--vf-blue); outline-offset: -3px; }
.sp-ty { font: 700 .88rem/1 var(--vf-font-head); font-variant-numeric: tabular-nums; }
.sp-tn { color: var(--vf-mute); font: 600 .74rem/1 var(--vf-font-body); font-variant-numeric: tabular-nums; }
.sp-tick.sp-here { background: var(--vf-ink); }
.sp-tick.sp-here::before { background: var(--vf-gold); height: 22px; width: 3px; }
.sp-tick.sp-here .sp-ty, .sp-tick.sp-here .sp-tn { color: var(--vf-bg); }
.sp-ruler-key { margin: 8px 0 0; color: var(--vf-mute); font-size: .8rem; }

/* filters: a ruled form, labels above fields */
.sp-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px 16px; max-width: 980px; margin: 0 0 8px; padding: 14px 0 6px; border-top: 1px solid var(--vf-rule-strong); }
.sp-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.sp-field-wide { grid-column: 1 / -1; }
.sp-field label { color: var(--vf-mute); font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.sp-field input, .sp-field select { width: 100%; min-height: 44px; padding: 8px 10px; border: 1px solid var(--vf-rule-strong); border-radius: 0; background: var(--vf-surface); color: var(--vf-ink); font: inherit; font-size: 1rem; }
.sp-field input:focus-visible, .sp-field select:focus-visible { outline: 3px solid var(--vf-blue); outline-offset: 1px; }
.sp-buttons { flex-direction: row; align-items: center; gap: 16px; }
.sp-clear { color: var(--vf-blue-text); }

/* one record */
.sp-dl { max-width: 62rem; margin: 18px 0 12px; border-top: 2px solid var(--vf-ink); }
.sp-dl > div { display: grid; grid-template-columns: 1fr; gap: 2px; padding: 9px 0; border-bottom: 1px solid var(--vf-rule); }
.sp-dl dt { color: var(--vf-mute); font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.sp-dl dd { margin: 0; color: var(--vf-ink); font-size: 1rem; line-height: 1.45; overflow-wrap: anywhere; }
.sp-dl a { color: var(--vf-blue-text); }
@media (min-width: 760px) { .sp-dl > div { grid-template-columns: 15rem 1fr; gap: 16px; } }

.sp-pager { display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: center; margin: 12px 0 0; font-size: .95rem; }
.sp-pager a { display: inline-block; padding: 8px 0; color: var(--vf-blue-text); }

/* tables: stacked cards on a phone, a ruled ledger from tablet up */
.sp-scroll { overflow-x: auto; margin: 0 0 6px; }
.sp-scroll:focus-visible { outline: 3px solid var(--vf-blue); outline-offset: 2px; }
.sp-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.sp-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.sp-table tr { display: block; margin: 0 0 8px; padding: 10px 12px; border: 1px solid var(--vf-rule-strong); background: var(--vf-surface); }
.sp-table th[scope="row"] { display: block; margin: 0 0 4px; color: var(--vf-ink); font: 700 1rem var(--vf-font-head); text-align: left; }
.sp-table th[scope="row"] a { color: inherit; text-decoration-color: var(--vf-rule-strong); text-underline-offset: 3px; }
.sp-table td { display: block; padding: 2px 0; color: var(--vf-ink); font-size: .95rem; overflow-wrap: anywhere; }
.sp-table td a { color: var(--vf-blue-text); }
.sp-table td::before { content: attr(data-label) ": "; color: var(--vf-mute); font-size: .75rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }

@media (min-width: 760px) {
  .sp-tick { min-width: 0; }
  .sp-table thead { position: static; width: auto; height: auto; overflow: visible; clip: auto; }
  .sp-table tr { display: table-row; margin: 0; padding: 0; border: 0; background: transparent; }
  .sp-table th, .sp-table td { padding: 8px 10px; border-bottom: 1px solid var(--vf-rule); text-align: left; vertical-align: top; }
  .sp-table thead th { position: sticky; top: 0; background: var(--vf-surface); border-bottom: 2px solid var(--vf-ink); color: var(--vf-mute); font-size: .6875rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; vertical-align: bottom; }
  .sp-table th[scope="row"] { display: table-cell; margin: 0; font-size: .95rem; }
  .sp-table td { display: table-cell; font-size: .93rem; }
  .sp-table td.sp-n, .sp-table th.sp-n { text-align: right; white-space: nowrap; }
  .sp-table td.sp-nw { white-space: nowrap; }
  .sp-table td::before { content: none; }
}
@media print { .sp-form, .sp-ruler, .sp-pager { display: none; } }

/* second paragraph under the title: body size, not a second headline */
body.newsroom-static main.nr-static-main > .section:first-child p.measure { max-width: 46rem; margin-top: 10px; color: var(--vf-ink-2) !important; font: 400 1.0625rem/1.55 var(--vf-font-body) !important; }
/* controls: square, ruled, 44px */
.sp-main .btn, .sp-main select, .sp-main input[type="search"], .sp-main input[type="number"], .sp-main input[type="text"] { border-radius: 0; min-height: 44px; }

/* phones: the records come first, the filter form follows them (a link at the top jumps to it) */
.sp-jump { display: none; margin: 0; }
.sp-jump a { display: inline-flex; align-items: center; min-height: 44px; color: var(--vf-blue-text); }
@media (max-width: 759px) {
  #sp-list > .shell { display: flex; flex-direction: column; }
  #sp-list > .shell > * { order: 1; }
  #sp-list > .shell > .sp-form-h { order: 90; margin-top: 28px; }
  #sp-list > .shell > .sp-form { order: 91; }
  #sp-list > .shell > .sp-jump { display: block; order: 0; }
  #sp-list > .shell > .sp-summary { order: 0; }
}
