/**
 * Base Styles — Reset + Typography
 *
 * @package CHV_Theme
 */

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

body {
	margin: 0;
	padding: 0;
	font-family: var(--chv-font-family);
	font-size: var(--chv-font-base);
	line-height: var(--chv-line-height-normal);
	color: var(--chv-text-dark);
	background: var(--chv-text-light);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	overflow-x: hidden;
}

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

a {
	color: var(--chv-primary-blue);
	text-decoration: none;
	transition: var(--chv-transition);
}

a:hover,
a:focus {
	color: var(--chv-secondary-blue);
	text-decoration: underline;
}

/* Prevent underlines on all button-like links */
a[class*="-btn"],
a[class*="-button"],
a[class*="-cta"] {
	text-decoration: none;
}

a[class*="-btn"]:hover,
a[class*="-btn"]:focus,
a[class*="-button"]:hover,
a[class*="-button"]:focus,
a[class*="-cta"]:hover,
a[class*="-cta"]:focus {
	text-decoration: none;
}

/* Keyboard-only focus ring (not shown on mouse click) */
*:focus-visible {
	outline: 2px solid var(--chv-primary-blue);
	outline-offset: 2px;
}

/* ============================================
   Typography
   ============================================ */
h1, h2, h3, h4, h5, h6 {
	margin: 0 0 var(--chv-spacing-md);
	font-family: var(--chv-font-family-heading);
	font-weight: var(--chv-font-weight-bold);
	line-height: 1.3;
}

[class*="-hero-title"] {
	font-weight: var(--chv-font-weight-extrabold);
}

h1 { font-size: var(--chv-font-hero); }
h2 { font-size: var(--chv-font-section); }
h3 { font-size: var(--chv-font-card); }

p {
	margin: 0 0 var(--chv-spacing-md);
}

/* ============================================
   Container
   ============================================ */
.chv-container {
	max-width: var(--chv-container-max);
	margin: 0 auto;
	padding: 0 var(--chv-page-padding);
}

/* ============================================
   Section Base (shared across all pages)
   ============================================ */
.chv-section {
	padding: var(--chv-spacing-section) var(--chv-page-padding);
	width: 100%;
	box-sizing: border-box;
}

.chv-section-container {
	max-width: var(--chv-container-max);
	margin: 0 auto;
}

.chv-section-title {
	font-size: var(--chv-font-section);
	font-weight: var(--chv-font-weight-extrabold);
	margin: 0 0 var(--chv-spacing-lg) 0;
	text-align: center;
	color: var(--chv-primary-blue);
	line-height: 1.2;
}

/* ============================================
   Shared Button Utility Classes
   ============================================ */

/* Base button - use with size and variant modifiers */
.chv-btn {
	display: inline-block;
	font-weight: var(--chv-font-weight-semibold);
	text-decoration: none;
	border-radius: var(--chv-radius-lg);
	transition: var(--chv-transition);
	border: 2px solid transparent;
	box-sizing: border-box;
	text-align: center;
	cursor: pointer;
}

/* Size modifiers */
.chv-btn-lg {
	padding: 18px 36px;
	font-size: var(--chv-font-lg);
}

.chv-btn-md {
	padding: 16px 32px;
	font-size: var(--chv-font-base);
}

.chv-btn-sm {
	padding: 12px 24px;
	font-size: var(--chv-font-base);
}

/* Primary variant - white background, blue text (for use on blue backgrounds) */
.chv-btn-primary {
	background: var(--chv-text-light);
	color: var(--chv-primary-blue);
}

.chv-btn-primary:hover,
.chv-btn-primary:focus {
	transform: translateY(-3px);
	box-shadow: var(--chv-shadow-hover);
}

/* Secondary variant - transparent with white border (for use on blue backgrounds) */
.chv-btn-secondary {
	background: transparent;
	color: var(--chv-text-light);
	border-color: var(--chv-text-light);
}

.chv-btn-secondary:hover,
.chv-btn-secondary:focus {
	background: var(--chv-text-light);
	color: var(--chv-primary-blue);
	transform: translateY(-3px);
	box-shadow: var(--chv-shadow-hover);
}

/* Blue variant - blue background, white text (for use on light backgrounds) */
.chv-btn-blue {
	background: var(--chv-primary-blue);
	color: var(--chv-text-light);
}

.chv-btn-blue:hover,
.chv-btn-blue:focus {
	background: var(--chv-secondary-blue);
	transform: translateY(-2px);
	box-shadow: var(--chv-shadow-hover-soft);
}

/* Outline variant - white background with blue border (for use on light backgrounds) */
.chv-btn-outline {
	background: var(--chv-text-light);
	color: var(--chv-primary-blue);
	border-color: var(--chv-primary-blue);
}

.chv-btn-outline:hover,
.chv-btn-outline:focus {
	background: var(--chv-light-blue-bg);
	transform: translateY(-2px);
}

