/*
 * The club page's Overview tab — a match card, then the Team Form card. See
 * ClubOverview.js for why there are only ever these two, and for which parts
 * of each are a clearly-marked stand-in rather than something real.
 */

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

/*
 * `[hidden]` is a UA rule, so the `display: flex` above it wins outright on
 * its own and the attribute is silently ignored — the same failure mode
 * FixtureDetails' status block and club-details.css's own `.club-details[hidden]`
 * both document. `ClubDetails.js` toggles this on tab switches, so it needs
 * saying here too.
 */
.club-overview[hidden] {
  display: none;
}

/*
 * The cross-fade `setOverviewVisible` in ClubDetails.js drives. Pure
 * appear/disappear — `--easing`, not `--spring` — the same call INTERACTIONS.md
 * makes for skeleton-to-content swaps: nothing here is *moving*, so an
 * overshoot would be motion this panel never had a reason to promise.
 */
.club-overview[data-open="false"] {
  opacity: 0;
}

.club-overview__card {
  /* Shortens both Overview cards by tightening vertical padding/gaps only —
     full width, and every font size and crest stays at its original size.
     Scoped here rather than touching --space-* itself so nothing else in the
     app gets denser with it. */
  --overview-vscale: 0.56;

  display: flex;
  flex-direction: column;
  gap: calc(var(--space-4) * var(--overview-vscale));
  padding-inline: var(--space-5);
  padding-block: calc(var(--space-5) * var(--overview-vscale));
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

/*
 * The match card's own preview stub — the rare case where it has nothing real
 * to show, see selectClubOverviewFixtures in state/selectors.js. Dimmed as a
 * whole rather than restyled to match a real card, so it never looks like the
 * result it isn't. The Team Form card is never real in the first place, so it
 * carries no equivalent of this rule — see the note on TeamFormCard in
 * ClubOverview.js for why unmistakable naming is enough there instead.
 */
.club-overview__card[data-preview="true"] {
  opacity: 0.55;
}

/* --- Header ----------------------------------------------------------------- */

.club-overview__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

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

.club-overview__competition {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
  max-width: 55%;
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
}

/*
 * Muted, and set here rather than on `.club-overview__competition` around it:
 * that class also wraps the Season Stats card's header, where the text beside
 * the crest is the card's own title and has no business dimming. This is the
 * one span that is a competition's name.
 */
.club-overview__competition-name {
  min-width: 0;
  color: var(--text-muted);
}

/* --- Row: team, centre, team ------------------------------------------------ */

.club-overview__row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  gap: var(--space-3);
  padding-block: calc(var(--space-3) * var(--overview-vscale));
}

.club-overview__team {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(var(--space-3) * var(--overview-vscale));
  min-width: 0;
  text-align: center;
}

.club-overview__team-name {
  max-width: 100%;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text);
}

.club-overview__centre {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(var(--space-2) * var(--overview-vscale));
  padding-inline: var(--space-3);
}

.club-overview__time {
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.club-overview__score {
  display: inline-flex;
  align-items: baseline;
  gap: var(--space-2);
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.club-overview__score-dash {
  color: var(--text-muted);
}

/*
 * The losing digit dims, same call FixtureDetails.markOutcome makes for the
 * same reason: muted grey, never --color-success / --color-error — those own
 * predictions and payments, and reusing either here would blur exactly the
 * distinction tokens.css keeps them apart for.
 */
.club-overview__score-digit[data-outcome="loss"] {
  color: var(--text-muted);
  font-weight: var(--weight-medium);
}

.club-overview__date {
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--text-secondary);
}

/* --- Footer ------------------------------------------------------------------ */

.club-overview__divider {
  height: 1px;
  margin: 0;
  border: none;
  background: var(--border);
}

.club-overview__footer {
  align-self: center;
  padding-block: calc(var(--space-1) * var(--overview-vscale));
  color: var(--accent);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
}

/* --- Team form ---------------------------------------------------------------
 *
 * Five results, oldest to newest, left to right. Fixed at five and never
 * scrolling — see ClubOverview.js. This card is never dimmed the way the match
 * card's own rare stub is — see the note on TeamFormCard in ClubOverview.js.
 */

.club-overview__form-row {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
}

.club-overview__form-item {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  gap: calc(var(--space-3) * var(--overview-vscale));
  min-width: 0;
}

.club-overview__form-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  font-variant-numeric: tabular-nums;
  /* Draw borrows the neutral scale rather than gaining its own hue — see the
     token comment in tokens.css. */
  background: var(--surface-sunken);
  color: var(--text-secondary);
}

.club-overview__form-pill[data-outcome="win"] {
  background: var(--form-win-soft);
  color: var(--form-win);
}

.club-overview__form-pill[data-outcome="loss"] {
  background: var(--form-loss-soft);
  color: var(--form-loss);
}
