/*
 * 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: var(--space-05);
  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: calc(34px * var(--scale));

  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: var(--space-05);
  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: var(--space-1);
}

/*
 * 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: var(--space-1);
  min-width: 0;
  margin-top: var(--space-05);
  color: var(--injury);
  font-size: var(--text-2xs);
  font-weight: var(--weight-medium);
}

/*
 * The absence's state (ClubSquad.js `absenceMeta`): out injured is the
 * default red above; a suspension takes the red card's colour, a doubt the
 * amber the Lineups tab uses for "doubtful", and a non-medical absence
 * ("Transfer negotiations") stays muted — it is information, not an alarm.
 */
.squad-row__injury[data-state="suspension"] {
  color: var(--card-red);
}

.squad-row__injury[data-state="doubtful"] {
  color: var(--doubtful);
}

.squad-row__injury[data-state="other"] {
  color: var(--text-muted);
}

/* The photo and the badge over its corner. */
.squad-row__avatar {
  position: relative;
  flex: none;
  display: inline-flex;
}

.squad-row__badge {
  position: absolute;
  right: calc(-2px * var(--scale));
  bottom: calc(-2px * var(--scale));
  display: grid;
  place-items: center;
  width: calc(16px * var(--scale));
  height: calc(16px * var(--scale));
  border: calc(1.5px * var(--scale)) solid var(--surface);
  border-radius: var(--radius-full);
  background: var(--injury);
  color: var(--text-inverse);
}

.squad-row__badge[data-state="suspension"] {
  background: var(--card-red);
}

.squad-row__badge[data-state="doubtful"] {
  background: var(--doubtful);
}

.squad-row__badge[data-state="other"] {
  background: var(--text-muted);
}

/*
 * 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);
}
