/* Club identity — the badge, the kit stripe, the flag and the league (clubs.php).

   The colours come in as two inline custom properties on the badge or on the
   surface it tints: --sa-club (the home colour, already deepened so white ink
   reads on it) and --sa-club-2 (the trim). Every rule falls back to the palette,
   so a club with no colours draws like the rest of the site. Flat: a crest
   image, or a filled disc with letters. No glow, no card. */

.sa-crest {
	--sa-crest-size: 32px;
	display: inline-grid;
	place-items: center;
	flex: 0 0 auto;
	width: var(--sa-crest-size);
	height: var(--sa-crest-size);
	line-height: 1;
	vertical-align: middle;
}
.sa-crest--hero  { --sa-crest-size: clamp(56px, 12vw, 76px); }
.sa-crest--score { --sa-crest-size: clamp(40px, 9vw, 56px); }
.sa-crest--card  { --sa-crest-size: 36px; }
.sa-crest--row   { --sa-crest-size: 18px; }

/* The prose rules of .entry-content (margins, radius, max-width on img) reach
   the crest inside an article's scoreline, so they are reset here. */
.sa-crest .sa-crest__img,
.entry-content .sa-crest .sa-crest__img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	margin: 0;
	border-radius: 0;
	box-shadow: none;
	object-fit: contain;
}

/* No crest: the monogram, white on the home colour, ringed in the trim. */
.sa-crest--mono {
	border-radius: 50%;
	border: 2px solid var(--sa-club-2, var(--sa-border));
	background: var(--sa-club, var(--sa-surface-2));
	color: var(--sa-on-accent);
	font-family: var(--sa-font-display, inherit);
	font-size: calc(var(--sa-crest-size) * .32);
	font-weight: 800;
	letter-spacing: .02em;
	text-transform: uppercase;
	box-sizing: border-box;
}
.sa-crest--row.sa-crest--mono { border-width: 1px; font-size: 7px; }

/* ── Flag + league (the team hub's eyebrow) ─────────────────────────────── */

.sa-club-meta {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-left: 10px;
}
.sa-club-flag {
	font-size: 15px;
	letter-spacing: 0;
	line-height: 1;
}
.sa-club-league {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: var(--sa-text-muted);
}
.sa-club-league::before {
	content: "";
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--sa-club-league, var(--sa-violet));
}
.sa-club-league[data-league="premier-league"]   { --sa-club-league: var(--sa-accent-premier-league); }
.sa-club-league[data-league="la-liga"]          { --sa-club-league: var(--sa-accent-la-liga); }
.sa-club-league[data-league="serie-a"]          { --sa-club-league: var(--sa-accent-serie-a); }
.sa-club-league[data-league="bundesliga"]       { --sa-club-league: var(--sa-accent-bundesliga); }
.sa-club-league[data-league="ligue-1"]          { --sa-club-league: var(--sa-accent-ligue-1); }
.sa-club-league[data-league="international"]    { --sa-club-league: var(--sa-accent-international); }

/* ── Team hub ───────────────────────────────────────────────────────────── */

.sa-group__id {
	display: flex;
	align-items: center;
	gap: clamp(12px, 3vw, 20px);
	min-width: 0;
}
.sa-group__id .sa-group__title { min-width: 0; }

/* The kit stripe: home colour then trim, along the header's hairline. */
.sa-group__head.has-kit { position: relative; }
.sa-group__head.has-kit::after {
	content: "";
	position: absolute;
	left: 0;
	bottom: -1px;
	width: min(160px, 40%);
	height: 3px;
	background: linear-gradient(90deg, var(--sa-club) 0 62%, var(--sa-club-2) 62% 100%);
}

/* Directory card: the badge sits above the name. */
.sa-group__card .sa-crest { margin-bottom: 6px; }

/* ── Supporter Rankings ─────────────────────────────────────────────────── */

.sa-fd__group .sa-crest {
	margin-right: 6px;
	vertical-align: -4px;
}
