/* ===================================================================
   CSS Custom Properties (Variables)
   =================================================================== */
:root {
	--primary-color: #2868b8; /* Darkened for better contrast */
	--primary-color-dark: #2868b8;
	--text-color: #555;
	--text-color-light: #777;
	--dark-color: #333;
	--light-grey: #f9f9f9;
}

html {
	scroll-behavior: smooth;
}

/* Modern Accessibility: Clear focus outlines for keyboard navigation */
:focus-visible {
	outline: 2px dashed var(--primary-color);
	outline-offset: 4px;
}

/* Respect user OS preferences for reduced motion */
@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}
}

/* ===================================================================
   Global & Header Styles
   =================================================================== */
.main-header {
	padding: 20px 0;
	background: #fff;
	border-bottom: 1px solid #e9e9e9;
	box-shadow: 0 2px 4px rgba(0,0,0,0.04);
	position: relative;
}

.main-header .container {
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.main-header .logo a {
	font-size: 1.5em;
	font-weight: 700;
	color: var(--dark-color);
	text-decoration: none;
	letter-spacing: -1px;
}

.mobile-menu-toggle {
	display: none;
}

.main-header .main-nav ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.main-header .main-nav li {
	display: inline-block;
	margin-left: 30px;
}

.main-header .main-nav a {
	text-decoration: none;
	color: var(--text-color);
	font-weight: 600;
	font-size: 1em;
	transition: color 0.2s;
	padding-bottom: 5px;
	border-bottom: 2px solid transparent;
}

.main-header .main-nav a:hover,
.main-header .main-nav li.current a {
	color: var(--primary-color);
	border-bottom-color: var(--primary-color);
}

/* ===================================================================
   Hero Section (Homepage)
   =================================================================== */
.hero-section {
	position: relative;
	height: 70vh;
	min-height: 400px;
	display: flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	color: #fff;
}
.hero-image {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-size: cover;
	background-position: center;
}
.hero-overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(0, 0, 0, 0.5);
}
.hero-content {
	position: relative;
	z-index: 2;
}
.hero-content h1 {
	font-size: 3.5em;
	font-weight: 700;
	margin-bottom: 10px;
	letter-spacing: -1px;
}
.hero-content .subtitle {
	font-size: 1.4em;
	font-weight: 300;
	opacity: 0.9;
	margin-bottom: 30px;
}

/* ===================================================================
   Homepage Styles
   =================================================================== */

/* Featured Work Section */
.main-header {
	padding: 15px 0;
	background: #fff;
	border-bottom: 1px solid #e9e9e9;
}

.main-header .container {
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.main-header .logo img {
	max-height: 40px;
	vertical-align: middle;
}

.main-header .main-nav ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.main-header .main-nav li {
	display: inline-block;
	margin-left: 25px;
}

.main-header .main-nav a {
	text-decoration: none;
	color: var(--text-color);
	font-weight: 600;
	font-size: 1em;
	transition: color 0.2s;
}

.page-header {
	text-align: center;
	margin: 40px 0;
}
.page-header h2 {
	font-size: 2.5em;
	margin-bottom: 10px;
	font-weight: 300;
}
.page-header p {
	font-size: 1.1em;
	color: var(--text-color-light);
}

/* Featured Adventures Grid */
.featured-adventures-section {
	padding: 60px 0;
}
.adventure-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
	gap: 20px;
	margin-bottom: 40px;
}

.adventure-card {
	display: block;
	text-decoration: none;
	color: white;
	overflow: hidden;
	border-radius: 8px;
	box-shadow: 0 2px 5px rgba(0,0,0,0.1);
	position: relative;
}

.adventure-card figure {
	margin: 0;
	height: 350px;
	position: relative;
}

.adventure-card img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.4s ease-out;
}

.adventure-card figcaption {
	position: absolute;
	bottom: 0;
	left: 0;
	width: 100%;
	padding: 20px;
	background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
	transform: translateY(100%);
	opacity: 0;
	transition: transform 0.4s ease-out, opacity 0.4s ease-out;
}

.adventure-card figcaption h3 {
	margin: 0;
	font-size: 1.2em;
	font-weight: 600;
}

