/*
Theme Name: Epsom League
Theme URI: https://epsomsnookerleague.co.uk/
Author: Epsom & District Billiards and Snooker League
Description: A lightweight, accessible theme for league tables, fixtures, competitions and sponsorship.
Version: 0.3.0
Requires at least: 6.6
Requires PHP: 7.4
Text Domain: epsom-league
*/

:root {
	--esl-green-950: #102d1b;
	--esl-green-900: #173f25;
	--esl-green-800: #225b34;
	--esl-green-700: #2f7041;
	--esl-green-100: #e8f1e9;
	--esl-gold: #cfaa4a;
	--esl-ink: #172019;
	--esl-muted: #5b685e;
	--esl-line: #dbe4dc;
	--esl-paper: #fff;
	--esl-page: #f3f6f2;
	--esl-radius: 16px;
	--esl-shadow: 0 18px 55px rgba(10, 30, 15, 0.18);
	--esl-width: 1180px;
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	scroll-behavior: smooth;
}

body {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
	margin: 0;
	background-color: #6f9858;
	background-image: linear-gradient(rgba(26, 61, 34, 0.14), rgba(26, 61, 34, 0.28)), url('/wp-content/uploads/2013/08/snooker_background-new1.jpg');
	background-position: center top;
	background-repeat: no-repeat;
	background-attachment: fixed;
	background-size: cover;
	color: var(--esl-ink);
	font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	font-size: 16px;
	line-height: 1.6;
}

body.admin-bar .site-header {
	top: 32px;
}

body.admin-bar {
	min-height: calc(100vh - 32px);
}

a {
	color: var(--esl-green-700);
}

a:hover,
a:focus {
	color: var(--esl-green-950);
}

img {
	max-width: 100%;
	height: auto;
}

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.screen-reader-text:focus {
	top: 8px;
	left: 8px;
	z-index: 100000;
	width: auto;
	height: auto;
	padding: 12px 16px;
	clip: auto;
	background: #fff;
	color: #000;
}

.site-header {
	position: sticky;
	top: 0;
	z-index: 1000;
	background: rgba(16, 45, 27, 0.96);
	border-bottom: 1px solid rgba(255, 255, 255, 0.16);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
	backdrop-filter: blur(12px);
}

.site-header-inner {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	align-items: center;
	gap: 28px;
	width: min(calc(100% - 36px), var(--esl-width));
	min-height: 92px;
	margin: 0 auto;
}

.site-branding a {
	display: flex;
	align-items: center;
	gap: 14px;
	color: #fff;
	text-decoration: none;
}

.site-logo {
	width: 112px;
	height: auto;
}

.site-title-wrap {
	display: none;
}

.menu-toggle {
	display: none;
	min-width: 44px;
	min-height: 44px;
	border: 1px solid rgba(255, 255, 255, 0.35);
	border-radius: 10px;
	background: transparent;
	color: #fff;
	font: inherit;
	font-weight: 700;
}

