/**
 * Main CSS - Base Styles
 *
 * Resets, typography, colors, global utilities, homepage components
 *
 * @package AWE_EV_Classic
 */

/* ==========================================================================
   CSS Variables (Updated to match mockup design system)
   ========================================================================== */

:root {
	/* Colors - NEW THEME PALETTE */
	--color-primary: #c38e81;
	--color-accent: #c6bfa9;
	--color-bg: #e5dacf;
	--color-bg-alt: #f0ebe5;
	--color-dark: #543e34;
	--color-muted: #95989a;
	--color-border: #d4cfc5;

	/* Border radius */
	--radius-lg: 1rem;
	--radius-md: 0.75rem;
	--radius-pill: 999px;

	/* Shadows */
	--shadow-soft: 0 8px 20px rgba(84, 62, 52, 0.08);
	--shadow-soft-hover: 0 12px 30px rgba(84, 62, 52, 0.14);

	/* Transitions */
	--transition-fast: 0.2s ease;
	--transition-med: 0.4s ease;

	/* Derived/compatibility variables */
	--color-primary-light: #d4afa3;
	--color-primary-dark: #a47266;
	--color-secondary: #a8b89c;
	--color-secondary-light: #c1caad;
	--color-secondary-dark: #8e9d81;
	--color-success: #a8b89c;
	--color-warning: #c9a87a;
	--color-error: #b37164;
	--color-info: #a8acb0;
	--color-text: var(--color-dark);
	--color-text-muted: var(--color-muted);
	--color-text-light: #ada9a3;
	--color-surface: var(--color-bg-alt);
	--color-surface-dark: #dbd6cd;

	/* Typography */
	--font-primary: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	--font-heading: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	--font-size-xs: 0.75rem;
	--font-size-sm: 0.875rem;
	--font-size-base: 1rem;
	--font-size-lg: 1.125rem;
	--font-size-xl: 1.25rem;
	--font-size-2xl: 1.5rem;
	--font-size-3xl: 1.875rem;
	--font-size-4xl: 2.25rem;
	--font-size-5xl: 3rem;

	/* Spacing */
	--spacing-xs: 0.5rem;
	--spacing-sm: 1rem;
	--spacing-md: 1.5rem;
	--spacing-lg: 2rem;
	--spacing-xl: 3rem;
	--spacing-2xl: 4rem;
	--spacing-3xl: 6rem;

	/* Layout */
	--container-max-width: 1200px;
	--section-padding: 4rem;
	--section-padding-mobile: 2rem;

	/* Legacy shadows */
	--shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
	--shadow-base: var(--shadow-soft);
	--shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
	--shadow-lg: var(--shadow-soft-hover);

	/* Border radius legacy */
	--radius-sm: 0.25rem;
	--radius-base: 0.5rem;
	--radius-xl: 1rem;
}

/* ==========================================================================
   Reset & Base Styles
   ========================================================================== */

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	margin: 0;
	padding: 0;
}

html,
body {
	margin: 0;
	padding: 0;
}

body {
	font-family: var(--font-primary);
	font-size: 16px;
	line-height: 1.6;
	color: var(--color-dark);
	background-color: var(--color-bg);
}

a {
	color: inherit;
	text-decoration: none;
}

img {
	max-width: 100%;
	display: block;
}

/* ==========================================================================
   Layout
   ========================================================================== */

.site {
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}

.site-main {
	flex: 1;
}

.container {
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 1.5rem;
}

/* ==========================================================================
   Typography
   ========================================================================== */

h1,
h2,
h3,
h4 {
	margin: 0 0 0.75rem;
	font-weight: 700;
	line-height: 1.2;
	color: var(--color-dark);
}

h1 {
	font-size: 2.7rem;
	letter-spacing: 0;
}

h2 {
	font-size: 2rem;
	letter-spacing: 0;
}

h3 {
	font-size: 1.5rem;
}

h4 {
	font-size: 1.25rem;
	font-weight: 600;
}

p {
	margin: 0 0 1rem;
	color: var(--color-muted);
}

