/* Ranking articles and the /rankings/ hub. Loaded only on those pages
   (ipx_head 'css'). Colours and fonts are the site's own tokens from site.css. */

.rk-body {
  padding-block: 2.5rem 4rem;
  max-width: 1440px;
}
.rk-body > *,
.rk-body section {
  max-width: 52rem;
}
.rk-body section {
  margin-top: 3rem;
}
.rk-body h2 {
  font-size: 1.5rem;
}
.rk-body h3 {
  font-size: 1.125rem;
  margin-top: 1.75rem;
}
.rk-body p,
.rk-body ul {
  margin-top: 1rem;
  color: var(--muted-foreground);
}
.rk-body ul {
  padding-left: 1.25rem;
}
.rk-body li {
  margin-bottom: 0.5rem;
}
.rk-body a {
  color: var(--foreground);
  text-decoration: underline;
  text-underline-offset: 4px;
}
.rk-body .btn {
  text-decoration: none;
}
.rk-body .btn--primary {
  color: var(--primary-foreground);
}

.rk-crumb {
  font-size: 0.8125rem;
  color: var(--muted-foreground);
  text-decoration: underline;
  text-underline-offset: 4px;
}
.rk .page-header h1 {
  margin-top: 0.75rem;
  max-width: 52rem;
}
.rk-dateline {
  margin-top: 0.75rem;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}
.rk-body .rk-lead {
  margin-top: 0;
  font-size: 1.125rem;
  color: var(--foreground);
}
.rk-findings li {
  color: var(--foreground);
}
.rk-note {
  font-size: 0.875rem;
}

/* Top 20: the section is allowed the full width so all seven columns fit on
   a laptop; on a phone the table scrolls inside its own box, never the page. */
.rk-body section[aria-labelledby="rk-top20"] {
  max-width: 64rem;
}
.rk-table-wrap {
  margin-top: 1rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}
.rk-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
  min-width: 40rem;
}
.rk-table th,
.rk-table td {
  padding: 0.625rem 0.75rem;
  border-top: 1px solid var(--rule);
  text-align: left;
  white-space: nowrap;
}
.rk-table thead th {
  border-top: 0;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted-foreground);
  vertical-align: bottom;
  white-space: normal;
}
.rk-table tbody th {
  font-weight: 500;
}
.rk-table .num {
  text-align: right;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}
.rk-table thead .num {
  font-family: var(--font-sans);
}
.rk-table .rk-score {
  font-weight: 500;
  color: var(--foreground);
}
.rk-w {
  display: block;
  font-family: var(--font-mono);
}
.rk-tie {
  margin-left: 0.125rem;
  color: var(--muted-foreground);
}

.rk-weights {
  margin-top: 1rem;
  border-collapse: collapse;
  min-width: 16rem;
}
.rk-weights th,
.rk-weights td {
  padding: 0.5rem 1.5rem 0.5rem 0;
  border-top: 1px solid var(--rule);
  text-align: left;
  font-weight: 400;
}
.rk-weights tr:first-child th,
.rk-weights tr:first-child td {
  border-top: 0;
}
.rk-weights .num {
  font-family: var(--font-mono);
  text-align: right;
}

.rk-graphic {
  display: block;
  margin-top: 1.25rem;
  width: 100%;
  height: auto;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}
.rk-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.rk-disclosure {
  margin-top: 3rem !important;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  font-size: 0.875rem;
}

/* Hub */
.rk-body .rk-hub {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr;
  max-width: none;
}
@media (min-width: 768px) {
  .rk-body .rk-hub { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1100px) {
  .rk-body .rk-hub { grid-template-columns: repeat(3, 1fr); }
}
.rk-body a.rk-card {
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.rk-body a.rk-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px -12px rgb(0 0 0 / 0.18);
}
.rk-card h2 {
  margin-top: 0.75rem;
  font-size: 1.375rem;
}
.rk-body .rk-card__weights {
  font-size: 0.8125rem;
}
.rk-card__top {
  margin: 1rem 0 0;
  padding-left: 1.25rem;
  color: var(--foreground);
}
.rk-card__top li {
  margin-bottom: 0.375rem;
}
.rk-card__top .num {
  font-family: var(--font-mono);
  color: var(--muted-foreground);
}
.rk-card__more {
  margin-top: auto;
  padding-top: 1rem;
  font-size: 0.875rem;
  text-decoration: underline;
  text-underline-offset: 4px;
}