.primary-nav ul {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 4px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.primary-nav li {
	position: relative;
}

.primary-nav a,
.primary-nav .submenu-label {
	display: flex;
	align-items: center;
	min-height: 44px;
	padding: 9px 12px;
	border-radius: 9px;
	color: rgba(255, 255, 255, 0.92);
	font-size: 14px;
	font-weight: 700;
	text-decoration: none;
}

.primary-nav a:hover,
.primary-nav a:focus,
.primary-nav .submenu-label:hover,
.primary-nav .submenu-label:focus,
.primary-nav .current-menu-item > a,
.primary-nav .current_page_item > a {
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
}

.primary-nav .sub-menu {
	position: absolute;
	top: 100%;
	left: 0;
	display: none;
	min-width: 230px;
	padding: 8px;
	border-radius: 12px;
	background: var(--esl-green-950);
	box-shadow: 0 16px 32px rgba(0, 0, 0, 0.24);
}

.primary-nav li:hover > .sub-menu,
.primary-nav li:focus-within > .sub-menu {
	display: block;
}

.primary-nav .sub-menu a {
	width: 100%;
}

.site-main {
	flex: 1 0 auto;
	width: min(calc(100% - 36px), var(--esl-width));
	margin: 28px auto 46px;
}

.content-card {
	padding: clamp(22px, 4vw, 46px);
	border: 1px solid rgba(255, 255, 255, 0.62);
	border-radius: var(--esl-radius);
	background: rgba(255, 255, 255, 0.97);
	box-shadow: var(--esl-shadow);
}

.entry-header {
	margin-bottom: 26px;
	padding-bottom: 20px;
	border-bottom: 1px solid var(--esl-line);
}

.entry-title {
	margin: 0;
	color: var(--esl-green-950);
	font-size: clamp(30px, 5vw, 48px);
	line-height: 1.08;
}

.breadcrumbs {
	display: flex;
	flex-wrap: wrap;
	gap: 7px;
	margin: 0 0 12px;
	font-size: 14px;
	color: var(--esl-muted);
}

.breadcrumbs a {
	font-weight: 700;
	text-decoration: none;
}

.division-nav {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: -8px 0 26px;
	padding: 10px;
	border: 1px solid var(--esl-line);
	border-radius: 12px;
	background: var(--esl-green-100);
}

.division-nav a {
	display: inline-flex;
	align-items: center;
	min-height: 40px;
	padding: 8px 14px;
	border-radius: 9px;
	font-weight: 700;
	text-decoration: none;
}

.division-nav a[aria-current="page"] {
	background: var(--esl-green-800);
	color: #fff;
}

.division-season-hub {
	margin: -8px 0 28px;
	padding: clamp(20px, 3vw, 28px);
	border: 1px solid var(--esl-line);
	border-radius: 14px;
	background: #f8faf7;
}

.division-season-heading {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 18px;
}

.division-season-eyebrow {
	margin: 0 0 2px;
	color: var(--esl-green-700);
	font-size: 12px;
	font-weight: 800;
	letter-spacing: 0.09em;
	text-transform: uppercase;
}

.division-season-heading h2 {
	margin: 0;
	color: var(--esl-green-950);
	font-size: clamp(27px, 4vw, 36px);
}

.division-season-team-count {
	padding: 6px 12px;
	border-radius: 999px;
	background: var(--esl-green-100);
	color: var(--esl-green-900);
	font-size: 14px;
	font-weight: 800;
}

.division-season-hub > p {
	max-width: 760px;
	margin: 12px 0 0;
}

.division-season-hub .division-season-status {
	margin-top: 6px;
	color: var(--esl-muted);
	font-size: 14px;
}

.division-season-hub .division-nav {
	margin: 20px 0 0;
}

.division-season-preview {
	margin-top: 24px;
	padding-top: 22px;
	border-top: 1px solid var(--esl-line);
}

.division-preview-heading {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
}

.division-preview-heading h3 {
	margin: 0;
	color: var(--esl-green-950);
	font-size: 22px;
}

.division-preview-heading > span {
	padding: 5px 10px;
	border: 1px solid #dbc889;
	border-radius: 999px;
	background: #fff9e8;
	color: #765c16;
	font-size: 12px;
	font-weight: 800;
	white-space: nowrap;
}

.division-preview-note {
	margin: 8px 0 16px;
	color: var(--esl-muted);
	font-size: 14px;
}

.division-preview-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 14px;
}

.division-preview-card {
	min-width: 0;
	padding: 16px;
	border: 1px solid var(--esl-line);
	border-radius: 12px;
	background: #fff;
}

.division-preview-card h4 {
	margin: 0 0 10px;
	color: var(--esl-green-900);
	font-size: 16px;
}

.division-preview-table-wrap {
	overflow-x: auto;
}

.division-preview-card table {
	width: 100%;
	border-collapse: collapse;
	font-size: 13px;
}

.division-preview-card th,
.division-preview-card td {
	padding: 7px 6px;
	border-bottom: 1px solid #e8ede8;
	text-align: center;
}

.division-preview-card th:nth-child(2),
.division-preview-card tbody th {
	text-align: left;
}

.division-preview-results {
	margin: 0;
	padding: 0;
	list-style: none;
}

.division-preview-results li {
	display: grid;
	grid-template-columns: 48px minmax(0, 1fr);
	gap: 8px;
	padding: 7px 0;
	border-bottom: 1px solid #e8ede8;
	font-size: 13px;
}

.division-preview-results li > span {
	color: var(--esl-muted);
}

