/* Shared styles for the football competition pages. */

.lede a {
  color: inherit;
}

/* Crests, badges and flags */

.crest {
  width: 24px;
  height: 24px;
  object-fit: contain;
  flex: none;
}

.crest-lg {
  width: 36px;
  height: 36px;
}

.crest-badge {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--wash);
  border: 1px solid var(--border);
  color: var(--ink-2);
  font-size: 8px;
  font-weight: 700;
  flex: none;
}

.crest-badge.crest-lg {
  width: 36px;
  height: 36px;
  font-size: 11px;
}

svg .badge-circle {
  fill: var(--surface-raised);
  stroke: var(--border);
}

svg .badge-text {
  fill: var(--ink-2);
  font-size: 8px;
  font-weight: 700;
}

.flag {
  width: 20px;
  height: 15px;
  object-fit: cover;
  border-radius: 2px;
  box-shadow: 0 0 0 1px var(--border);
  flex: none;
}

.flag-code {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 15px;
  border-radius: 2px;
  background: var(--wash);
  box-shadow: 0 0 0 1px var(--border);
  font-size: 7px;
  font-weight: 700;
  color: var(--ink-2);
  flex: none;
}

.club {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  white-space: nowrap;
}

.race-ticker .crest {
  width: 22px;
  height: 22px;
  vertical-align: middle;
  margin-right: 6px;
}

.data-table td.score {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  color: var(--ink-2);
}

.data-table td.rank {
  color: var(--ink-muted);
  width: 2em;
}

.data-table.tall {
  max-height: 640px;
  overflow-y: auto;
}

.data-table.tall th {
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 1;
}

.pair-row .players .club {
  font-weight: 600;
}

/* Countries */

.country-note {
  color: var(--ink-2);
  font-size: 14px;
  margin: 0 0 12px;
}

.country-head,
.country-row {
  display: grid;
  grid-template-columns: 20px minmax(0, 9em) minmax(0, 1fr) 2.6em minmax(0, 1fr) 2.6em 3em;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}

.country-head {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.country-row {
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
}

.country-row:last-child {
  border-bottom: 0;
}

.country-row:hover,
.country-row:focus-visible {
  outline: none;
  background: var(--wash);
}

.country-row .name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.country-head .num,
.country-row .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.country-row .num.strong {
  font-weight: 650;
}

.bar-wrap .bar {
  height: 10px;
  border-radius: 0 4px 4px 0;
  min-width: 2px;
}

.bar.won {
  background: var(--ink-2);
}

.bar.lost {
  background: var(--axis);
}


/* Filter bar scoping the sections below it */

.filter-bar {
  position: sticky;
  top: var(--nav-h);
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 56px 0 0;
  padding: 10px 0;
  background: var(--page);
  border-bottom: 1px solid var(--border);
}

.filter-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
}

.filter-note {
  margin: 0;
  font-size: 13px;
  color: var(--ink-muted);
}

.block.tight {
  margin-top: 32px;
}

.confed-key {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: var(--c);
}

/* Head-to-head totals (Europe vs South America) */

.versus {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: 16px;
  margin-bottom: 20px;
}

.versus .side {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.versus .side.right {
  text-align: right;
  align-items: flex-end;
}

.versus .name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 14px;
}

.versus .name i {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: var(--c);
  flex: none;
}

.versus .big {
  font-size: clamp(40px, 7vw, 60px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
}

.versus .mid {
  color: var(--ink-muted);
  font-size: 14px;
  text-align: center;
  padding-bottom: 8px;
}

@media (max-width: 640px) {
  .data-table .hide-sm {
    display: none;
  }
}

@media (max-width: 760px) {
  .stat-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .country-head,
  .country-row {
    grid-template-columns: 20px minmax(0, 1fr) 2.4em 2.4em 2.6em;
    gap: 8px;
  }

  .country-head > :nth-child(3),
  .country-head > :nth-child(5),
  .country-row .bar-wrap {
    display: none;
  }

  .club {
    white-space: normal;
  }
}

/* Argentine league: era tags and split years */

.tags {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.era-tag,
.assoc-tag {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid var(--border);
  color: var(--ink-2);
}

.era-tag.professional {
  background: var(--wash);
}

.assoc-tag {
  border-color: var(--c);
  box-shadow: inset 3px 0 0 var(--c);
}

.assoc-FAF {
  --c: var(--series-2);
}

.assoc-AAmF {
  --c: var(--series-3);
}

.assoc-LAF {
  --c: var(--series-1);
}

.data-table tr.split-row td {
  background: var(--wash);
}

.stack-clubs {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.muted {
  color: var(--ink-muted);
}

.split-periods {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin: 16px 0 24px;
}

.split-period {
  border-left: 3px solid var(--c);
  padding: 2px 0 2px 12px;
  font-size: 14px;
}

.split-period p {
  margin: 4px 0 0;
  color: var(--ink-2);
}

/* World Cup hosts */

.host-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
}

.host-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  color: var(--ink-2);
}

.host-chip strong {
  color: var(--ink);
}

/* Ranked list rows (icon, name, bar, values) */

.rank-head,
.rank-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 12em) minmax(0, 1fr) 3.4em 6.4em;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}