/* ============================================
   Shared Card Utility Classes
   ============================================ */

/* Base card style - white background, rounded corners, shadow */
.chv-card {
	background: var(--chv-text-light);
	padding: var(--chv-spacing-lg);
	border-radius: var(--chv-radius-xl);
	box-shadow: var(--chv-shadow-sm);
}

.chv-card-hover {
	transition: var(--chv-transition);
}

.chv-card-hover:hover {
	box-shadow: var(--chv-shadow-lg);
	transform: translateY(-4px);
}

/* Card with left accent border */
.chv-card-accent {
	border-left: 4px solid var(--chv-accent-warm);
}

/* ============================================
   Call to Action Section (shared across pages)
   ============================================ */
/* !important overrides WordPress block editor inline styles */
.chv-cta-section {
	background: var(--chv-primary-blue) !important;
	color: var(--chv-text-light);
	margin-bottom: 0 !important;
}

.chv-cta-container {
	text-align: center;
}

.chv-cta-title {
	font-size: var(--chv-font-cta, var(--chv-font-section));
	font-weight: var(--chv-font-weight-extrabold);
	margin: 0 0 var(--chv-spacing-md) 0;
	color: var(--chv-text-light);
}

.chv-cta-text {
	font-size: var(--chv-font-lg);
	margin: 0 0 var(--chv-spacing-xl) 0;
	max-width: 800px;
	margin-left: auto;
	margin-right: auto;
	line-height: 1.7;
}

.chv-cta-buttons {
	display: flex;
	gap: var(--chv-spacing-md);
	justify-content: center;
	flex-wrap: wrap;
}

.chv-cta-btn {
	padding: 18px 36px;
	font-size: var(--chv-font-lg);
	font-weight: var(--chv-font-weight-semibold);
	text-decoration: none;
	border-radius: var(--chv-radius-lg);
	transition: var(--chv-transition);
	display: inline-block;
	border: 2px solid transparent;
	box-sizing: border-box;
}

.chv-cta-btn-primary {
	background: var(--chv-text-light);
	color: var(--chv-primary-blue);
}

.chv-cta-btn-primary:hover,
.chv-cta-btn-primary:focus {
	transform: translateY(-3px);
	box-shadow: var(--chv-shadow-hover);
	text-decoration: none;
}

.chv-cta-btn-secondary {
	background: transparent;
	color: var(--chv-text-light);
	border-color: var(--chv-text-light);
}

.chv-cta-btn-secondary:hover,
.chv-cta-btn-secondary:focus {
	background: transparent;
	border-color: var(--chv-text-light);
	transform: translateY(-3px);
	box-shadow: var(--chv-shadow-hover-soft);
	text-decoration: none;
}

/* ============================================
   Hero noise texture overlay
   ============================================ */
.chv-hero,
.chv-members-hero,
.chv-volunteers-hero,
.chv-programs-hero,
.chv-support-hero,
.chv-about-hero,
.chv-newsletters-hero {
	position: relative;
}

.chv-hero::after,
.chv-members-hero::after,
.chv-volunteers-hero::after,
.chv-programs-hero::after,
.chv-support-hero::after,
.chv-about-hero::after,
.chv-newsletters-hero::after {
	content: '';
	position: absolute;
	inset: 0;
	background-image: var(--chv-noise-texture);
	background-repeat: repeat;
	pointer-events: none;
	z-index: 1;
}

.chv-hero > *,
.chv-members-hero > *,
.chv-volunteers-hero > *,
.chv-programs-hero > *,
.chv-support-hero > *,
.chv-about-hero > *,
.chv-newsletters-hero > * {
	position: relative;
	z-index: 2;
}

/* ============================================
   WordPress Container Resets
   Override default WP containers that add
   unwanted padding/margins to full-width pages.
   ============================================ */
#page,
.site,
.site-main,
main,
.entry-content,
.site-content,
.wp-site-blocks,
article,
article.page,
article.post {
	max-width: 100%;
}

main {
	width: 100%;
	max-width: 100%;
	margin: 0;
	padding: 0;
}

/* Only remove margins from direct children that wrap shortcodes */
.entry-content > .chv-homepage,
.entry-content > .chv-volunteers-page,
.entry-content > .chv-members-page,
.entry-content > .chv-programs-page,
.entry-content > .chv-support-page,
.entry-content > .chv-about-page,
.entry-content > .chv-footer {
	margin: 0;
}

/* Remove any gaps from WordPress paragraph wrappers between content and footer */
.entry-content > p:empty,
.entry-content > br,
.wp-site-blocks > p:empty {
	display: none;
	margin: 0;
	padding: 0;
	height: 0;
	line-height: 0;
}

.entry-content::after,
.wp-site-blocks::after {
	display: none;
}

/* Force WordPress to not add space between shortcode outputs */
.entry-content > * + .chv-footer,
.wp-site-blocks > * + .chv-footer,
.chv-footer {
	margin-top: 0;
}