.division-preview-results strong {
	font-weight: 600;
}

.division-preview-results b {
	color: var(--esl-green-900);
}

.esl-match-detail {
	max-width: 680px;
	margin: 8px auto 0;
	padding: clamp(20px, 4vw, 32px);
	border: 1px solid var(--esl-line);
	border-radius: 14px;
	background: #f8faf7;
}

.esl-match-detail h3 {
	margin: 0 0 22px;
	font-size: clamp(22px, 4vw, 30px);
	text-align: center;
}

.esl-match-date,
.esl-match-score {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	gap: 8px 12px;
	margin: 0;
}

.esl-match-date > span:first-child,
.esl-match-score > span:first-child {
	font-size: 12px;
	font-weight: 800;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--esl-muted);
}

.esl-match-extra::before {
	margin-right: 12px;
	color: var(--esl-muted);
	content: "\00b7";
}

.esl-match-score {
	margin-top: 22px;
	padding-top: 20px;
	border-top: 1px solid var(--esl-line);
}

.esl-match-score strong {
	font-size: 30px;
	color: var(--esl-green-900);
}

.esl-match-stat-row {
	display: flex;
	flex-wrap: wrap;
	gap: 10px 20px;
}

.entry-content::after {
	display: table;
	clear: both;
	content: "";
}

.entry-content h2,
.entry-content h3 {
	color: var(--esl-green-900);
	line-height: 1.2;
}

.table-scroll {
	width: 100%;
	margin: 18px 0 28px;
	overflow-x: auto;
	border: 1px solid var(--esl-line);
	border-radius: 12px;
	background: #fff;
	-webkit-overflow-scrolling: touch;
}

table.leaguemanager {
	width: 100% !important;
	min-width: 680px;
	margin: 0 !important;
	border-collapse: collapse;
	font-size: 15px;
}

table.leaguemanager th,
table.leaguemanager td {
	padding: 11px 13px !important;
	border: 0 !important;
	border-bottom: 1px solid #e5ebe5 !important;
	background: transparent !important;
	text-align: left;
	white-space: nowrap;
}

table.leaguemanager th {
	position: sticky;
	top: 0;
	z-index: 2;
	background: var(--esl-green-900) !important;
	color: #fff;
	font-size: 13px;
	letter-spacing: 0.03em;
	text-transform: uppercase;
}

table.leaguemanager tr:nth-child(even) td {
	background: #f6f8f5 !important;
}

table.leaguemanager tr:hover td {
	background: #edf5ed !important;
}

table.leaguemanager td.num,
table.leaguemanager th.num {
	text-align: center;
	font-variant-numeric: tabular-nums;
}

.esl-sponsor-profile-grid {
	display: grid;
	grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
	gap: 42px;
	align-items: start;
}

.esl-sponsor-profile-logo {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 230px;
	padding: 28px;
	border: 1px solid var(--esl-line);
	border-radius: var(--esl-radius);
	background: #f6f8f5;
}

.esl-sponsor-profile-logo img {
	display: block;
	max-width: 100%;
	max-height: 210px;
	object-fit: contain;
}

.esl-sponsor-profile-content .entry-title {
	margin-bottom: 14px;
}

.esl-sponsor-profile-lead {
	margin: 0 0 24px;
	font-size: 19px;
	line-height: 1.55;
	color: var(--esl-muted);
}

.esl-sponsor-contact {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 18px 28px;
	margin-top: 30px;
	padding-top: 24px;
	border-top: 1px solid var(--esl-line);
}

.esl-sponsor-contact div {
	display: grid;
	gap: 2px;
}

.esl-sponsor-contact div span {
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--esl-muted);
}

.esl-sponsor-contact div a,
.esl-sponsor-back a {
	font-weight: 700;
}

.esl-sponsor-back {
	margin: 34px 0 0;
	padding-top: 20px;
	border-top: 1px solid var(--esl-line);
}

.entry-content #n2-ss-11 {
	max-width: 520px !important;
	margin: 18px auto 28px !important;
	border: 1px solid var(--esl-line);
	border-radius: 12px;
	overflow: hidden;
}

.home .site-main {
	margin-top: 22px;
}

