/*
Theme Name: Elite Sport Group
Author: William Jeffree, Grow Creative
Description: Bespoke standalone theme for Elite Sport Group. Replaces the 2014 X child theme (ESG2014). No parent theme, no page builder, no build step.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: elitesportgroup
*/

/* -------------------------------------------------------------------------
   Contents
   1. Tokens          5. Breadcrumbs       9. Footer
   2. Base            6. Layout and cards  10. Forms
   3. Header          7. Content           11. Small screens
   4. Navigation      8. Sidebar
   ---------------------------------------------------------------------- */

/* 1. Tokens ------------------------------------------------------------ */

:root {
	--esg-navy: #2a2a7a;
	--esg-navy-deep: #0d0d40;
	--esg-ink: #2b2c42;
	--esg-heading: #272727;
	--esg-link: #55457c;
	--esg-link-hover: #2d6596;
	--esg-muted: #7a7a7a;
	--esg-line: #dddddd;
	--esg-page: #f3f3f3;
	--esg-card: #ffffff;
	--esg-radius: 4px;
	--esg-shadow: 0 2px 5px rgba(0, 0, 0, 0.13);
	--esg-pad: 45px;
	--esg-font: Lato, "Helvetica Neue", Helvetica, Arial, sans-serif;
}

/* 2. Base -------------------------------------------------------------- */

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

html {
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 0;
	background: var(--esg-page) url(assets/img/muscle-fibre-background.jpg) center / cover fixed no-repeat;
	color: var(--esg-ink);
	font-family: var(--esg-font);
	font-size: 16px;
	line-height: 1.7;
}

img,
iframe,
video {
	max-width: 100%;
}

img {
	height: auto;
}

a {
	color: var(--esg-link);
	text-decoration: none;
}

a:hover,
a:focus {
	color: var(--esg-link-hover);
}

a:focus-visible,
button:focus-visible {
	outline: 2px solid var(--esg-link-hover);
	outline-offset: 2px;
}

h1,
h2,
h3,
h4,
h5,
h6 {
	margin: 1.6em 0 0.5em;
	color: var(--esg-heading);
	font-weight: 400;
	line-height: 1.2;
	letter-spacing: -0.02em;
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }
h5,
h6 { font-size: 1rem; }

p {
	margin: 0 0 1.2em;
}

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

.esg-skip {
	position: absolute;
	left: -9999px;
}

.esg-skip:focus {
	left: 10px;
	top: 10px;
	z-index: 100;
	padding: 8px 14px;
	background: #fff;
}

.esg-container {
	width: 88%;
	max-width: 1200px;
	margin: 0 auto;
}

/* 3. Header ------------------------------------------------------------ */

.esg-logobar {
	padding: 17px 0 15px;
	text-align: center;
}

.esg-logo {
	display: inline-block;
}

.esg-logo img {
	display: block;
	width: 225px;
}

/* 4. Navigation -------------------------------------------------------- */