/* Ensure the last section has no gap to footer */
.chv-homepage > .chv-section:last-child,
.chv-volunteers-page > .chv-section:last-child,
.chv-members-page > .chv-section:last-child,
.chv-programs-page > .chv-section:last-child,
.chv-support-page > .chv-section:last-child,
.chv-about-page > .chv-section:last-child {
	margin-bottom: 0;
}

/* Ensure no gap between page content and footer */
.chv-homepage + .chv-footer,
.chv-volunteers-page + .chv-footer,
.chv-members-page + .chv-footer,
.chv-programs-page + .chv-footer,
.chv-support-page + .chv-footer,
.chv-about-page + .chv-footer {
	margin-top: 0;
}

/* Last section should have no bottom margin */
.chv-cta-section,
.chv-volunteers-contact {
	margin-bottom: 0;
}

/* Section background — light blue for all non-CTA sections */
.chv-section:not(.chv-cta-section) {
	background: var(--chv-light-blue-bg);
}

/* WordPress container overrides for footer */
.entry-content > footer.chv-footer,
.wp-site-blocks footer.chv-footer,
footer.chv-footer {
	max-width: none;
}

/* ============================================
   Shared Contact Section
   ============================================ */
.chv-contact-content {
	max-width: 700px;
	margin: 0 auto;
	text-align: center;
}

.chv-contact-intro {
	font-size: var(--chv-font-base);
	line-height: 1.7;
	color: var(--chv-text-gray);
	margin: 0 0 var(--chv-spacing-lg) 0;
}

.chv-contact-card {
	background: var(--chv-text-light);
	padding: var(--chv-spacing-lg);
	border-radius: var(--chv-radius-xl);
	box-shadow: var(--chv-shadow-md);
}

.chv-contact-name {
	font-size: var(--chv-font-card);
	font-weight: var(--chv-font-weight-bold);
	color: var(--chv-text-dark);
	margin: 0 0 var(--chv-spacing-xs) 0;
}

.chv-contact-title {
	font-size: var(--chv-font-base);
	color: var(--chv-text-gray);
	margin: 0 0 var(--chv-spacing-md) 0;
}

.chv-contact-methods {
	margin: 0;
}

.chv-contact-methods a {
	color: var(--chv-primary-blue);
	text-decoration: none;
	font-weight: var(--chv-font-weight-semibold);
	font-size: var(--chv-font-lg);
	transition: var(--chv-transition);
}

.chv-contact-methods a:hover {
	text-decoration: underline;
}

/* ============================================
   Shared Responsive Overrides
   ============================================ */
@media (max-width: 992px) {
	.chv-section {
		padding: var(--chv-spacing-section) var(--chv-spacing-md);
	}
}

@media (max-width: 480px) {
	.chv-contact-methods a {
		font-size: var(--chv-font-base);
		display: inline-block;
		max-width: 100%;
	}
}

/* ============================================
   Reduced Motion
   Disables transforms and animations for users
   who prefer reduced motion in OS settings.
   ============================================ */
/* ============================================
   404 Page
   ============================================ */
.chv-404-page {
	background: var(--chv-light-blue-bg);
}

.chv-404-content {
	max-width: var(--chv-container-max);
	margin: 0 auto;
	padding: 120px var(--chv-page-padding);
	text-align: center;
}

.chv-404-title {
	font-size: var(--chv-font-hero);
	font-weight: var(--chv-font-weight-bold);
	color: var(--chv-primary-blue);
	margin: 0 0 var(--chv-spacing-md) 0;
}

.chv-404-text {
	font-size: var(--chv-font-lg);
	color: var(--chv-text-gray);
	margin: 0 0 var(--chv-spacing-xl) 0;
	max-width: 600px;
	margin-left: auto;
	margin-right: auto;
}

.chv-404-actions {
	display: flex;
	gap: var(--chv-spacing-md);
	justify-content: center;
	margin-bottom: var(--chv-spacing-xl);
}

.chv-404-btn {
	display: inline-block;
	padding: 14px 32px;
	border-radius: var(--chv-radius-md);
	font-size: var(--chv-font-base);
	font-weight: var(--chv-font-weight-semibold);
	text-decoration: none;
	transition: var(--chv-transition);
}

.chv-404-btn-primary {
	background: var(--chv-primary-blue);
	color: var(--chv-text-light);
}

.chv-404-btn-secondary {
	background: transparent;
	color: var(--chv-primary-blue);
	border: 2px solid var(--chv-primary-blue);
}

.chv-404-btn:hover {
	transform: translateY(-2px);
	box-shadow: var(--chv-shadow-lg);
}

.chv-404-btn-secondary:hover {
	background: var(--chv-primary-blue);
	color: var(--chv-text-light);
}

.chv-404-contact {
	font-size: var(--chv-font-sm);
	color: var(--chv-text-gray);
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
	}
}
