/* Congress directory: gallery, official pages and the senator map. Same paper, ink and cite blue as the rest of the site.
   Party colours match the 3D floor's seats; a card or state takes them on hover. */
:root { --dem: #3D6FD8; --rep: #D23F33; }
.dem { --party: var(--dem); } .rep { --party: var(--rep); } .ind { --party: var(--quiet); }
.dir-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 8px 40px; padding: 44px 0 28px; border-bottom: 5px solid var(--ink); }
.dir-head h1 { margin: 0; font-size: clamp(34px, 5vw, 52px); line-height: 1; letter-spacing: -.035em; font-weight: 800; }
.dir-head p { margin: 0; font-size: 19px; max-width: 60ch; }
.dir-head .ways { grid-column: 2; display: flex; flex-wrap: wrap; gap: 8px 24px; font-weight: 600; font-size: 15px; }
.dir-head .ways a { text-decoration-thickness: 2px; }
.crumbs { font-size: 13px; color: var(--quiet); padding-top: 18px; }
.crumbs a { color: var(--ink); }

/* Search and filters */
.finder { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: end; padding: 22px 0; border-bottom: 1px solid var(--ink); }
.finder span, .side .sel span { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.finder input[type=search], .sel select { width: 100%; font: 400 16px var(--sans); color: var(--ink); background: var(--paper); border: 1px solid var(--ink); border-radius: 0; padding: 10px 12px; height: 44px; }
.sel select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%); background-position: calc(100% - 17px) 19px, calc(100% - 12px) 19px; background-size: 5px 5px; background-repeat: no-repeat; }
.finder .seg { height: 44px; }
.finder .seg label { padding: 0; display: grid; place-items: center; }
.count { font-size: 13px; color: var(--quiet); margin: 14px 0 0; min-height: 1.5em; }
.none { font-size: 19px; padding: 40px 0 80px; }

.hits { padding: 20px 0 8px; border-bottom: 1px solid var(--cite); }
.hits h2 { margin: 0 0 8px; font-size: 13px; font-weight: 600; color: var(--cite); }
.hits ol { list-style: none; margin: 0; padding: 0; }
.hits li { padding: 8px 0; border-top: 1px solid var(--cite); font-weight: 800; font-size: 18px; letter-spacing: -.015em; }
.hits li a { text-decoration: none; }
.hits li span { display: block; font-weight: 400; font-size: 14px; color: var(--quiet); letter-spacing: 0; }

