/*
 * Game Matchup block. Team colours are set inline by render.php from team-info/list.json
 * (--bb-team-bg, --bb-team-fg, --bb-team-accent); a team without colours keeps the defaults:
 * wine red, cream text and a Guardians navy stripe.
 */
.basebelles-matchup {
	--bb-matchup-bg: var(--bb-team-bg, var(--bb-wine-red, #84172c));
	--bb-matchup-fg: var(--bb-team-fg, var(--bb-sandstone-cream, #f3efe0));
	--bb-matchup-accent: var(--bb-team-accent, var(--bb-slate-blue, #00385d));

	/*
	 * Fill the parent's height when it has one (a column beside the featured image), with the
	 * logos, text and button kept together in the vertical middle. With an auto-height parent
	 * (the footer) this resolves to auto and changes nothing.
	 */
	display: flex;
	flex-direction: column;
	height: 100%;
	box-sizing: border-box;
	margin-block: 2rem;
	background: var(--bb-matchup-bg);
	color: var(--bb-matchup-fg);
	border-top: 6px solid var(--bb-matchup-accent);
	border-radius: 6px;
	overflow: hidden;
}

.basebelles-matchup .matchup-inner {
	display: flex;
	flex: 1;
	flex-wrap: wrap;
	align-items: center;
	align-content: center;
	gap: 1.25rem 1.5rem;
	padding: 1.5rem 1.75rem;
}

.basebelles-matchup .matchup-logos {
	display: flex;
	flex: none;
	align-items: center;
	gap: 0.625rem;
}

/* White behind the logo so dark logos still show on dark team colours. */
.basebelles-matchup .matchup-logo {
	display: grid;
	place-items: center;
	width: 60px;
	height: 60px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 0 0 2px var(--bb-matchup-accent);
}

.basebelles-matchup .matchup-logo img {
	width: 44px;
	height: 44px;
	object-fit: contain;
}

.basebelles-matchup .matchup-vs {
	font-weight: 700;
	font-size: 0.95rem;
}

.basebelles-matchup .matchup-body {
	display: flex;
	flex: 1 1 260px;
	flex-direction: column;
	gap: 0.375rem;
	min-width: 0;
}

.basebelles-matchup .matchup-kicker {
	margin: 0;
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.basebelles-matchup .matchup-title {
	margin: 0;
	color: inherit;
	font-size: clamp(1.4rem, 3.5vw, 1.75rem);
	line-height: 1.1;
}

.basebelles-matchup .matchup-pills {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 0.25rem 0 0;
	padding: 0;
	list-style: none;
}

.basebelles-matchup .matchup-pill {
	display: inline-block;
	padding: 0.2rem 0.75rem;
	border: 1px solid currentColor;
	border-radius: 999px;
	color: inherit;
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-decoration: none;
	text-transform: uppercase;
}

.basebelles-matchup a.matchup-pill:hover,
.basebelles-matchup a.matchup-pill:focus-visible {
	background: var(--bb-matchup-fg);
	color: var(--bb-matchup-bg);
}

.basebelles-matchup .matchup-link {
	display: inline-flex;
	flex: none;
	align-items: center;
	gap: 0.4em;
	box-sizing: border-box;
	min-height: 44px;
	padding: 0.75rem 1.125rem;
	border-radius: 4px;
	background: var(--bb-matchup-fg);
	color: var(--bb-matchup-bg);
	font-weight: 700;
	font-size: 0.95rem;
	text-decoration: none;
}

.basebelles-matchup .matchup-link:hover,
.basebelles-matchup .matchup-link:focus-visible {
	text-decoration: underline;
}

.basebelles-matchup a:focus-visible {
	outline: 2px solid var(--bb-matchup-fg);
	outline-offset: 2px;
}

/* In a column the column already spaces things; the card's own margin would push it past the photo beside it. */
.wp-block-column > .basebelles-matchup {
	margin-block: 0;
}

/*
 * Stacked in a column, everything centres horizontally. Not in the footer: there it's one
 * row (logos, text, button) and centred text in the middle would float.
 */
.wp-block-column > .basebelles-matchup .matchup-inner {
	justify-content: center;
	text-align: center;
}

.wp-block-column > .basebelles-matchup .matchup-pills {
	justify-content: center;
}

.basebelles-matchup--placeholder {
	padding: 1rem 1.25rem;
	border: 1px dashed var(--bb-accent-slate, #4a6274);
	background: transparent;
	color: var(--bb-accent-slate, #4a6274);
}

.basebelles-matchup--placeholder p {
	margin: 0;
}

@media screen and (max-width: 480px) {
	.basebelles-matchup .matchup-link {
		width: 100%;
		justify-content: center;
	}
}
