/* site/model/rank.html -- club strength ranking table. Same "one CSS file
   per page family" precedent as model_stats.css / matches.css. The base
   table/thead/tbody rules come from style.css; this file only adds the
   page intro text, column alignment, the crest cell and the strength bar. */

.rank-lede {
  max-width: 960px;
  margin: 0 auto 1.25rem;
  font-size: 1rem;
  color: var(--text-primary);
  line-height: 1.6;
}

.rank-updated {
  max-width: 960px;
  margin: 0 auto 1.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.rank-updated:empty {
  display: none;
}

.rank-filter {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 960px;
  margin: 0 auto 0.75rem;
}

.rank-filter[hidden] {
  display: none;
}

.rank-filter label {
  color: var(--text-secondary);
  font-weight: 600;
}

.rank-count {
  max-width: 960px;
  margin: 0 auto 0.75rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.rank-table {
  max-width: 960px;
  margin: 0 auto 2.5rem;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-1);
}

.rank-table table {
  min-width: 560px;
}

/* Position, numbers and the bar read as a column of figures -> right-align;
   crest + club name are the row's identity -> left. */
.rank-table th.rank-name,
.rank-table td.rank-name {
  text-align: left;
  white-space: normal;
}

.rank-table th.rank-pos,
.rank-table td.rank-pos {
  text-align: right;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  width: 2.5rem;
}

.rank-table th.rank-num,
.rank-table td.rank-num {
  text-align: right;
}

.rank-table td.rank-total {
  font-weight: 700;
}

.rank-table th.rank-crest-cell,
.rank-table td.rank-crest-cell {
  width: 2rem;
  padding-right: 0;
}

.rank-crest {
  display: inline-block;
  width: 22px;
  height: 22px;
  object-fit: contain;
  vertical-align: middle;
}

.rank-crest-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  background: var(--gridline);
  color: var(--text-secondary);
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.rank-table th.rank-country,
.rank-table td.rank-country {
  width: 3rem;
}

.rank-country-code {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--text-secondary);
}

.rank-table th.rank-bar-cell,
.rank-table td.rank-bar-cell {
  width: 110px;
}

.rank-bar {
  position: relative;
  display: block;
  width: 90px;
  height: 8px;
  margin: 0 auto;
  border-radius: 4px;
  background: var(--gridline);
}

/* Centre tick -- the "average club" reference the bar diverges from. */
.rank-bar::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -2px;
  bottom: -2px;
  width: 1px;
  background: var(--border);
}

.rank-bar-fill {
  position: absolute;
  top: 0;
  height: 100%;
  border-radius: 4px;
}

.rank-more {
  display: block;
  margin: 1rem auto 2.5rem;
  padding: 0.5rem 1.25rem;
  font: inherit;
  font-weight: 600;
  color: var(--text-primary);
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
}

.rank-more:hover {
  border-color: var(--accent);
}

.rank-more[hidden] {
  display: none;
}
