/*
 * FBHL front-end views (Phase D).
 * Scoped under .fbhl to avoid colliding with theme styles. Clean, legible,
 * responsive sports-stats tables. No inline <style> — this file is enqueued.
 */

.fbhl {
	--fbhl-border: #e2e5ea;
	--fbhl-head-bg: #1d2733;
	--fbhl-head-fg: #ffffff;
	--fbhl-row-alt: #f6f8fa;
	--fbhl-accent: #2271b1;
	--fbhl-muted: #6b7280;
	color: #1d2733;
	font-size: 15px;
	line-height: 1.5;
	max-width: 100%;
}

.fbhl * {
	box-sizing: border-box;
}

.fbhl .fbhl-heading {
	font-size: 1.6rem;
	margin: 0 0 .5em;
	display: flex;
	align-items: center;
	gap: .5rem;
}

.fbhl .fbhl-note,
.fbhl .fbhl-backlink {
	color: var(--fbhl-muted);
	font-size: .85rem;
	margin: .25em 0 1em;
}

.fbhl .fbhl-backlink a {
	color: var(--fbhl-accent);
	text-decoration: none;
}

.fbhl .fbhl-empty {
	padding: 1rem 1.25rem;
	background: var(--fbhl-row-alt);
	border-left: 4px solid var(--fbhl-accent);
	border-radius: 4px;
	color: #333;
}

/* ---- Season selector ---- */
.fbhl-season-nav {
	margin: 0 0 1.25rem;
	padding: .5rem 0;
	border-bottom: 1px solid var(--fbhl-border);
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: .35rem .5rem;
}

.fbhl-season-nav__label {
	font-weight: 600;
	color: var(--fbhl-muted);
	margin-right: .25rem;
}

.fbhl-season-nav__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: .3rem;
}

.fbhl-season-nav__item a,
.fbhl-season-nav__item span {
	display: inline-block;
	padding: .2rem .55rem;
	border-radius: 4px;
	text-decoration: none;
	font-size: .85rem;
	color: var(--fbhl-accent);
}

.fbhl-season-nav__item a:hover {
	background: var(--fbhl-row-alt);
}

.fbhl-season-nav__item.is-active span {
	background: var(--fbhl-head-bg);
	color: var(--fbhl-head-fg);
	font-weight: 600;
}

/* ---- Tables ---- */
.fbhl-table-scroll {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	margin-bottom: 1.5rem;
}

.fbhl-table {
	width: 100%;
	border-collapse: collapse;
	font-variant-numeric: tabular-nums;
	min-width: 480px;
	border-spacing: 0;
}

.fbhl-table th,
.fbhl-table td {
	padding: .55rem .6rem;
	text-align: center;
	border-bottom: 1px solid var(--fbhl-border);
	white-space: nowrap;
}

.fbhl-table thead th {
	background: var(--fbhl-head-bg);
	color: var(--fbhl-head-fg);
	font-size: .78rem;
	text-transform: uppercase;
	letter-spacing: .03em;
	position: sticky;
	top: 0;
}

.fbhl-table tbody tr:nth-child(even) {
	background: var(--fbhl-row-alt);
}

.fbhl-table .fbhl-team-col,
.fbhl-table td:nth-child(2) {
	text-align: left;
}

.fbhl-table .fbhl-rank,
.fbhl-table .fbhl-num {
	color: var(--fbhl-muted);
	width: 2.5rem;
	font-weight: 600;
}

.fbhl-table .fbhl-pts {
	font-weight: 700;
}

.fbhl-table a {
	color: var(--fbhl-accent);
	text-decoration: none;
}

.fbhl-table a:hover {
	text-decoration: underline;
}

.fbhl-table tfoot .fbhl-career th,
.fbhl-table tfoot .fbhl-career td {
	background: #eef2f6;
	font-weight: 700;
	border-top: 2px solid var(--fbhl-head-bg);
}

.fbhl-table tfoot .fbhl-career th {
	text-align: right;
}

.fbhl .fbhl-nostats {
	color: var(--fbhl-muted);
	font-style: italic;
}

.fbhl .fbhl-captain {
	display: inline-block;
	font-size: .7rem;
	font-weight: 700;
	color: #fff;
	background: var(--fbhl-accent);
	border-radius: 3px;
	padding: 0 .3rem;
	margin-left: .2rem;
	vertical-align: middle;
}

/* ---- Colour swatches ---- */
.fbhl-swatch {
	display: inline-block;
	width: .85rem;
	height: .85rem;
	border-radius: 3px;
	border: 1px solid rgba(0, 0, 0, .2);
	margin-right: .45rem;
	vertical-align: baseline;
	background: #cbd2da;
	flex: 0 0 auto;
}