/* Portrait grid */
.group { padding: 30px 0 10px; }
.group > h2 { margin: 0 0 14px; font-size: 30px; letter-spacing: -.03em; font-weight: 800; border-bottom: 1px solid var(--ink); padding-bottom: 10px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 28px 20px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card { display: flex; flex-direction: column; text-decoration: none; }
.card[hidden] { display: none; }
.face { width: 100%; aspect-ratio: 240 / 276; object-fit: cover; background: var(--paper); border-bottom: 2px solid var(--ink); }
.card .name { font-weight: 800; font-size: 16px; line-height: 1.15; letter-spacing: -.015em; margin-top: 10px; }
.card .meta { font-size: 13px; color: var(--quiet); margin-top: 3px; font-variant-numeric: tabular-nums; }
/* Hover: the dots turn the party's colour. "Lighten" keeps the paper and recolours only the black ink. */
.frame { position: relative; display: block; }
.frame::after { content: ""; position: absolute; inset: 0 0 2px; background: var(--party); mix-blend-mode: lighten; opacity: 0; transition: opacity .18s; pointer-events: none; }
.card .face, .card .name { transition: color .18s, border-color .18s; }
.card:hover .frame::after, .card:focus-visible .frame::after { opacity: 1; }
.card:hover .face, .card:focus-visible .face { border-bottom-color: var(--party); }
.card:hover .name, .card:focus-visible .name { color: var(--party); }
.card:hover .ph { color: var(--party); }
.card:hover .frame:has(.ph)::after { opacity: 0; }
.side .card .meta::before { content: ""; display: inline-block; width: 9px; height: 9px; background: var(--party); margin-right: 6px; }
.ph { display: grid; place-items: center; font-weight: 800; letter-spacing: -.04em; color: var(--quiet); font-size: 40px; background: var(--tile); }
.ph.big { width: 100%; max-width: 420px; aspect-ratio: 700 / 805; font-size: 120px; }

/* Official page */
.official { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 40px; padding: 24px 0 44px; border-bottom: 5px solid var(--ink); }
.official .portrait img { width: 100%; height: auto; }
/* Party identity, first thing on the profile, in the party colour. */
.party-tag { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 0 0 16px; padding: 6px 12px; background: var(--party); color: #fff; font-weight: 800; font-size: 15px; letter-spacing: .01em; }
.party-tag span { font-weight: 600; font-size: 13px; opacity: .9; }
.official .about { border-top: 6px solid var(--party); padding-top: 18px; }
.official h1 { margin: 0 0 24px; font-size: clamp(38px, 5vw, 66px); line-height: 1; letter-spacing: -.035em; font-weight: 800; }
.official dl { display: grid; grid-template-columns: 150px 1fr; gap: 10px 16px; margin: 0; font-size: 16px; border-top: 2px solid var(--ink); padding-top: 14px; max-width: 60ch; }
.official dt { font-weight: 600; }
.official dd { margin: 0; overflow-wrap: anywhere; }
.official .fine { margin-top: 24px; max-width: 60ch; }
.record .empty { font-size: 19px; color: var(--quiet); font-style: italic; border-top: 2px solid var(--cite); padding-top: 16px; margin: 0; }
.delegation { padding-bottom: 80px; }

/* Senator map */
.mapwrap { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(260px, 1fr); gap: 32px; padding: 28px 0 80px; }
.map svg { width: 100%; height: auto; display: block; }
/* Printed-map look: ink outlines on paper, shaded by how much is on file. */
.map path { fill: var(--paper); stroke: var(--ink); stroke-width: .8; stroke-linejoin: round; transition: fill .15s; cursor: pointer; }
.map path.d1 { fill: #C9C9C4; } .map path.d2 { fill: #77776F; } .map path.d3 { fill: var(--ink); }
/* Hover or pick a state: it fills with how its senators lean; split delegations are half and half. */
.map a.dem:is(:hover, :focus-visible, [aria-current]) path { fill: var(--dem); }
.map a.rep:is(:hover, :focus-visible, [aria-current]) path { fill: var(--rep); }
.map a.split:is(:hover, :focus-visible, [aria-current]) path { fill: url(#split); }
.map a[aria-current] path { stroke-width: 2; }
.map a:focus-visible { outline: none; }
.key { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; margin: 14px 0 0; }
.key span:not(.note)::before { content: ""; display: inline-block; width: 12px; height: 12px; margin-right: 6px; vertical-align: -1px; background: var(--party); }
.key .split::before { background: linear-gradient(90deg, var(--dem) 50%, var(--rep) 50%) !important; }
.key .note { color: var(--quiet); flex-basis: 100%; }
.split { --party: var(--ink); }

/* The Senate by party */
.senate-parties { border-top: 5px solid var(--ink); padding: 40px 0 96px; }
.senate-parties .head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 10px 40px; }
.senate-parties h2 { margin: 0; font-size: 30px; letter-spacing: -.03em; font-weight: 800; grid-row: span 2; }
.senate-parties .tally { display: flex; height: 40px; margin: 0; font-weight: 800; font-size: 15px; color: #fff; }
.senate-parties .tally span { display: flex; align-items: center; padding: 0 12px; background: var(--party); }
.senate-parties .tally .rep { justify-content: flex-end; }
.senate-parties .head p:last-child { margin: 0; font-size: 17px; max-width: 70ch; }
.senate-parties .cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; margin-top: 36px; }
.senate-parties h3 { margin: 0 0 10px; font-size: 17px; font-weight: 800; padding-top: 10px; border-top: 4px solid var(--party); }
.senate-parties .split h3 { border-image: linear-gradient(90deg, var(--dem) 50%, var(--rep) 50%) 1; }
.senate-parties h3 span { font-weight: 400; color: var(--quiet); font-size: 14px; margin-left: 6px; }
.senate-parties ul { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 16px; font-size: 15px; line-height: 1.9; }
.senate-parties ul a { text-decoration: none; }
.senate-parties ul a:hover { color: var(--party); text-decoration: underline; }
.senate-parties .split ul a:hover { color: var(--ink); }
.side .hint { font-size: 14px; color: var(--quiet); }
.side .panel h2 { margin: 18px 0 14px; font-size: 30px; letter-spacing: -.03em; font-weight: 800; border-bottom: 1px solid var(--ink); padding-bottom: 8px; }

@media (max-width: 860px) {
  .dir-head, .official, .mapwrap, .senate-parties .head, .senate-parties .cols { grid-template-columns: 1fr; gap: 16px; }
  .dir-head .ways { grid-column: 1; }
  .finder { grid-template-columns: 1fr 1fr; }
  .finder .q, .finder .seg { grid-column: 1 / -1; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 20px 12px; }
  .card .name { font-size: 14px; }
  .official dl { grid-template-columns: 120px 1fr; }
  /* On a phone the name and party come first; the portrait follows, smaller. */
  .official .about { order: -1; }
  .official .portrait { max-width: 260px; }
}

/* Party pages and the analysis */
a.party-tag { text-decoration: none; }
a.party-tag:hover { filter: brightness(.9); }
.party-head h1 { color: var(--party); }
.party-analysis, .ranked { padding: 32px 0 8px; }
.party-analysis > h2, .ranked > h2 { margin: 0 0 14px; font-size: 30px; letter-spacing: -.03em; font-weight: 800; border-bottom: 1px solid var(--ink); padding-bottom: 10px; }
.figures { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 0 0 20px; }
.figures div { border-top: 4px solid var(--party, var(--ink)); padding-top: 8px; }
.figures dt { font-size: 13px; font-weight: 600; color: var(--quiet); }
.figures dd { margin: 2px 0 0; font-size: 40px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.figures small { font-size: 16px; color: var(--quiet); font-weight: 600; margin-left: 2px; }
.kinds { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 8px; max-width: 640px; }
.kinds li { display: grid; grid-template-columns: 210px 1fr 32px; gap: 12px; align-items: center; font-size: 14px; }
.kinds .meter { height: 10px; background: var(--tile); }
.kinds .meter i { display: block; height: 100%; background: var(--party, var(--ink)); }
.kinds b { text-align: right; font-variant-numeric: tabular-nums; }
.most { font-size: 15px; }
.empty.lead { font-size: 19px; padding: 28px 0 0; }
.ranked ol, .compare .top ol { list-style: none; margin: 0; padding: 0; }
.ranked li, .compare .top li { border-top: 1px solid var(--ink); padding: 14px 0; display: grid; gap: 4px; }
.ranked li > a, .compare .top li > a { display: flex; gap: 14px; align-items: baseline; text-decoration: none; }
.ranked .said, .compare .top .said { font-weight: 800; font-size: 20px; line-height: 1.25; letter-spacing: -.015em; }
.ranked li > a:hover .said { text-decoration: underline; text-decoration-thickness: 2px; }
.score { flex: none; min-width: 2.6em; text-align: center; font-weight: 800; font-size: 15px; padding: 3px 6px; background: var(--ink); color: var(--paper); font-variant-numeric: tabular-nums; }
.ranked .by, .compare .by { font-size: 14px; color: var(--quiet); }
.ranked .reason, .compare .reason { font-size: 15px; max-width: 70ch; }
.compare { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; padding: 32px 0 96px; }
.compare h2 { margin: 0 0 16px; font-size: 30px; letter-spacing: -.03em; font-weight: 800; }
.compare h2 a { text-decoration: none; color: var(--party); }
.compare .figures { grid-template-columns: 1fr 1fr 1fr; }
.compare .figures dd { font-size: 30px; }
.compare .kinds li { grid-template-columns: minmax(0, 1fr) 70px 24px; font-size: 13px; }
.compare .top h3 { font-size: 13px; font-weight: 600; color: var(--quiet); margin: 18px 0 6px; }
@media (max-width: 860px) {
  .compare { grid-template-columns: 1fr; gap: 40px; }
  .figures dd { font-size: 30px; }
  .kinds li { grid-template-columns: minmax(0, 1fr) 90px 28px; }
}

/* Cabinet and former officials */
.offices { padding: 32px 0 0; }
.offices h2 { margin: 0 0 14px; font-size: 30px; letter-spacing: -.03em; font-weight: 800; }
.offices table { width: 100%; border-collapse: collapse; font-size: 16px; }
.offices th { text-align: left; font-size: 13px; font-weight: 600; color: var(--quiet); border-top: 2px solid var(--ink); border-bottom: 1px solid var(--ink); padding: 8px 14px 8px 0; }
.offices td { border-bottom: 1px solid var(--tile); padding: 10px 14px 10px 0; vertical-align: top; }
.offices td:first-child { font-weight: 600; }
.offices .when { white-space: nowrap; color: var(--quiet); font-variant-numeric: tabular-nums; }
.admin h2 span { font-weight: 400; color: var(--quiet); font-size: 20px; letter-spacing: 0; margin-left: 6px; }
.dir-head .ways a span { font-weight: 400; color: var(--quiet); }
@media (max-width: 860px) { .offices table th:last-child, .offices table td:last-child { display: none; } }