small {
	font-size: 0.85rem;
	color: var(--color-muted);
}

/* ==========================================================================
   Utilities
   ========================================================================== */

.section {
	padding: 4rem 0;
}

.section--light {
	background-color: var(--color-bg);
}

.section--alt {
	background-color: var(--color-bg-alt);
}

.section--dark {
	background-color: var(--color-dark);
	color: #e5dacf;
}

.section--dark p {
	color: #d4cfc5;
}

.section__header {
	margin-bottom: 2.25rem;
	max-width: 640px;
}

.section__eyebrow {
	font-size: 0.8rem;
	text-transform: uppercase;
	letter-spacing: 0.12em;
	color: var(--color-accent);
	font-weight: 700;
	margin-bottom: 0.4rem;
}

.section__title {
	margin-bottom: 0.5rem;
}

.section__subtitle {
	font-size: 0.95rem;
}

.grid {
	display: grid;
	gap: 2rem;
}

.grid--2 {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid--3 {
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 900px) {
	.grid--2,
	.grid--3 {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.8rem 1.7rem;
	border-radius: var(--radius-pill);
	border: 1px solid transparent;
	font-weight: 600;
	font-size: 0.95rem;
	letter-spacing: 0.02em;
	cursor: pointer;
	background-color: var(--color-primary);
	color: #ffffff;
	box-shadow: var(--shadow-soft);
	transition: background-color var(--transition-fast),
	            color var(--transition-fast),
	            transform var(--transition-fast),
	            box-shadow var(--transition-fast);
}

.btn:hover {
	transform: translateY(-1px);
	box-shadow: var(--shadow-soft-hover);
	background-color: #a47266;
	text-decoration: none;
}

.btn--secondary {
	background-color: #ffffff;
	color: var(--color-primary);
	border-color: var(--color-primary);
	box-shadow: none;
}

.btn--secondary:hover {
	background-color: var(--color-primary);
	color: #ffffff;
	box-shadow: var(--shadow-soft);
}

/* ==========================================================================
   Badge
   ========================================================================== */

.badge {
	display: inline-block;
	padding: 0.25rem 0.75rem;
	border-radius: var(--radius-pill);
	background-color: rgba(28, 78, 128, 0.08);
	color: var(--color-primary);
	font-size: 0.78rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.12em;
}

.badge--muted {
	background-color: rgba(15, 23, 42, 0.05);
	color: var(--color-muted);
}

/* ==========================================================================
   Cards
   ========================================================================== */

.card {
	background-color: #ffffff;
	border-radius: var(--radius-lg);
	padding: 1.75rem;
	box-shadow: var(--shadow-soft);
	border: 1px solid rgba(226, 232, 240, 0.8);
	transition: transform var(--transition-fast),
	            box-shadow var(--transition-fast),
	            border-color var(--transition-fast);
}

.card:hover {
	transform: translateY(-4px);
	box-shadow: var(--shadow-soft-hover);
	border-color: rgba(148, 163, 184, 0.8);
}

.card__title {
	font-size: 1.1rem;
	margin-bottom: 0.4rem;
}

.card__meta {
	font-size: 0.85rem;
	color: var(--color-muted);
	margin-bottom: 0.75rem;
}

.card__body {
	font-size: 0.95rem;
}

.card__link {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	margin-top: 1rem;
	font-size: 0.9rem;
	color: var(--color-primary);
	font-weight: 600;
}

.card__link span {
	font-size: 1rem;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */

.hero {
	padding: 4.5rem 0 4rem;
	background: radial-gradient(circle at top left, rgba(224, 122, 95, 0.18), transparent 55%),
	            radial-gradient(circle at bottom right, rgba(28, 78, 128, 0.18), transparent 55%);
}

.hero-inner {
	display: grid;
	grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
	gap: 3rem;
	align-items: center;
}

.hero-kicker {
	margin-bottom: 0.75rem;
}

.hero-title {
	margin-bottom: 0.75rem;
}

.hero-text {
	font-size: 1rem;
	max-width: 520px;
	margin-bottom: 1.75rem;
}

.hero-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
}

.hero-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 1.5rem;
	margin-top: 1.75rem;
	font-size: 0.9rem;
}

.hero-meta span {
	color: var(--color-muted);
}

.hero-figure {
	justify-self: center;
}

.hero-figure-box {
	background-color: #ffffff;
	border-radius: 1.5rem;
	padding: 1.5rem;
	box-shadow: var(--shadow-soft-hover);
	border: 1px solid rgba(226, 232, 240, 0.9);
	max-width: 360px;
}

.hero-stat {
	display: flex;
	justify-content: space-between;
	margin-bottom: 0.75rem;
	font-size: 0.9rem;
}

.hero-stat strong {
	font-size: 1.2rem;
	color: var(--color-primary);
}

@media (max-width: 900px) {
	.hero-inner {
		grid-template-columns: minmax(0, 1fr);
	}

	.hero {
		padding-top: 3.5rem;
	}
}

/* ==========================================================================
   Programmes Section
   ========================================================================== */

.programmes-grid {
	margin-top: 1.5rem;
}

.programme-card {
	height: 100%;
}

.programme-card .card__title {
	margin-bottom: 0.5rem;
}

/* ==========================================================================
   Featured Projects Section
   ========================================================================== */

.projects-grid {
	margin-top: 1.5rem;
}

.project-card .card__meta {
	margin-bottom: 0.35rem;
}

/* ==========================================================================
   News & Events Section
   ========================================================================== */

.news-layout {
	align-items: flex-start;
}

.news-block {
	background-color: #ffffff;
	border-radius: var(--radius-lg);
	border: 1px solid rgba(226, 232, 240, 0.9);
	padding: 1.5rem 1.75rem;
	box-shadow: var(--shadow-soft);
}

.news-block__title {
	font-size: 1.05rem;
	margin-bottom: 0.75rem;
}

.news-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 0.8rem;
	font-size: 0.92rem;
}