.esg-nav {
	position: relative;
	z-index: 20;
	background: linear-gradient(to bottom, #4545b5 0%, #2f2f96 45%, #17175e 80%, var(--esg-navy-deep) 100%);
	box-shadow: var(--esg-shadow);
}

.esg-nav .esg-container {
	position: relative;
}

.esg-menu-inner {
	display: flex;
	justify-content: center;
	align-items: stretch;
}

.esg-menu,
.esg-menu ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.esg-menu {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
}

.esg-menu > li > a,
.esg-search-toggle {
	display: flex;
	align-items: center;
	height: 60px;
	padding: 0 17px;
	color: #d9d9ee;
	font-size: 12px;
	letter-spacing: 2px;
	text-transform: uppercase;
	white-space: nowrap;
}

.esg-menu > li > a:hover,
.esg-menu > li:focus-within > a,
.esg-menu > li:hover > a,
.esg-menu > .current-menu-item > a,
.esg-menu > .current-menu-ancestor > a,
.esg-menu > .current-page-ancestor > a,
.esg-search-toggle:hover {
	color: #ffffff;
}

.esg-menu > .current-menu-item > a,
.esg-menu > .current-menu-ancestor > a,
.esg-menu > .current-page-ancestor > a {
	box-shadow: inset 0 -3px 0 rgba(255, 255, 255, 0.55);
}

.esg-menu > .menu-item-has-children > a::after {
	content: "";
	width: 5px;
	height: 5px;
	margin: -3px 0 0 8px;
	border-right: 1.5px solid currentColor;
	border-bottom: 1.5px solid currentColor;
	transform: rotate(45deg);
}

.esg-search-toggle {
	border: 0;
	background: none;
	cursor: pointer;
	font-family: inherit;
}

/* Dropdown panels: full width of the container, links in columns. */
.esg-menu .sub-menu {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	display: none;
	padding: 22px 28px;
	background: rgba(255, 255, 255, 0.96);
	border-radius: 0 0 var(--esg-radius) var(--esg-radius);
	box-shadow: 0 6px 14px rgba(0, 0, 0, 0.18);
	columns: 3;
	column-gap: 28px;
}

.esg-menu .col-4 > .sub-menu {
	columns: 4;
}

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

.esg-menu .sub-menu li {
	break-inside: avoid;
}

.esg-menu .sub-menu a {
	display: block;
	padding: 6px 0;
	color: #000033;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.35;
}

.esg-menu .sub-menu a:hover,
.esg-menu .sub-menu .current-menu-item > a {
	color: var(--esg-link-hover);
}

.esg-nav-toggle {
	display: none;
}

.esg-search {
	padding: 14px 0;
	background: var(--esg-navy-deep);
}

.esg-search .search-form {
	display: flex;
	gap: 8px;
	max-width: 520px;
	margin: 0 auto;
}

.esg-search .search-form label {
	flex: 1;
}

/* 5. Breadcrumbs ------------------------------------------------------- */

.esg-breadcrumbs {
	padding: 10px 0;
	background: rgba(0, 0, 0, 0.024);
	border-bottom: 2px solid var(--esg-navy);
	font-size: 11px;
	letter-spacing: 1px;
	line-height: 1.4;
	text-transform: uppercase;
}

.esg-breadcrumbs ol {
	display: flex;
	flex-wrap: wrap;
	margin: 0;
	padding: 0;
	list-style: none;
}

.esg-breadcrumbs li + li::before {
	content: ">";
	margin: 0 8px;
	color: #b7b7b7;
}

.esg-breadcrumbs a {
	color: #8c8c8c;
}

.esg-breadcrumbs a:hover {
	color: var(--esg-navy);
}

/* 6. Layout and cards -------------------------------------------------- */

.esg-layout {
	display: flex;
	align-items: flex-start;
	gap: 2%;
	padding: 40px 0 64px;
}

.esg-main {
	flex: 1 1 0;
	min-width: 0;
}

.esg-sidebar {
	flex: 0 0 28.5%;
}

.esg-entry {
	background: var(--esg-card);
	border-radius: var(--esg-radius);
	box-shadow: var(--esg-shadow);
	overflow: hidden;
}

.esg-entry-banner {
	border-bottom: 1px solid var(--esg-line);
}

.esg-entry-banner img {
	display: block;
	width: 100%;
}

.esg-entry-body {
	padding: var(--esg-pad);
}

.esg-entry-title {
	margin: 0 0 0.6em;
}

/* 7. Content ----------------------------------------------------------- */

.esg-content > :first-child {
	margin-top: 0;
}

.esg-content > :last-child {
	margin-bottom: 0;
}

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

.esg-content ul,
.esg-content ol {
	margin: 0 0 1.2em;
	padding-left: 1.4em;
}

.esg-content blockquote {
	margin: 1.6em 0;
	padding: 1.1em 0;
	border-top: 1px solid var(--esg-line);
	border-bottom: 1px solid var(--esg-line);
	color: var(--esg-heading);
	font-size: 1.3rem;
	line-height: 1.5;
}

.esg-content blockquote p:last-child {
	margin-bottom: 0;
}

.esg-content hr {
	margin: 2em 0;
	border: 0;
	border-top: 1px solid var(--esg-line);
}

.esg-content table {
	width: 100%;
	margin: 0 0 1.4em;
	border-collapse: collapse;
}

.esg-content th,
.esg-content td {
	padding: 8px 10px;
	border-bottom: 1px solid var(--esg-line);
	text-align: left;
	vertical-align: top;
}

/* Videos: YouTube and Vimeo embeds fill the column at 16:9. */
.esg-content iframe[src*="youtube"],
.esg-content iframe[src*="youtu.be"],
.esg-content iframe[src*="vimeo"] {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 16 / 9;
	margin: 0 0 1.4em;
	border: 0;
}

/* WordPress image alignment and captions. */
.alignleft {
	float: left;
	margin: 0.3em 1.6em 1em 0;
}

.alignright {
	float: right;
	margin: 0.3em 0 1em 1.6em;
}

.aligncenter {
	display: block;
	margin: 0 auto 1.2em;
}

.wp-caption {
	max-width: 100%;
}

.wp-caption img {
	display: block;
}

.wp-caption-text {
	margin: 0.5em 0 0;
	color: var(--esg-muted);
	font-size: 0.85rem;
	line-height: 1.4;
}

/* Race results list on rider pages: the [child_pages] shortcode. */
.esg-child-pages,
.esg-content .esg-child-pages,
.esg-list {
	margin: 0 0 1.6em;
	padding: 0;
	list-style: none;
}

.esg-child-pages li,
.esg-list li {
	margin: 0 0 6px;
}

.esg-child-pages li > a,
.esg-child-pages li > span,
.esg-list li > a {
	display: block;
	padding: 10px 14px;
	border: 1px solid var(--esg-line);
	border-radius: var(--esg-radius);
	line-height: 1.4;
}

.esg-child-pages li > span {
	color: var(--esg-ink);
	background: #fafafa;
}

.esg-child-pages .has-content > a {
	position: relative;
	padding-right: 44px;
	font-weight: 700;
}

.esg-child-pages .has-content > a::after {
	content: "";
	position: absolute;
	right: 16px;
	top: 50%;
	margin-top: -6px;
	border: 6px solid transparent;
	border-left: 10px solid currentColor;
	border-right: 0;
}

.esg-child-pages .has-content > a:hover,
.esg-list li > a:hover {
	border-color: var(--esg-link-hover);
}

/* Rider pages wrap "2013 Results >" links in an h2. Keep them button-like. */
.esg-content h2 > a {
	display: inline-block;
	padding: 8px 14px;
	border: 1px solid var(--esg-line);
	border-radius: var(--esg-radius);
	font-size: 1.1rem;
	letter-spacing: 0;
}

.esg-content h2 > a:hover {
	border-color: var(--esg-link-hover);
}

/* Stand-ins for page builder rows and columns (Home and Contact). */
.esg-row {
	display: flex;
	flex-wrap: wrap;
	gap: 40px;
}

.esg-col {
	flex: 1 1 100%;
	min-width: 0;
}

.esg-col-1-2 { flex-basis: calc(50% - 20px); }
.esg-col-1-3 { flex-basis: calc(33.333% - 27px); }
.esg-col-2-3 { flex-basis: calc(66.666% - 14px); }
.esg-col-1-4 { flex-basis: calc(25% - 30px); }
.esg-col-3-4 { flex-basis: calc(75% - 10px); }

.esg-text > :last-child {
	margin-bottom: 0;
}

.esg-text + .esg-text {
	margin-top: 1.2em;
}

/* 8. Sidebar ----------------------------------------------------------- */

.esg-sidebar .widget {
	padding: var(--esg-pad);
	background: var(--esg-card);
	border-radius: var(--esg-radius);
	box-shadow: var(--esg-shadow);
}

.esg-sidebar .widget + .widget {
	margin-top: 24px;
}

.esg-sidebar .widget-title {
	margin: 0 0 0.6em;
	font-size: 1.35rem;
}

.esg-sidebar .widget ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

/* 9. Footer ------------------------------------------------------------ */

.esg-footer-top {
	padding: 56px 0;
	border-top: 2px solid var(--esg-navy);
}

.esg-features {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 4%;
	margin: 0;
	padding: 0;
	list-style: none;
}

.esg-features a {
	display: block;
	color: var(--esg-ink);
}

.esg-features img {
	display: block;
	width: 100%;
	border-radius: 2px;
	box-shadow: var(--esg-shadow);
	transition: opacity 0.2s;
}

.esg-features a:hover img {
	opacity: 0.85;
}

.esg-features span {
	display: block;
	margin-top: 10px;
	color: var(--esg-heading);
	font-size: 1.35rem;
	letter-spacing: -0.02em;
	line-height: 1.2;
}

.esg-features a:hover span {
	color: var(--esg-link-hover);
}

.esg-footer-bottom {
	padding: 22px 0 34px;
	border-top: 2px solid var(--esg-navy);
	text-align: center;
}

.esg-social {
	display: inline-block;
	color: #223165;
	line-height: 0;
}

.esg-social:hover {
	color: var(--esg-link-hover);
}

.esg-footer-menu {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 6px 22px;
	margin: 16px 0 0;
	padding: 0;
	list-style: none;
	font-size: 12px;
	letter-spacing: 1px;
	text-transform: uppercase;
}

.esg-credit {
	margin: 18px 0 0;
	font-size: 10px;
	letter-spacing: 2px;
}

.esg-credit a {
	color: var(--esg-link);
}

/* 10. Forms (search and Ninja Forms inherit these) --------------------- */

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="number"],
input[type="search"],
input[type="password"],
select,
textarea {
	width: 100%;
	padding: 0.7em 0.65em;
	border: 1px solid #cfcfd8;
	border-radius: var(--esg-radius);
	background: #fff;
	color: var(--esg-ink);
	font: inherit;
}

