/*
 * The club page's Squad tab — a coach card, then one card per position group.
 * See ClubSquad.js for the PREVIEW STUB every name on it reads from.
 *
 * Shares `.club-overview__card`, `.club-overview__header` / `__title` and
 * `.club-overview__divider` with the Overview tab's own cards — same chrome,
 * same role, so nothing here duplicates them. Everything below is new: the
 * coach card's layout and the player row, including its star.
 */

.club-squad {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding-inline: var(--space-4);
  opacity: 1;
  transition: opacity var(--duration) var(--easing);
}

/* Same UA-rule note as .club-overview[hidden] — see that file. */
.club-squad[hidden] {
  display: none;
}

.club-squad[data-open="false"] {
  opacity: 0;
}

/* --- Coach card --------------------------------------------------------- */

.squad-coach {
  flex-direction: row;
  align-items: center;
  gap: var(--space-3);
}

.squad-coach__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.squad-coach__name {
  font-size: var(--text-md);
  font-weight: var(--weight-bold);
  color: var(--text);
}

.squad-coach__meta {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
}

/* --- Position group cards ------------------------------------------------ */

.squad-group__rows {
  display: flex;
  flex-direction: column;
}

/*
 * The star's gutter — the same reserved-column idea `--row-star` is in
 * match-row.css, spelled out as one length here since this row is a flex box
 * rather than a grid.
 */
.squad-row {
  --squad-star: 34px;

  position: relative;
}

.squad-row__button {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding-block: var(--space-3);
  /* Clears the star's gutter so the text column never runs under it. */
  padding-right: calc(var(--squad-star) + var(--space-1));
  text-align: left;
}

.squad-row__text {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.squad-row__name {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--text);
}

.squad-row__meta {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  color: var(--text-muted);
  font-size: var(--text-2xs);
  font-weight: var(--weight-medium);
}

.squad-row__dot {
  color: var(--text-muted);
}

.squad-nationality {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/*
 * Only rendered for a player with an active injury — see PlayerRow in
 * ClubSquad.js. No reserved height on a healthy row: this either exists as a
 * third line or the row is two lines tall, never a two-line row with a gap
 * where a third would go.
 */
.squad-row__injury {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
  color: var(--injury);
  font-size: var(--text-2xs);
  font-weight: var(--weight-medium);
}

/*
 * Sibling of the row button, not a child — same construction as
 * `.match-row__star`, and the same reason: nested buttons are invalid, and
 * the two taps have to be genuinely independent. Later in the DOM, so it
 * takes the touch that lands on it and the row underneath never sees one.
 */
.squad-row__star {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  display: grid;
  place-items: center;
  width: calc(var(--squad-star) + var(--space-2));
  color: var(--text-muted);
}

/* Filled blue: --accent owns "this one is selected", and a favourite is that. */
.squad-row__star[aria-pressed="true"] {
  color: var(--accent);
}
