/* ------------------------------------------------------------------------- *
 *  FootballDay Teams
 *  Self-contained tokens so the plugin does not depend on theme internals.
 *  Dashwall switches themes with a `dark` class on <body>.
 * ------------------------------------------------------------------------- */

.fd-team,
.fd-team-index {
	--fd-text: #212632;
	--fd-muted: #77808f;
	--fd-line: #e6e8ec;
	--fd-surface: #f6f7f9;
	--fd-accent: #1e9e5a;
	--fd-win: #1e9e5a;
	--fd-draw: #9aa2b1;
	--fd-loss: #d64545;
	--fd-on-result: #fff;
}

body.dark .fd-team,
body.dark .fd-team-index {
	--fd-text: #fff;
	--fd-muted: #9ba4b3;
	/* Must stay lighter than --fd-surface, or the 1px grid gaps disappear. */
	--fd-line: #4d5464;
	--fd-surface: #3b404d;
	--fd-accent: #34c377;
	--fd-win: #2fae68;
	--fd-draw: #6b7382;
	--fd-loss: #cf4a4a;
}

/* ------------------------------------ */
/*  Card rhythm
/* ------------------------------------ */

/*
 * Dashwall puts the inner padding on .entry / .entry-header / .entry-footer
 * (0 40px, 40px top) rather than on .page-card, and our sections sit outside
 * those classes — without this the crest sits flush against the card edge.
 */
.fd-team {
	padding: 40px;
}

/* .entry already carries the theme's own 40px sides; don't pay it twice. */
.fd-team .fd-team-description {
	padding-left: 0;
	padding-right: 0;
}

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

.fd-team-header {
	display: flex;
	align-items: center;
	gap: 24px;
	flex-wrap: wrap;
	padding-bottom: 24px;
	margin-bottom: 24px;
	border-bottom: 1px solid var(--fd-line);
}

.fd-team-crest {
	flex: 0 0 auto;
	width: 96px;
	height: 96px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.fd-team-crest img {
	max-width: 100%;
	max-height: 96px;
	width: auto;
	height: auto;
}

.fd-team-heading {
	flex: 1 1 240px;
	min-width: 0;
}

/*
 * The theme only sizes .entry-title inside .entry-header, so an H1 anywhere
 * else falls back to the 15px body size — smaller than this page's own section
 * titles. These are the theme's article-title values, kept in step with it.
 */
.fd-team-title {
	margin: 0;
	color: var(--fd-text);
	font-size: 36px;
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: -0.02em;
}

.fd-team-facts {
	list-style: none;
	margin: 12px 0 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 8px 24px;
}

.fd-team-facts li {
	display: flex;
	flex-direction: column;
	gap: 2px;
	margin: 0;
}

.fd-fact-label {
	font-size: 11px;
	line-height: 1.2;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--fd-muted);
}

.fd-fact-value {
	font-size: 14px;
	line-height: 1.3;
	font-weight: 600;
	color: var(--fd-text);
}

/* ------------------------------------ */
/*  Sections
/* ------------------------------------ */

.fd-team-section {
	margin-bottom: 32px;
}

.fd-team-section-title {
	margin: 0 0 16px;
	font-size: 20px;
	line-height: 1.3;
	color: var(--fd-text);
}

/* ------------------------------------ */
/*  Season stats
/* ------------------------------------ */

.fd-stat-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 1px;
	background: var(--fd-line);
	border: 1px solid var(--fd-line);
	border-radius: 6px;
	overflow: hidden;
}

.fd-stat {
	background: var(--fd-surface);
	padding: 14px 10px;
	text-align: center;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.fd-stat-value {
	font-size: 22px;
	line-height: 1.1;
	font-weight: 700;
	color: var(--fd-text);
	font-variant-numeric: tabular-nums;
}

.fd-stat-lead .fd-stat-value {
	color: var(--fd-accent);
}

.fd-stat-label {
	font-size: 11px;
	line-height: 1.2;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--fd-muted);
}

/* ------------------------------------ */
/*  Form guide
/* ------------------------------------ */