input:focus,
select:focus,
textarea:focus {
	outline: 2px solid var(--esg-link-hover);
	outline-offset: 0;
	border-color: transparent;
}

button,
input[type="submit"],
input[type="button"] {
	font: inherit;
}

input[type="submit"],
input[type="button"],
.search-submit {
	padding: 0.7em 1.4em;
	border: 0;
	border-radius: var(--esg-radius);
	background: var(--esg-navy);
	color: #fff;
	letter-spacing: 1px;
	cursor: pointer;
}

input[type="submit"]:hover,
input[type="button"]:hover,
.search-submit:hover {
	background: var(--esg-link-hover);
}

.nav-links {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 1.6em;
}

.nav-links .page-numbers {
	padding: 4px 12px;
	border: 1px solid var(--esg-line);
	border-radius: var(--esg-radius);
}

/* 11. Small screens ---------------------------------------------------- */

@media (max-width: 979px) {
	.esg-layout {
		display: block;
		padding: 28px 0 44px;
	}

	.esg-sidebar {
		margin-top: 28px;
	}

	.esg-nav-toggle {
		display: flex;
		align-items: center;
		gap: 10px;
		margin: 0 auto;
		height: 54px;
		padding: 0 14px;
		border: 0;
		background: none;
		color: #fff;
		font: inherit;
		font-size: 12px;
		letter-spacing: 2px;
		text-transform: uppercase;
		cursor: pointer;
	}

	.esg-nav-toggle-bars,
	.esg-nav-toggle-bars::before,
	.esg-nav-toggle-bars::after {
		display: block;
		width: 20px;
		height: 2px;
		background: currentColor;
	}

	.esg-nav-toggle-bars {
		position: relative;
	}

	.esg-nav-toggle-bars::before,
	.esg-nav-toggle-bars::after {
		content: "";
		position: absolute;
		left: 0;
	}

	.esg-nav-toggle-bars::before { top: -6px; }
	.esg-nav-toggle-bars::after { top: 6px; }

	/* The menu slides open and shut: the grid row animates from 0 to full height. */
	.esg-menu-wrap {
		display: grid;
		grid-template-rows: 0fr;
		visibility: hidden;
		transition: grid-template-rows 0.35s ease, visibility 0s linear 0.35s;
	}

	.esg-menu-wrap.is-open {
		grid-template-rows: 1fr;
		visibility: visible;
		transition: grid-template-rows 0.35s ease, visibility 0s;
	}

	.esg-menu-inner {
		display: block;
		min-height: 0;
		overflow: hidden;
		opacity: 0;
		transform: translateY(-8px);
		transition: opacity 0.25s ease, transform 0.35s ease;
	}

	.esg-menu-wrap.is-open .esg-menu-inner {
		padding-bottom: 14px;
		opacity: 1;
		transform: none;
		transition-delay: 0.08s;
	}

	/* The three bars turn into a cross while the menu is open. */
	.esg-nav-toggle-bars,
	.esg-nav-toggle-bars::before,
	.esg-nav-toggle-bars::after {
		transition: transform 0.3s ease, top 0.3s ease, background-color 0.2s ease;
	}

	.esg-nav-toggle[aria-expanded="true"] .esg-nav-toggle-bars {
		background-color: transparent;
	}

	.esg-nav-toggle[aria-expanded="true"] .esg-nav-toggle-bars::before {
		top: 0;
		transform: rotate(45deg);
	}

	.esg-nav-toggle[aria-expanded="true"] .esg-nav-toggle-bars::after {
		top: 0;
		transform: rotate(-45deg);
	}

	.esg-menu {
		display: block;
	}

	.esg-menu > li > a,
	.esg-search-toggle {
		height: auto;
		padding: 12px 4px;
		border-top: 1px solid rgba(255, 255, 255, 0.14);
		white-space: normal;
	}

	.esg-search-toggle {
		width: 100%;
	}

	.esg-menu > .current-menu-item > a,
	.esg-menu > .current-menu-ancestor > a,
	.esg-menu > .current-page-ancestor > a {
		box-shadow: none;
	}

	.esg-menu > .menu-item-has-children > a::after {
		display: none;
	}

	.esg-menu .sub-menu,
	.esg-menu .col-4 > .sub-menu {
		position: static;
		display: block;
		padding: 0 0 10px 14px;
		background: none;
		box-shadow: none;
		columns: 1;
	}

	.esg-menu .sub-menu a {
		padding: 7px 0;
		color: #d9d9ee;
		font-weight: 400;
	}

	.esg-menu .sub-menu a:hover {
		color: #fff;
	}

	.esg-features {
		grid-template-columns: repeat(2, 1fr);
		gap: 28px 4%;
	}
}

@media (max-width: 600px) {
	:root {
		--esg-pad: 24px;
	}

	body {
		background-attachment: scroll;
	}

	h1 { font-size: 1.8rem; }

	.esg-container {
		width: 92%;
	}

	.esg-logo img {
		width: 170px;
	}

	.esg-row,
	.vc_row {
		gap: 24px;
	}

	.esg-col {
		flex-basis: 100%;
	}

	.alignleft,
	.alignright {
		float: none;
		margin: 0 0 1em;
	}
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		transition: none !important;
	}
}