.rank-head > span,
.rank-row > .num:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis; /* a wide header never pushes the page sideways */
  white-space: nowrap;
}

.rank-head {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.rank-row {
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}

.rank-row:last-child {
  border-bottom: 0;
}

.rank-row:hover,
.rank-row:focus-visible {
  outline: none;
  background: var(--wash);
}

.rank-row .name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rank-row .bar {
  height: 10px;
  border-radius: 0 4px 4px 0;
  background: var(--c, var(--ink-2));
  min-width: 2px;
}

.rank-head .num,
.rank-row .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.rank-row .num.strong {
  font-weight: 650;
}

/* National cups (Argentine page) */

.cup-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.cup-card h3 {
  margin: 0 0 4px;
  font-size: 18px;
}

.cup-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  font-size: 13px;
  color: var(--ink-2);
  margin-bottom: 10px;
}

.cup-card .cup-desc {
  font-size: 14px;
  color: var(--ink-2);
  margin: 0 0 12px;
}

.era-tag.both {
  background: var(--wash);
  border-style: dashed;
}

.cup-card details {
  margin-top: 10px;
  font-size: 14px;
}

.cup-card summary {
  cursor: pointer;
  color: var(--ink-2);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.grid-2 .card h3,
.card > h3.sub:first-child {
  margin-top: 0;
}

@media (max-width: 760px) {
  .grid-2,
  .cup-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .rank-head,
  .rank-row {
    grid-template-columns: 24px minmax(0, 1fr) 2.6em 3.6em;
  }

  .rank-head > :nth-child(3),
  .rank-row .bar-cell {
    display: none;
  }
}

/* Full-width sticky selector bar (international tournaments) */

.filter-bar.wrap-bar {
  margin: 0;
  padding: 10px 0;
}

.filter-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

/* Coaches and players (people.js). */
.people-gap {
  margin-top: 16px;
}

.people-note {
  color: var(--ink-muted);
  font-size: 13px;
  margin: 10px 0 0;
}

.person-head,
.person-row {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) 3.4em 5.6em;
  gap: 12px;
  align-items: center;
}

.person-head {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
  padding: 0 0 6px;
  border-bottom: 1px solid var(--border);
}

.person-row {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.person-name {
  font-weight: 600;
}

.person-sub {
  font-size: 12px;
  color: var(--ink-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.person-bar {
  height: 5px;
  margin-top: 5px;
  border-radius: 3px;
  background: var(--wash);
  overflow: hidden;
}

.person-bar span {
  display: block;
  height: 100%;
  background: var(--sport);
  border-radius: 3px;
}

.person-value {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 800;
}

.person-second {
  font-size: 12px;
  color: var(--ink-muted);
}

.person-list-short .person-head,
.person-list-short .person-row {
  grid-template-columns: 26px minmax(0, 1fr) 3.4em;
}

.person-list-short .person-second {
  display: none;
}

@media (max-width: 640px) {
  .person-sub {
    white-space: normal;
  }
}

/* Everyone against everyone: a head-to-head matrix (rivalries, World Cup champions) */

.matrix {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.matrix th,
.matrix td {
  padding: 4px;
  border-bottom: 1px solid var(--border);
}

.matrix th img,
.matrix th .crest-badge {
  width: 22px;
  height: 22px;
  vertical-align: middle;
}

.matrix-club {
  text-align: left;
  font-weight: 600;
  white-space: nowrap;
}

.matrix-club img,
.matrix-club .crest-badge {
  margin-right: 8px;
}

.matrix-cell.diag {
  background: var(--wash);
}

.matrix-pair {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  min-width: 52px;
  font: inherit;
  color: var(--ink);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 4px 2px;
  cursor: pointer;
}

.matrix-pair:hover {
  border-color: var(--axis);
}

.matrix-pair.current {
  border-color: var(--ink);
}

.matrix-pair .w {
  font-size: 17px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.matrix-pair .dl {
  font-size: 12px;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}

.matrix-pair.ahead .w::after {
  content: " ▲";
  font-size: 10px;
  color: var(--ink-2);
}

.matrix-total {
  font-weight: 600;
  white-space: nowrap;
}

.matrix-pct {
  color: var(--ink-2);
  white-space: nowrap;
}

.matrix img.flag {
  width: auto;
  height: 14px;
}

.matrix-wrap {
  overflow-x: auto;
  max-width: 100%;
}

@media (max-width: 560px) {
  .matrix-name {
    display: none;
  }

  .matrix-club img,
  .matrix-club .crest-badge {
    margin-right: 0;
  }

  .matrix-pair {
    min-width: 40px;
  }

  .matrix-pair .w {
    font-size: 15px;
  }

  .matrix-total {
    font-size: 12px;
  }
}

/* A column whose every value moved to the row's second line (long race lists in the F1 records). */
.data-table .hide-all {
  display: none;
}