.fbhl-swatch--red { background: #d7263d; }
.fbhl-swatch--blue { background: #1c65c9; }
.fbhl-swatch--green { background: #1f9d55; }
.fbhl-swatch--yellow { background: #f4c20d; }
.fbhl-swatch--white { background: #ffffff; }
.fbhl-swatch--black { background: #1d2733; }
.fbhl-swatch--grey,
.fbhl-swatch--gray { background: #8a939e; }
.fbhl-swatch--purple { background: #7b3fbf; }
.fbhl-swatch--orange { background: #e8730c; }
.fbhl-swatch--pink { background: #e8578f; }
.fbhl-swatch--teal { background: #14b3a6; }
.fbhl-swatch--maroon { background: #7b1e2b; }

/* ---- Schedule ---- */
.fbhl-schedule .fbhl-date-heading {
	font-size: 1.05rem;
	margin: 1.25rem 0 .4rem;
	padding-bottom: .25rem;
	border-bottom: 2px solid var(--fbhl-border);
	color: var(--fbhl-head-bg);
}

.fbhl-game-list {
	list-style: none;
	margin: 0 0 .5rem;
	padding: 0;
}

.fbhl-game {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: .5rem .9rem;
	padding: .55rem .25rem;
	border-bottom: 1px solid var(--fbhl-border);
}

.fbhl-game__time {
	color: var(--fbhl-muted);
	font-size: .85rem;
	min-width: 4.5rem;
}

.fbhl-game__teams {
	font-weight: 600;
	flex: 1 1 auto;
	min-width: 12rem;
}

.fbhl-game__vs {
	color: var(--fbhl-muted);
	font-weight: 400;
}

.fbhl-game__score {
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	min-width: 4rem;
	text-align: right;
}

.fbhl-game__score--pending {
	color: var(--fbhl-muted);
	font-weight: 500;
	font-style: italic;
}

.fbhl-game__loc {
	color: var(--fbhl-muted);
	font-size: .8rem;
}

.fbhl-game__badge {
	font-size: .68rem;
	text-transform: uppercase;
	letter-spacing: .04em;
	background: #f4c20d;
	color: #1d2733;
	border-radius: 3px;
	padding: .1rem .35rem;
	font-weight: 700;
}

/* ---- Teams grid ---- */
.fbhl-team-grid {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
	gap: .75rem;
}

.fbhl-team-card__link {
	display: flex;
	align-items: center;
	gap: .5rem;
	padding: .85rem 1rem;
	border: 1px solid var(--fbhl-border);
	border-radius: 6px;
	text-decoration: none;
	color: #1d2733;
	background: #fff;
	transition: box-shadow .12s ease, border-color .12s ease;
}

.fbhl-team-card__link:hover {
	border-color: var(--fbhl-accent);
	box-shadow: 0 1px 6px rgba(29, 39, 51, .12);
}

.fbhl-team-card__name {
	font-weight: 600;
}

/* ---- All-time / Hall of Fame / League index ---- */
.fbhl .fbhl-subheading {
	font-size: 1.15rem;
	margin: 1.5rem 0 .5rem;
	padding-bottom: .25rem;
	border-bottom: 2px solid var(--fbhl-border);
	color: var(--fbhl-head-bg);
}

.fbhl .fbhl-intro {
	font-size: 1rem;
	color: #333;
	margin: 0 0 1rem;
	max-width: 46rem;
}

/* Records tables: left-align the record label (row header) and holder column. */
.fbhl-table--records tbody th[scope="row"] {
	text-align: left;
	font-weight: 600;
	background: transparent;
	color: #1d2733;
	text-transform: none;
	letter-spacing: 0;
}

.fbhl-table--records td:nth-child(3) {
	text-align: left;
}

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

.fbhl-index-links__item a {
	display: block;
	padding: .8rem 1rem;
	border: 1px solid var(--fbhl-border);
	border-radius: 6px;
	text-decoration: none;
	color: #1d2733;
	background: #fff;
	font-weight: 600;
	transition: box-shadow .12s ease, border-color .12s ease;
}

.fbhl-index-links__item a:hover {
	border-color: var(--fbhl-accent);
	box-shadow: 0 1px 6px rgba(29, 39, 51, .12);
}

@media (max-width: 600px) {
	.fbhl .fbhl-heading {
		font-size: 1.35rem;
	}
	.fbhl-game__score {
		text-align: left;
	}
}

/* --------------------------------------------------------------------------
 * Public season switcher (rendered by fbhl_fe_render_season_switcher() on the
 * schedule / player-stats / roster theme templates).
 * ------------------------------------------------------------------------ */
.fbhl-season-switcher {
	margin: 0 0 1.25em;
	padding: .5em .75em;
	display: inline-flex;
	align-items: center;
	gap: .5em;
	background: #f4f6f8;
	border: 1px solid #d9dee3;
	border-radius: 6px;
	font-size: 14px;
}

.fbhl-season-switcher label {
	font-weight: 600;
	margin: 0;
	color: #1d2733;
}

.fbhl-season-switcher select {
	padding: .3em 1.6em .3em .5em;
	border: 1px solid #c3ccd4;
	border-radius: 4px;
	background: #fff;
	font-size: 14px;
	max-width: 260px;
	cursor: pointer;
}

.fbhl-season-switcher noscript button {
	margin-left: .4em;
}

.fbhl-note {
	color: #6a7683;
	font-size: 13px;
	margin-top: .5em;
}

/* --------------------------------------------------------------------------
 * Player directory search box (player_directory.php).
 * ------------------------------------------------------------------------ */
.fbhl-dir-search {
	margin: 0 0 1em;
	display: flex;
	align-items: center;
	gap: .5em;
	flex-wrap: wrap;
}

.fbhl-dir-search label {
	font-weight: 600;
	margin: 0;
	color: #1d2733;
}

.fbhl-dir-search input[type="search"] {
	padding: .4em .6em;
	border: 1px solid #c3ccd4;
	border-radius: 4px;
	font-size: 14px;
	min-width: 220px;
	max-width: 320px;
}