.news-item-title {
	font-weight: 600;
	margin-bottom: 0.2rem;
}

.news-item-meta {
	font-size: 0.8rem;
	color: var(--color-muted);
}

/* ==========================================================================
   Get Involved / CTA Section
   ========================================================================== */

.cta {
	text-align: center;
}

.cta p {
	max-width: 560px;
	margin-left: auto;
	margin-right: auto;
	margin-bottom: 1.75rem;
}

.cta-actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.8rem;
}

/* ==========================================================================
   Newsletter Section
   ========================================================================== */

.newsletter-band {
	padding: 3.5rem 0;
}

.newsletter-inner {
	background-color: #ffffff;
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow-soft);
	border: 1px solid rgba(226, 232, 240, 0.9);
	padding: 2rem 2rem 2.1rem;
	display: grid;
	grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.2fr);
	gap: 1.75rem;
	align-items: center;
}

@media (max-width: 900px) {
	.newsletter-inner {
		grid-template-columns: minmax(0, 1fr);
	}
}

.newsletter-copy h2 {
	font-size: 1.5rem;
	margin-bottom: 0.4rem;
}

.newsletter-copy p {
	margin-bottom: 0.5rem;
}

.newsletter-copy small {
	font-size: 0.8rem;
}

.newsletter-form {
	display: grid;
	gap: 0.75rem;
}

.newsletter-form-row {
	display: grid;
	gap: 0.75rem;
}

@media (min-width: 640px) {
	.newsletter-form-row {
		grid-template-columns: minmax(0, 1.6fr) auto;
		align-items: center;
	}
}

.newsletter-form-field {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	font-size: 0.9rem;
}

.newsletter-form-field label {
	font-weight: 600;
	color: var(--color-dark);
}

.newsletter-form-field input[type="email"] {
	border-radius: 0.9rem;
	border: 1px solid var(--color-border);
	padding: 0.65rem 0.9rem;
	font: inherit;
	background-color: #ffffff;
	min-width: 0;
	transition: border-color var(--transition-fast),
	            box-shadow var(--transition-fast);
}