.adventure-card:hover img {
	transform: scale(1.05);
}

.adventure-card:hover figcaption {
	transform: translateY(0);
	opacity: 1;
}


/* CTA Button */
.cta-button-container {
	text-align: center;
	margin: 30px 0 50px;
}
.cta-button {
	display: inline-block;
	padding: 12px 30px;
	background-color: var(--primary-color);
	color: #fff;
	border-radius: 25px;
	text-decoration: none;
	font-weight: bold;
	transition: background-color 0.3s;
}
.cta-button:hover {
	background-color: var(--primary-color-dark);
}

.about-me-avatar {
	width: 150px;
	height: 150px;
	border-radius: 50%;
	object-fit: cover;
	margin-bottom: 20px;
	border: 5px solid #fff;
	box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* About Me Snippet */
.about-me-snippet {
	background-color: var(--light-grey);
	padding: 60px 0;
	text-align: center;
}
.about-me-content h2 {
	font-size: 2.5em;
	font-weight: 300;
	margin-bottom: 15px;
}
.about-me-content p {
	font-size: 1.2em;
	color: var(--text-color-light);
	max-width: 600px;
	margin: 0 auto 30px auto;
	line-height: 1.6;
}
.about-me-snippet .cta-button-container {
	margin: 0;
}

/* ===================================================================
   About Page Styles
   =================================================================== */
.about-section {
	padding: 60px 0;
	background: #fff;
}
.about-container {
	display: flex;
	align-items: center;
	gap: 50px;
	max-width: 960px;
	margin: 0 auto;
}
.about-image {
	flex: 0 0 300px;
}
.about-image img {
	width: 100%;
	border-radius: 50%;
	box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}
.about-content h1 {
	font-size: 3em;
	font-weight: 300;
	margin-bottom: 20px;
}
.about-content p {
	font-size: 1.1em;
	line-height: 1.7;
	color: #666;
	margin-bottom: 15px;
}

/* ===================================================================
   Professional Page Styles
   =================================================================== */
.professional-section {
	background-color: var(--light-grey);
	padding: 60px 0;
}
.professional-content {
	background: #fff;
	padding: 40px;
	border-radius: 5px;
	box-shadow: 0 5px 25px rgba(0,0,0,0.07);
}
.professional-block {
	margin-bottom: 40px;
}
.professional-block:last-child {
	margin-bottom: 0;
}
.professional-block h3 {
	font-size: 1.8em;
	font-weight: 600;
	color: var(--dark-color);
	margin-bottom: 20px;
	padding-bottom: 10px;
	border-bottom: 1px solid #eee;
}
.professional-block p {
	line-height: 1.7;
	color: #666;
}

/* Experience */
.experience-item {
	margin-bottom: 25px;
}
.experience-item:last-child {
	margin-bottom: 0;
}
.experience-item h4 {
	font-size: 1.2em;
	font-weight: 600;
	color: #444;
	margin-bottom: 5px;
}
.experience-meta {
	font-size: 0.9em;
	color: #888;
	margin-bottom: 10px !important;
}

/* ===================================================================
   Running Page Styles
   =================================================================== */
.running-section {
	padding: 60px 0;
	background-color: var(--light-grey);
}
.section-subtitle {
	font-size: 1.8em;
	font-weight: 600;
	color: var(--dark-color);
	margin-bottom: 20px;
	margin-top: 40px;
}
.stats-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	gap: 20px;
	margin-bottom: 50px;
}
.stat-card {
	background: #fff;
	padding: 30px 20px;
	border-radius: 8px;
	box-shadow: 0 4px 6px rgba(0,0,0,0.05);
	text-align: center;
	border-bottom: 4px solid var(--primary-color);
	transition: transform 0.2s ease;
}
.stat-card:hover {
	transform: translateY(-3px);
}
.stat-card .year {
	font-size: 1.2em;
	color: var(--text-color-light);
	margin-bottom: 10px;
	font-weight: 600;
}
.stat-card .miles {
	font-size: 2.5em;
	font-weight: 700;
	color: var(--dark-color);
	margin: 0;
}
.stat-card .unit {
	font-size: 0.4em;
	text-transform: uppercase;
	letter-spacing: 1px;
	color: var(--text-color-light);
}
.race-table-container {
	overflow-x: auto;
	background: #fff;
	box-shadow: 0 4px 6px rgba(0,0,0,0.05);
	border-radius: 8px;
	margin-bottom: 20px;
}
.race-table {
	width: 100%;
	border-collapse: collapse;
	min-width: 600px; /* Forces scroll on very small screens instead of crushing */
}
.race-table th, .race-table td {
	padding: 15px 20px;
	text-align: left;
	border-bottom: 1px solid #eee;
}
.race-table th {
	background-color: #fcfcfc;
	font-weight: 600;
	color: var(--dark-color);
	text-transform: uppercase;
	font-size: 0.85em;
	letter-spacing: 1px;
}
.race-table tr:last-child td {
	border-bottom: none;
}
.race-table tr:hover {
	background-color: #f9f9f9;
}
th.sortable {
	cursor: pointer;
	user-select: none;
	transition: background-color 0.2s;
}
th.sortable:hover {
	background-color: #f2f2f2;
}
th.sortable i {
	margin-left: 5px;
	color: #ccc;
	transition: transform 0.2s, color 0.2s;
}
th.sortable.asc i { color: var(--primary-color); }
th.sortable.desc i { color: var(--primary-color); transform: rotate(180deg); }

