/* WVIZ-645: phase tabs on a mixed competition's comp-edition page.
   A league or group phase: table beside results. Knockouts and qualifying:
   bracket above results. One column below 900px. */

.phase-tab {
  display: grid;
  gap: var(--space-6);
  margin-top: var(--space-4);
}

@media (width >= 900px) {
  .phase-tab--league {
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    align-items: start;
  }
}

.phase-tab__standings,
.phase-tab__bracket,
.phase-tab__results {
  min-width: 0;
}

.phase-tab__subhead {
  font-family: var(--font-display);
  font-size: var(--fs-h3);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-display);
  color: var(--color-text);
  margin: 0 0 var(--space-3);
}

.phase-tab__standings .phase-tab__subhead:not(:first-child) {
  margin-top: var(--space-5);
}

/* Results and fixtures, one <details> per round. */

.match-list__round {
  border-top: 1px solid var(--color-border);
}

.match-list__round:last-of-type {
  border-bottom: 1px solid var(--color-border);
}

.match-list__round-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  min-height: var(--hit-touch);
  padding: var(--space-2) 0;
  cursor: pointer;
  list-style: none;
  font-weight: var(--fw-semibold);
  color: var(--color-text);
}

.match-list__round-title::-webkit-details-marker {
  display: none;
}

.match-list__round-title::after {
  content: "";
  width: 0.5em;
  height: 0.5em;
  flex: none;
  border-right: 2px solid currentcolor;
  border-bottom: 2px solid currentcolor;
  transform: rotate(45deg);
  transition: transform var(--t-base) var(--ease);
}

.match-list__round[open] > .match-list__round-title::after {
  transform: rotate(-135deg);
}

.match-list__round-title:focus-visible {
  outline: 2px solid var(--color-link);
  outline-offset: 2px;
}

.match-list {
  list-style: none;
  margin: 0 0 var(--space-3);
  padding: 0;
}

.match-list__match {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  grid-template-areas:
    "kickoff kickoff kickoff"
    "home score away"
    "note note note";
  align-items: center;
  column-gap: var(--space-2);
  padding: var(--space-2) 0;
  border-top: 1px solid var(--color-border);
  font-size: var(--fs-body-sm);
}

.match-list__match:first-child {
  border-top: 0;
}

.match-list__kickoff {
  grid-area: kickoff;
  font-size: var(--fs-caption);
  color: var(--color-text-muted);
}

.match-list__team {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  min-width: 0;
  color: var(--color-text);
}

.match-list__team--home {
  grid-area: home;
  justify-content: flex-end;
  text-align: right;
}

.match-list__team--away {
  grid-area: away;
}

.match-list__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.match-list__logo {
  width: 20px;
  height: 20px;
  object-fit: contain;
  flex: none;
}

.match-list__team--home .match-list__logo {
  order: 2;
}

.match-list__score,
.match-list__versus {
  grid-area: score;
  min-width: 3.5em;
  text-align: center;
  font-family: var(--font-tabular);
}

.match-list__score {
  font-weight: var(--fw-bold);
  color: var(--color-text);
}

.match-list__versus {
  color: var(--color-text-muted);
}

.match-list__note {
  grid-area: note;
  text-align: center;
  font-size: var(--fs-caption);
  color: var(--color-text-muted);
}