.fd-team-form {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-top: 16px;
	flex-wrap: wrap;
}

.fd-form-label {
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--fd-muted);
}

.fd-form-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	gap: 6px;
}

.fd-form-item {
	width: 26px;
	height: 26px;
	margin: 0;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 12px;
	font-weight: 700;
	color: var(--fd-on-result);
	background: var(--fd-draw);
	cursor: default;
}

.fd-form-w { background: var(--fd-win); }
.fd-form-d { background: var(--fd-draw); }
.fd-form-l { background: var(--fd-loss); }

/* ------------------------------------ */
/*  Fixtures
/* ------------------------------------ */

.fd-fixture-list {
	list-style: none;
	margin: 0;
	padding: 0;
	border: 1px solid var(--fd-line);
	border-radius: 6px;
	overflow: hidden;
}

.fd-fixture {
	display: flex;
	align-items: center;
	gap: 16px;
	margin: 0;
	padding: 12px 16px;
	border-bottom: 1px solid var(--fd-line);
}

.fd-fixture:last-child {
	border-bottom: 0;
}

.fd-fixture-date {
	flex: 0 0 62px;
	text-align: center;
}

.fd-fixture-date time {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.fd-fixture-day {
	font-size: 14px;
	font-weight: 700;
	color: var(--fd-text);
	white-space: nowrap;
}

.fd-fixture-time {
	font-size: 12px;
	color: var(--fd-muted);
	font-variant-numeric: tabular-nums;
}

.fd-fixture-main {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
}

.fd-fixture-venue {
	flex: 0 0 auto;
	font-size: 10px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	padding: 3px 7px;
	border-radius: 3px;
	background: var(--fd-surface);
	color: var(--fd-muted);
}

.fd-fixture-venue-home {
	background: var(--fd-accent);
	color: #fff;
}

.fd-fixture-opponent {
	display: flex;
	align-items: center;
	gap: 8px;
	min-width: 0;
	font-size: 15px;
	font-weight: 600;
	color: var(--fd-text);
}

.fd-fixture-opponent a {
	color: inherit;
	text-decoration: none;
}

.fd-fixture-opponent a:hover {
	text-decoration: underline;
}

.fd-fixture-crest {
	flex: 0 0 auto;
	width: 24px;
	height: 24px;
	object-fit: contain;
}

.fd-fixture-meta {
	flex: 0 0 auto;
	text-align: right;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.fd-fixture-competition {
	font-size: 12px;
	color: var(--fd-muted);
}

.fd-fixture-matchday {
	font-size: 11px;
	color: var(--fd-muted);
}

.fd-fixture-flag {
	font-size: 11px;
	font-weight: 700;
	color: var(--fd-loss);
}

/* ------------------------------------ */
/*  Roster link on the team page
/* ------------------------------------ */

.fd-roster-link {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 16px 20px;
	border: 1px solid var(--fd-line);
	border-radius: 6px;
	text-decoration: none;
	color: var(--fd-text);
	transition: border-color 0.15s ease;
}

.fd-roster-link:hover {
	border-color: var(--fd-accent);
}

.fd-roster-link-text {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 3px;
}

.fd-roster-link-title {
	font-size: 16px;
	font-weight: 600;
	line-height: 1.3;
}

.fd-roster-link-desc {
	font-size: 13px;
	line-height: 1.35;
	color: var(--fd-muted);
}

.fd-roster-link-arrow {
	flex: 0 0 auto;
	font-size: 18px;
	color: var(--fd-accent);
}

/* ------------------------------------ */
/*  Roster page
/* ------------------------------------ */

.fd-roster-parent {
	margin: 0 0 6px;
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.06em;
}

.fd-roster-parent a {
	color: var(--fd-muted);
	text-decoration: none;
}

.fd-roster-parent a:hover {
	color: var(--fd-accent);
}

.fd-roster-group {
	margin-bottom: 28px;
}

.fd-roster-count {
	display: inline-block;
	margin-left: 8px;
	padding: 1px 8px;
	border-radius: 10px;
	background: var(--fd-surface);
	color: var(--fd-muted);
	font-size: 12px;
	font-weight: 600;
	vertical-align: middle;
}

.fd-roster-list {
	list-style: none;
	margin: 0;
	padding: 0;
	border: 1px solid var(--fd-line);
	border-radius: 6px;
	overflow: hidden;
}

.fd-player {
	display: flex;
	align-items: center;
	gap: 14px;
	margin: 0;
	padding: 10px 16px;
	border-bottom: 1px solid var(--fd-line);
}

.fd-player:last-child {
	border-bottom: 0;
}

.fd-player-number {
	flex: 0 0 32px;
	text-align: center;
	font-size: 14px;
	font-weight: 700;
	color: var(--fd-muted);
	font-variant-numeric: tabular-nums;
}

.fd-player-main {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.fd-player-name {
	font-size: 15px;
	font-weight: 600;
	line-height: 1.3;
	color: var(--fd-text);
}

.fd-player-position {
	font-size: 12px;
	line-height: 1.3;
	color: var(--fd-muted);
}

.fd-player-meta {
	flex: 0 0 auto;
	text-align: right;
	display: flex;
	flex-direction: column;
	gap: 2px;
	font-size: 12px;
	color: var(--fd-muted);
}

.fd-player-age {
	font-variant-numeric: tabular-nums;
}

.fd-roster-back {
	margin: 0 0 16px;
	font-size: 14px;
}

.fd-roster-back a {
	color: var(--fd-accent);
	text-decoration: none;
}

.fd-roster-back a:hover {
	text-decoration: underline;
}

/* ------------------------------------ */
/*  Description and footer
/* ------------------------------------ */

.fd-team-description {
	margin-bottom: 24px;
}

.fd-team-updated {
	margin: 0;
	padding-top: 16px;
	border-top: 1px solid var(--fd-line);
	font-size: 12px;
	color: var(--fd-muted);
}

.fd-empty {
	margin: 0;
	color: var(--fd-muted);
}

/* ------------------------------------ */
/*  Team index
/* ------------------------------------ */

.fd-team-index {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 12px;
}

.fd-team-index-item {
	margin: 0;
}

.fd-team-index-item a {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px;
	border: 1px solid var(--fd-line);
	border-radius: 6px;
	text-decoration: none;
	color: var(--fd-text);
}

.fd-team-index-item a:hover {
	border-color: var(--fd-accent);
}

.fd-team-index-crest {
	flex: 0 0 auto;
	width: 36px;
	height: 36px;
	object-fit: contain;
}

.fd-team-index-text {
	min-width: 0;
}

.fd-team-index-name {
	display: block;
	font-weight: 600;
	line-height: 1.25;
}

.fd-team-index-meta {
	display: block;
	font-size: 12px;
	color: var(--fd-muted);
}

/* ------------------------------------ */
/*  Responsive
/* ------------------------------------ */

/* The theme steps .entry-title down to 28px here. */
@media only screen and (max-width: 719px) {

	.fd-team-title {
		font-size: 28px;
		letter-spacing: -0.01em;
	}

	.fd-team-section-title {
		font-size: 18px;
	}
}

@media only screen and (max-width: 640px) {

	.fd-team-header {
		gap: 16px;
	}

	.fd-team-crest {
		width: 64px;
		height: 64px;
	}

	.fd-team-crest img {
		max-height: 64px;
	}

	.fd-stat-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.fd-fixture {
		flex-wrap: wrap;
		gap: 8px 12px;
	}

	.fd-fixture-meta {
		flex: 1 1 100%;
		flex-direction: row;
		gap: 8px;
		text-align: left;
		padding-left: 78px;
	}

	.fd-player {
		gap: 10px;
		padding: 10px 12px;
	}

	.fd-player-meta {
		gap: 0;
	}
}

/* The theme drops its card padding to 20px and .entry-title to 22px here. */
@media only screen and (max-width: 479px) {

	.fd-team {
		padding: 20px;
	}

	.fd-team-title {
		font-size: 22px;
	}
}
