/*
 * 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 {
  /* Both Overview cards run a step tighter vertically than the page's other
     cards — full width, every font size and crest at its usual size, only
     the block padding and gaps one step down. */
  display: flex;
  flex-direction: column;
  gap: var(--space-15);
  padding-inline: var(--space-5);
  padding-block: var(--space-15);
  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: var(--space-1);
}

.club-overview__team {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  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: var(--space-05);
  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: var(--space-05);
  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);
}

/* A button through to the fixture (ClubOverview.js). The padding widens the
   tap area past the pill; the negative margin keeps the row's rhythm. */
.club-overview__form-item {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  min-width: 0;
  margin: calc(var(--space-1) * -1);
  padding: var(--space-1);
  border-radius: var(--radius-md);
  transition: background var(--duration) var(--easing);
}

.club-overview__form-item:active {
  background: var(--surface-sunken);
}

.club-overview__form-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: calc(42px * var(--scale));
  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);
}

/*
 * The four slots the tab's cards land in (ClubOverview.js) — one per answer
 * from the backend, so each can fill on its own clock. `display: contents`
 * keeps the cards themselves as the flex column's children, so the column's
 * gap runs between cards and not between slots; the attribute rule below is
 * what `hidden` needs to win over it, the same UA-rule note as the panel.
 */
.club-overview__slot {
  display: contents;
}

.club-overview__slot[hidden] {
  display: none;
}