.status-badge {
	display: inline-block;
	padding: 4px 10px;
	border-radius: 4px;
	font-size: 0.85em;
	font-weight: 600;
	background: #e6f0fa;
	color: var(--primary-color);
}

/* Skills */
.skills-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 30px;
}
.skill-category h4 {
	font-size: 1.1em;
	font-weight: 600;
	color: #444;
	margin-bottom: 15px;
}
.skill-category ul {
	list-style: none;
	padding: 0;
	margin: 0;
}
.skill-category li {
	background: #f4f4f9;
	padding: 8px 12px;
	border-radius: 4px;
	margin-bottom: 8px;
	font-size: 0.95em;
}

/* Honeypot field for spam protection */
.honeypot-field {
    display: none;
    visibility: hidden;
}

/* Form Validation Feedback */
.form-control.is-invalid {
	border-color: #dc3545;
}
.invalid-feedback {
	display: block;
	width: 100%;
	margin-top: .25rem;
	font-size: .875em;
	color: #dc3545;
}

/* ===================================================================
   Footer Styles
   =================================================================== */
.main-footer {
	background-color: #222;
	color: #aaa;
	padding: 40px 0;
	text-align: center;
}
.footer-social-links {
	list-style: none;
	padding: 0;
	margin: 0 0 20px 0;
}
.footer-social-links li {
	display: inline-block;
	margin: 0 10px;
}
.footer-social-links a {
	display: inline-block;
	width: 40px;
	height: 40px;
	background-color: #444;
	border-radius: 50%;
	transition: background-color 0.3s;
}
.footer-social-links a:hover {
	background-color: var(--primary-color);
}
.footer-social-links a i {
	color: #fff;
	font-size: 16px;
	line-height: 40px;
}

.main-footer .copyright {
    margin-top: 10px;
}

/* ===================================================================
   Responsive Styles
   =================================================================== */
@media (min-width: 768px) and (max-width: 991px) {
	.adventure-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 767px) {
	.hero-content h1 {
		font-size: 2.5em;
	}
	.hero-content .subtitle {
		font-size: 1.2em;
	}
	.about-container {
		flex-direction: column;
		text-align: center;
	}
	.about-image {
		width: 200px;
	}

	.mobile-menu-toggle {
		display: block;
	}

	.main-nav {
		display: none;
		position: absolute;
		top: 100%;
		left: 0;
		width: 100%;
		background: #fff;
		border-bottom: 1px solid #e9e9e9;
		box-shadow: 0 4px 6px rgba(0,0,0,0.05);
		padding: 10px 0;
		z-index: 1000;
	}

	.main-nav.nav-open {
		display: block;
	}

	.main-header .main-nav ul {
		text-align: center;
	}
	.main-header .main-nav li {
		display: block;
		margin: 15px 0;
	}
}