.newsletter-form-field input[type="email"]:focus {
	outline: none;
	border-color: var(--color-primary);
	box-shadow: 0 0 0 1px rgba(28, 78, 128, 0.25);
}

.newsletter-helper {
	font-size: 0.8rem;
	color: var(--color-muted);
}

/* ==========================================================================
   Page Header (for generic info pages)
   ========================================================================== */

.page-header {
	padding: 3rem 0 2.5rem;
	background: radial-gradient(circle at top left, color-mix(in srgb, var(--color-primary) 15%, transparent), transparent 55%),
	            radial-gradient(circle at bottom right, color-mix(in srgb, var(--color-accent) 18%, transparent), transparent 55%);
	border-bottom: 1px solid var(--color-border);
}

.page-header__breadcrumb {
	font-size: 0.85rem;
	color: var(--color-muted);
	margin-bottom: 0.5rem;
}

.page-header__title {
	margin-bottom: 0.5rem;
}

.page-header__intro {
	max-width: 640px;
	font-size: 0.98rem;
}

/* ==========================================================================
   Page Layout (two-column layout with sidebar)
   ========================================================================== */

.page-layout {
	margin-top: 2.5rem;
}

.page-content {
	font-size: 0.98rem;
}

.page-content p {
	margin-bottom: 1.1rem;
}

.page-content h2,
.page-content h3,
.page-content h4 {
	margin-top: 1.8rem;
}

.page-content ul,
.page-content ol {
	padding-left: 1.2rem;
	margin: 0 0 1.1rem;
	color: var(--color-muted);
}

.page-content li {
	margin-bottom: 0.4rem;
}

.page-links {
	margin-top: 2rem;
	padding-top: 1rem;
	border-top: 1px solid var(--color-border);
	font-size: 0.95rem;
}

/* ==========================================================================
   Sidebar
   ========================================================================== */

.sidebar {
	display: grid;
	gap: 1.5rem;
}

.sidebar-box {
	background-color: var(--color-white, #ffffff);
	border-radius: var(--radius-lg);
	border: 1px solid color-mix(in srgb, var(--color-border) 90%, transparent);
	padding: 1.5rem 1.6rem;
	box-shadow: var(--shadow-soft);
	font-size: 0.92rem;
}

.sidebar-box__title {
	font-size: 0.98rem;
	font-weight: 700;
	margin-bottom: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--color-muted);
}

.sidebar-links {
	list-style: none;
	padding: 0;
	margin: 0;
	display: grid;
	gap: 0.4rem;
}

.sidebar-links a {
	color: var(--color-primary);
	font-weight: 500;
	font-size: 0.92rem;
	transition: color var(--transition-fast);
}

.sidebar-links a:hover {
	color: var(--color-accent);
	text-decoration: underline;
}

.sidebar-callout {
	border-left: 3px solid var(--color-accent);
	padding-left: 1.25rem;
}

.sidebar-callout p {
	margin-bottom: 0.5rem;
}

.sidebar-callout small {
	display: block;
	margin-bottom: 0.4rem;
}

/* ==========================================================================
   Highlights Band (statistics/key facts)
   ========================================================================== */

.highlights {
	margin-top: 0.5rem;
}

.highlights-grid {
	margin-top: 1.5rem;
}

