/*
 * Team Detail page styles (Task 1.21). Loaded only by
 * templates/football/team_detail.html - built entirely from existing
 * tokens/primitives (.card, .metric-row, .badge, .pill,
 * .fixture-row/.form-strip from sports-components.css), no new colors.
 * The Prediction Slip sidecar needs no layout here:
 * static/css/responsive.css already reserves `.site-main` space for it
 * at >=1024px, and this page places no second slip.
 */

/* Task 1.72A: matches the League Detail header restructure - the
   crest+name identity sits in its own row, with the favourite button
   below it, rather than beside it (consistency across the two sibling
   detail pages; see league-detail.css's own identical comment for the
   full reasoning, including why .favourite-button-form's shared
   margin-left:auto rule needs resetting only inside this page's own
   header). */
.team-detail__header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-16);
  margin-bottom: var(--space-24);
}

.team-detail__identity {
  display: flex;
  align-items: center;
  gap: var(--space-16);
  max-width: 100%;
  min-width: 0;
}

.team-detail__header .favourite-button-form {
  margin-left: 0;
}

/* Task 1.72A: the short_name/country/league/season meta line was
   removed entirely (user-requested) - only the venue name remains
   beneath the team name now. Vertically centers that single line
   against the crest using the exact same flex-column +
   justify-content:center + min-height mechanism `.league-card__body`
   already established (sports-components.css) - min-height matches
   the header crest's own "lg" size (crest-badge--lg is 3.5rem) so a
   team with no venue set still centers its bare H1 against the crest,
   and one with a venue centers the H1+venue pair together as a unit. */
.team-detail__identity-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 3.5rem;
  min-width: 0;
}

.team-detail__identity-text .text-h1 {
  margin-bottom: var(--space-4);
  /* Last-resort safety net only: a single word wider than the phone breaks rather than widening the page. */
  overflow-wrap: anywhere;
}

/* Launch polish: on a phone the crest sits above the name, so the name gets the full content width. Beside a 56 px
   crest only ~216 px is left at 320 px, and a long one-word club name ("Mönchengladbach" is ~303 px at the phone H1
   size) pushed the page 71 px wide. A bounded fluid size (28.8 px at 320, the usual 32 px from 356 px) keeps that
   word on one line. Same treatment as League Detail's header; desktop and tablet are unchanged. */
@media (max-width: 479px) {
  .team-detail__identity {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-12);
  }

  .team-detail__identity-text {
    min-height: 0;
  }

  .team-detail__identity-text .text-h1 {
    font-size: clamp(1.75rem, 9vw, 2rem);
  }
}

.team-detail__identity-text .text-caption {
  margin: 0;
}

.team-detail__section {
  padding-block: var(--space-32);
  border-bottom: 1px solid var(--color-border);
}

.team-detail__section:last-of-type {
  border-bottom: none;
}

.team-detail__section-footer {
  margin-top: var(--space-24);
}

.team-detail__fixtures {
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
}

/* ============ Snapshot ============ */
.team-detail__snapshot {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-12);
  max-width: 420px;
}

.team-detail__snapshot-position {
  display: flex;
  align-items: baseline;
  gap: var(--space-12);
  margin-bottom: var(--space-8);
}

/* ============ Competitions list ============ */
.team-detail__competitions {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-12);
}

.team-detail__competitions li {
  display: inline-flex;
  align-items: center;
  gap: var(--space-8);
  padding: var(--space-8) var(--space-16) var(--space-8) var(--space-8);
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
}

.team-detail__disclaimer {
  color: var(--color-text-muted);
}