.home-featured {
	border-radius: var(--esl-radius);
	overflow: hidden;
	box-shadow: var(--esl-shadow);
}

.home .esl-home-panel {
	border-radius: var(--esl-radius);
}

.site-footer {
	flex: 0 0 auto;
	background: var(--esl-green-950);
	color: rgba(255, 255, 255, 0.78);
}

.site-footer-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	width: min(calc(100% - 36px), var(--esl-width));
	min-height: 110px;
	margin: 0 auto;
}

.site-footer a {
	color: #fff;
	text-decoration: none;
}

.site-footer-links {
	display: flex;
	align-items: center;
	gap: 8px;
}

.site-footer-links a {
	padding: 6px 9px;
	border-radius: 7px;
	font-weight: 750;
	letter-spacing: 0.01em;
}

.site-footer-links > span {
	display: block;
	width: 1px;
	height: 20px;
	background: var(--esl-gold);
	opacity: 0.7;
}

.site-footer-links a:hover,
.site-footer-links a:focus {
	color: #fff;
	text-decoration: none;
	background: rgba(255, 255, 255, 0.11);
}

@media print {
	.site-header,
	.site-footer,
	.breadcrumbs,
	.division-nav,
	.entry-content #n2-ss-11 {
		display: none !important;
	}

	body {
		background: #fff;
		font-size: 11pt;
	}

	.site-main,
	.content-card {
		width: 100%;
		margin: 0;
		padding: 0;
		border: 0;
		box-shadow: none;
	}

	.table-scroll {
		overflow: visible;
		border: 0;
	}

	table.leaguemanager {
		min-width: 0;
		font-size: 9pt;
	}
}

@media (max-width: 980px) {
	body.admin-bar {
		min-height: calc(100vh - 46px);
	}

	body.admin-bar .site-header {
		top: 46px;
	}

	.site-header-inner {
		grid-template-columns: 1fr auto;
		min-height: 80px;
	}

	.site-logo {
		width: 94px;
	}

	.menu-toggle {
		display: inline-flex;
		align-items: center;
		justify-content: center;
	}

	.primary-nav {
		grid-column: 1 / -1;
		display: none;
		padding-bottom: 14px;
	}

	.primary-nav.is-open {
		display: block;
	}

	.primary-nav ul {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		align-items: start;
	}

	.primary-nav .sub-menu {
		position: static;
		display: block;
		min-width: 0;
		padding: 0 0 0 12px;
		background: transparent;
		box-shadow: none;
	}

	.esl-sponsor-profile-grid {
		grid-template-columns: 210px minmax(0, 1fr);
		gap: 28px;
	}

}

@media (max-width: 600px) {
	.division-season-heading {
		align-items: flex-start;
	}

	.division-season-hub {
		padding: 18px;
	}

	.division-preview-heading {
		align-items: flex-start;
	}

	.division-preview-grid {
		grid-template-columns: 1fr;
	}


	.esl-sponsor-profile-grid {
		grid-template-columns: 1fr;
		gap: 24px;
	}

	.esl-sponsor-profile-logo {
		min-height: 180px;
	}

	.site-header-inner,
	.site-main,
	.site-footer-inner {
		width: min(calc(100% - 24px), var(--esl-width));
	}

	.site-main {
		margin-top: 14px;
	}

	.content-card {
		padding: 20px 16px;
		border-radius: 12px;
	}

	.entry-title {
		font-size: 32px;
	}

	.primary-nav ul {
		grid-template-columns: 1fr;
	}

	.division-nav {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.division-nav a {
		justify-content: center;
		padding-inline: 8px;
		font-size: 13px;
		text-align: center;
	}

	.division-nav a:last-child:nth-child(odd) {
		grid-column: 1 / -1;
	}

	table.leaguemanager {
		min-width: 610px;
		font-size: 14px;
	}

	table.leaguemanager:has(tr > :only-child) {
		min-width: 100%;
	}

	.table-scroll:has(table.leaguemanager tr > :only-child) {
		overflow-x: hidden;
	}

	table.leaguemanager th,
	table.leaguemanager td {
		padding: 9px 10px !important;
	}

	.site-footer-inner {
		align-items: flex-start;
		flex-direction: column;
		justify-content: center;
		padding-block: 26px;
	}
}