.highlight-item {
	text-align: center;
	padding: 1.5rem 1rem;
	border-radius: var(--radius-lg);
	background-color: var(--color-white, #ffffff);
	border: 1px solid color-mix(in srgb, var(--color-border) 90%, transparent);
	box-shadow: var(--shadow-soft);
	transition: transform var(--transition-fast),
	            box-shadow var(--transition-fast);
}

.highlight-item:hover {
	transform: translateY(-3px);
	box-shadow: var(--shadow-soft-hover);
}

.highlight-item strong {
	display: block;
	font-size: 1.4rem;
	margin-bottom: 0.25rem;
	color: var(--color-primary);
}

.highlight-item span {
	font-size: 0.9rem;
	color: var(--color-muted);
}

/* ==========================================================================
   Archive Header (for CPT archives)
   ========================================================================== */

.archive-header {
	padding: 3rem 0 2.5rem;
	background: radial-gradient(circle at top left, rgba(224, 122, 95, 0.15), transparent 55%),
	            radial-gradient(circle at bottom right, rgba(28, 78, 128, 0.12), transparent 55%);
	border-bottom: 1px solid var(--color-border);
}

.archive-header__title {
	margin-bottom: 0.5rem;
}

.archive-header__intro {
	max-width: 640px;
	font-size: 0.98rem;
}

/* ==========================================================================
   Filter Bar (for archive pages)
   ========================================================================== */

.filter-bar {
	margin-top: 2rem;
	background-color: #ffffff;
	border-radius: var(--radius-lg);
	border: 1px solid rgba(226, 232, 240, 0.9);
	padding: 1.25rem 1.5rem;
	box-shadow: var(--shadow-soft);
	display: flex;
	flex-wrap: wrap;
	gap: 1rem 1.5rem;
	align-items: center;
}

.filter-bar__label {
	font-size: 0.85rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--color-muted);
	margin-right: 0.5rem;
}

.filter-group {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
	align-items: center;
	flex: 1;
}

.filter-field {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	font-size: 0.85rem;
}

.filter-field label {
	font-weight: 600;
	color: var(--color-muted);
}

.filter-field select {
	min-width: 160px;
	padding: 0.45rem 0.75rem;
	border-radius: var(--radius-md);
	border: 1px solid var(--color-border);
	font-size: 0.9rem;
	background-color: #ffffff;
	color: var(--color-dark);
	cursor: pointer;
	transition: border-color var(--transition-fast);
}

.filter-field select:focus {
	outline: none;
	border-color: var(--color-primary);
}

@media (max-width: 768px) {
	.filter-bar {
		flex-direction: column;
		align-items: stretch;
	}

	.filter-group {
		flex-direction: column;
		align-items: stretch;
	}

	.filter-field select {
		width: 100%;
	}
}

/* ==========================================================================
   Projects Section (archive specific)
   ========================================================================== */

.projects-section {
	padding-top: 2.5rem;
}

.projects-grid {
	margin-top: 1.5rem;
}

.project-card .badge {
	margin-bottom: 0.5rem;
}

.project-card .card__meta {
	margin-bottom: 0.4rem;
}

/* ==========================================================================
   Pagination
   ========================================================================== */

.pagination {
	margin-top: 2.5rem;
	display: flex;
	justify-content: center;
	gap: 0.4rem;
	align-items: center;
	font-size: 0.9rem;
}

.pagination .nav-links {
	display: flex;
	gap: 0.4rem;
	align-items: center;
}

.pagination a,
.pagination span {
	min-width: 32px;
	height: 32px;
	padding: 0 0.75rem;
	border-radius: 999px;
	border: 1px solid transparent;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: all var(--transition-fast);
}

.pagination a {
	border-color: var(--color-border);
	background-color: #ffffff;
	color: var(--color-dark);
}

.pagination a:hover,
.pagination a:focus {
	border-color: var(--color-primary);
	color: var(--color-primary);
	text-decoration: none;
}

.pagination .current,
.pagination .is-current {
	background-color: var(--color-primary);
	border-color: var(--color-primary);
	color: #ffffff;
	font-weight: 600;
	cursor: default;
}

.pagination .dots {
	border-color: transparent;
	cursor: default;
	padding: 0 0.25rem;
}

.pagination .prev,
.pagination .next {
	font-weight: 600;
}

/* ==========================================================================
   Accessibility
   ========================================================================== */

.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.skip-link {
	position: absolute;
	top: -100px;
	left: 0;
	background-color: var(--color-primary);
	color: #fff;
	padding: 0.75rem 1.5rem;
	text-decoration: none;
	z-index: 10000;
}

.skip-link:focus {
	top: 0;
}

*:focus {
	outline: 2px solid var(--color-primary);
	outline-offset: 2px;
}

button:focus,
a:focus {
	outline: 2px solid var(--color-primary);
	outline-offset: 2px;
}
