/* The homepage's "Tool 01: Opportunity builder" block: a compact top 5 that links into the full static page.
   Loaded by index.html beside styles.css (whose variables it uses). */

/* Laid out like the other tools: text on the left (the .feature grid), the top 5 on the right as a compact panel. */

.top5__panel {
  min-width: 0;
}
.top5__heading {
  margin: 0 0 0.5rem !important;
  font-weight: 800;
  font-size: 0.75rem !important;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.top5__list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 2px solid var(--black);
  background: var(--paper);
}
.top5__list li + li {
  border-top: 1px solid var(--line);
}
.top5__link {
  display: grid;
  /* the three figures have FIXED widths (lean, Bernie, then the AIPAC / caucus figure): each entry is its own grid, so
     auto-sized columns would sit at a different place in every row */
  grid-template-columns: 1.3rem 40px minmax(0, 1fr) 4rem 6.4rem 8rem;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.7rem;
  font-size: 0.88rem;
  text-decoration: none;
  color: inherit;
}
.top5__link:hover,
.top5__link:focus-visible {
  background: var(--wash);
  box-shadow: inset 4px 0 0 var(--red);
}
.top5__rank {
  font-weight: 900;
  font-size: 1rem;
}
.top5__photo {
  width: 40px;
  height: 48px;
  object-fit: cover;
  object-position: top;
  background: var(--wash);
  border: 2px solid var(--black);
}
.top5__photo--none {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 0.8rem;
  color: var(--muted);
}
.top5__who {
  min-width: 0;
  line-height: 1.2;
}
.top5__sub {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
}
.top5__stat {
  display: flex;
  flex-direction: column;
  font-weight: 800;
  white-space: nowrap;
}
.top5__label {
  color: var(--muted);
  font-weight: 700;
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.top5__more {
  margin: 1.5rem 0 0.75rem !important;
}

/* Sanders's margin in the same green (led) / purple (trailed) tiers as the Opportunities page: not party colours. */
.m {
  display: inline-block;
  padding: 0 0.4em;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}
.m--even   { background: #efefef; color: #555555; }
.m--up-1   { background: #eaf4ee; color: #1f5c3a; }
.m--up-2   { background: #cfe7d8; color: #174d30; }
.m--up-3   { background: #a9d3ba; color: #0f3d24; }
.m--down-1 { background: #f1e9f4; color: #5b2f6d; }
.m--down-2 { background: #e0d0e8; color: #4a2459; }
.m--down-3 { background: #cdb2db; color: #3a1a47; }

/* A phone, and the narrow two-column band just above it (the panel is only about 500px wide there): the three
   figures drop under the name instead of crowding it. */
@media (max-width: 720px), (min-width: 880px) and (max-width: 1040px) {
  .top5__link {
    grid-template-columns: 1.4rem 40px minmax(0, 1fr);
    row-gap: 0.35rem;
  }
  .top5__stat {
    grid-column: 3;
    flex-direction: row;
    gap: 0.5rem;
    align-items: baseline;
  }
}

/* the third figure when a centrist caucus stands in for a near-empty AIPAC figure: weight, not party colour */
.top5__caucus {
  display: inline-block;
  align-self: flex-start; /* a tag, not a full-width bar, inside the column */
  padding: 0 0.4em;
  border: 1px solid var(--black);
  font-weight: 700;
  white-space: nowrap;
  color: var(--black);
}
.top5__caucus--blue_dog {
  color: var(--paper);
  background: var(--black);
}
.top5__caucus--new_democrat {
  font-weight: 600;
  color: var(--muted);
  border-color: var(--muted);
}
