/*
 * Schedule and standings. Uses the theme's palette variables when they exist (Kadence's
 * --global-palette*), with plain fallbacks for any other theme. No layout depends on JavaScript.
 */

.lawp-schedule,
.lawp-standings {
	--lawp-ink: var(--global-palette3, #1f1f1f);
	--lawp-muted: var(--global-palette4, #5a5752);
	--lawp-line: var(--global-palette7, #e2ddd3);
	--lawp-soft: var(--global-palette8, #f6f3ee);
	--lawp-accent: var(--global-palette1, #702880);
	--lawp-warn: #b3261e;
	color: var(--lawp-ink);
}

.lawp-schedule__updated {
	margin: 0 0 1rem;
	font-size: 0.9375rem;
	color: var(--lawp-muted);
}

.lawp-schedule__updated--stale {
	padding: 8px 12px;
	border-inline-start: 4px solid var(--lawp-warn);
	background: #fcecea;
	color: var(--lawp-ink);
	font-weight: 600;
}

/* Filters: division chips, then the team picker. */
.lawp-schedule__filters {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px 24px;
	margin: 0 0 1.5rem;
}

.lawp-schedule .lawp-schedule__chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

/* Three classes deep on purpose: themes often style "a link alone in a list item" (this site does,
   at 24px), and that must not shrink the chips below a 40px target. */
.lawp-schedule .lawp-schedule__chips .lawp-schedule__chip {
	display: inline-flex;
	align-items: center;
	min-height: 40px;
	padding: 0 14px;
	border: 1px solid var(--lawp-line);
	border-radius: 999px;
	background: #fff;
	color: var(--lawp-ink);
	font-size: 0.9375rem;
	font-weight: 600;
	text-decoration: none;
}

.lawp-schedule .lawp-schedule__chips .lawp-schedule__chip:hover,
.lawp-schedule .lawp-schedule__chips .lawp-schedule__chip:focus-visible {
	border-color: var(--lawp-accent);
	color: var(--lawp-accent);
}

.lawp-schedule .lawp-schedule__chips .lawp-schedule__chip.is-current {
	border-color: var(--lawp-accent);
	background: var(--lawp-accent);
	color: #fff;
}

.lawp-schedule__team {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin: 0;
}

.lawp-schedule__team label {
	font-weight: 600;
}

.lawp-schedule__team select {
	min-height: 40px;
	max-width: 100%;
}

.lawp-schedule__show {
	min-height: 40px;
	padding: 0 16px;
	border: 0;
	border-radius: 6px;
	background: var(--lawp-accent);
	color: #fff;
	font-weight: 600;
	cursor: pointer;
}

/* Days and games. */
.lawp-schedule__section {
	margin: 2rem 0 0.75rem;
}

.lawp-schedule__day {
	margin: 0 0 1.25rem;
}

.lawp-schedule__day h3 {
	margin: 0 0 0.5rem;
	font-size: 1.125rem;
}

/* !important on display only: themes often set every content table to display:block so wide
   tables scroll (this site does, with a selector no plugin should try to out-rank), which shrinks
   each day's table to its content and leaves no two days the same width. */
.lawp-schedule__games,
.lawp-standings__table {
	display: table !important;
	width: 100%;
	margin: 0;
	border-collapse: collapse;
	font-size: 0.9375rem;
}

.lawp-schedule__games th,
.lawp-schedule__games td,
.lawp-standings__table th,
.lawp-standings__table td {
	padding: 8px 10px;
	border-bottom: 1px solid var(--lawp-line);
	text-align: start;
	vertical-align: top;
}

.lawp-schedule__games thead th,
.lawp-standings__table thead th {
	background: var(--lawp-soft);
	font-size: 0.8125rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--lawp-muted);
}

.lawp-schedule__time {
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}

.lawp-schedule__vs {
	color: var(--lawp-muted);
}

.lawp-schedule__score {
	font-variant-numeric: tabular-nums;
}

/* Played games: team names stacked in the Result cell, their scores stacked in the Score column,
   one line each, so every score sits level with its team. Names do not wrap on wider screens, or a
   wrapped name would push its score out of line; phones get the card layout below. */
.lawp-schedule__result > .lawp-schedule__away,
.lawp-schedule__result > .lawp-schedule__home,
.lawp-schedule__scores > .lawp-schedule__score {
	display: block;
}

.lawp-schedule__scores {
	width: 1%;
	white-space: nowrap;
	text-align: end !important;
}

.lawp-schedule__scores > .lawp-schedule__score {
	min-width: 2ch;
}

.lawp-schedule__scores > .lawp-schedule__status {
	margin-inline-start: 0;
}

.lawp-schedule__score.is-winner {
	font-weight: 700;
}

@media (min-width: 601px) {
	.lawp-schedule__result > .lawp-schedule__away,
	.lawp-schedule__result > .lawp-schedule__home {
		white-space: nowrap;
	}
}

.lawp-schedule__away.is-winner,
.lawp-schedule__home.is-winner {
	font-weight: 700;
}

.lawp-schedule__sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
}

.lawp-schedule__status {
	display: inline-block;
	margin-inline-start: 6px;
	padding: 1px 8px;
	border-radius: 999px;
	background: #fcecea;
	color: var(--lawp-warn);
	font-size: 0.8125rem;
	font-weight: 600;
}

/* No score yet is the normal state for a day or two after a game, not a problem: quiet, not red.
   Unusual LeagueApps statuses (rained out, cancelled) keep the red above. */
.lawp-schedule__status.is-pending {
	border: 1px solid var(--lawp-line);
	background: var(--lawp-soft);
	color: var(--lawp-muted);
	font-weight: 500;
}

.lawp-schedule__none,
.lawp-schedule__source,
.lawp-standings__tiebreakers {
	color: var(--lawp-muted);
	font-size: 0.9375rem;
}

.lawp-standings__division {
	margin: 0 0 2rem;
}

.lawp-standings__table td {
	font-variant-numeric: tabular-nums;
}

.lawp-standings__table abbr {
	text-decoration: none;
	cursor: help;
}

/* Phones: each game becomes a small card, time and field first, the matchup under them. */
@media (max-width: 600px) {
	.lawp-schedule__games thead {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0 0 0 0);
	}

	.lawp-schedule__games,
	.lawp-schedule__games tbody,
	.lawp-schedule__games tr {
		display: block !important;
		width: 100%;
	}

	.lawp-schedule__games tr {
		display: grid !important;
		grid-template-columns: auto 1fr;
		gap: 2px 12px;
		padding: 10px 0;
		border-bottom: 1px solid var(--lawp-line);
	}

	.lawp-schedule__games td {
		padding: 0;
		border: 0;
	}

	.lawp-schedule__time {
		font-weight: 700;
	}

	.lawp-schedule__field {
		color: var(--lawp-muted);
		text-align: end;
	}

	.lawp-schedule__game {
		grid-column: 1 / -1;
	}

	.lawp-schedule__division {
		grid-column: 1 / -1;
		color: var(--lawp-muted);
		font-size: 0.8125rem;
	}

	/* Results: the scores stay on the right of their team lines. */
	.lawp-schedule__games--results tr {
		grid-template-columns: 1fr auto;
	}

	.lawp-schedule__games--results .lawp-schedule__game {
		grid-column: 1;
	}

	.lawp-schedule__games--results .lawp-schedule__scores {
		grid-column: 2;
		width: auto;
	}

	/* Standings keep their columns and scroll inside their own box if they must. */
	.lawp-standings__division {
		overflow-x: auto;
	}
}

@media print {
	.lawp-schedule__filters,
	.lawp-schedule__source {
		display: none;
	}

	.lawp-schedule__games th,
	.lawp-schedule__games td {
		padding: 3px 6px;
	}

	.lawp-schedule__day {
		break-inside: avoid;
	}
}

/*
 * The next game day (W-01, /watch/): a small label above the date, a plain line naming a Sunday
 * with no games, and finished games muted (class is-past, set in the visitor's browser from each
 * row's data-lawp-until, since the page can be cached for a day). Muted, not struck through: a line
 * through a game reads as cancelled. Never color alone: once every game shown is over, a line after
 * the day says so in words, whatever state the page was cached in.
 */
.lawp-next__label {
	margin: 0 0 0.25rem;
	color: var(--lawp-accent);
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

.lawp-next__skipped {
	margin: 0 0 1rem;
	padding: 8px 12px;
	border-inline-start: 4px solid var(--lawp-line);
	background: var(--lawp-soft);
	font-weight: 600;
}

/* Faded, not recolored: themes map --lawp-muted to a near-black palette color (Softball Austin's
   palette4 is #2B2825), which left finished rows looking unchanged. 0.62 keeps the text above 4.5:1. */
.lawp-next tr.is-past td {
	opacity: 0.62;
}

/* Coming up (W-07): the later game days, one compact row each. Themes restyle it to their own
   date lists; this is a neutral fallback. "No games" is said in words, never color alone. */
.lawp-next__soon {
	margin: 1.5rem 0 1rem;
}

.lawp-next__soon-list {
	margin: 0;
	padding: 0;
	list-style: none;
	border-top: 1px solid var(--lawp-line);
}

.lawp-next__soon-row {
	display: grid;
	grid-template-columns: 7.5rem minmax(0, 1fr);
	gap: 10px;
	align-items: baseline;
	margin: 0;
	padding: 8px 0;
	border-bottom: 1px solid var(--lawp-line);
}

.lawp-next__soon-row time {
	font-weight: 700;
	white-space: nowrap;
}

/* A notice for a date (R-03: the site's rainout notice), under that day's heading. Themes restyle it;
   this is a neutral fallback. A full cancellation also puts "Cancelled" on each game, in words. */
.lawp-day-notice {
	margin: 0 0 0.75rem;
	padding: 8px 12px;
	border-radius: 6px;
	background: #fcecea;
	color: var(--lawp-warn);
}

.lawp-day-notice--change {
	background: #fff4d6;
	color: #6b4e00;
}

.lawp-next__done {
	margin: 0.5rem 0 1rem;
	font-weight: 600;
}
