/*
 * style.css — Complete stylesheet for Right Foundation SPA
 *
 * ORGANIZATION:
 * 1. CSS Custom Properties (design tokens)
 * 2. Reset & Base
 * 3. Typography
 * 4. Layout Utilities
 * 5. Accessibility (skip link)
 * 6. Header & Navigation
 * 7. Footer
 * 8. Buttons
 * 9. Forms & Inputs
 * 10. Cards
 * 11. Hero Sections
 * 12. Content Sections
 * 13. Stats / Counters
 * 14. Loading Spinner
 * 15. Toast Notifications
 * 16. Utility Classes
 * 17. Animations
 * 18. Media Queries (Tablet → Desktop)
 */

/* ==========================================================
   1. CSS CUSTOM PROPERTIES (Design Tokens)
   Change these to restyle the entire site at once.
   ========================================================== */
:root {
  /* --- Colors --- */
  --color-primary:        #1a6b3c;   /* Forest green: trust, nature    */
  --color-primary-dark:   #0d4a28;   /* Darker green for hover states  */
  --color-primary-light:  #e8f5e9;   /* Light green for backgrounds    */
  --color-secondary:      #1565c0;   /* Deep blue: stability           */
  --color-secondary-light:#e3f2fd;   /* Light blue for accents         */
  --color-accent:         #e65100;   /* Warm orange: action, energy    */
  --color-accent-light:   #fff3e0;   /* Light orange for highlights    */

  --color-text:           #212121;   /* Near-black for body text       */
  --color-text-light:     #616161;   /* Gray for secondary text        */
  --color-text-inverse:   #ffffff;   /* White text on dark backgrounds */

  --color-bg:             #ffffff;   /* Main background                */
  --color-bg-alt:         #f5f7f5;   /* Alternate section background   */
  --color-border:         #e0e0e0;   /* Subtle borders                 */

  --color-error:          #c62828;   /* Error / validation red         */
  --color-success:        #2e7d32;   /* Success green                  */
  --color-warning:        #f57f17;   /* Warning amber                  */

  /* --- Typography --- */
  --font-heading: 'Georgia', 'Times New Roman', serif;
  --font-body:    -apple-system, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;

  /* --- Spacing scale (consistent rhythm) --- */
  --space-xs:  0.25rem;  /*  4px */
  --space-sm:  0.5rem;   /*  8px */
  --space-md:  1rem;     /* 16px */
  --space-lg:  1.5rem;   /* 24px */
  --space-xl:  2.5rem;   /* 40px */
  --space-2xl: 4rem;     /* 64px */
  --space-3xl: 6rem;     /* 96px */

  /* --- Border radius --- */
  --radius-sm:  4px;
  --radius-md:  8px;
  --radius-lg:  16px;
  --radius-full: 50%;

  /* --- Shadows --- */
  --shadow-sm:  0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-md:  0 4px 12px rgba(0, 0, 0, 0.1);
  --shadow-lg:  0 10px 30px rgba(0, 0, 0, 0.12);

  /* --- Layout --- */
  --max-width:  1200px;
  --header-height: 70px;

  /* --- Transitions --- */
  --transition-fast: 0.15s ease;
  --transition:      0.3s ease;
  --transition-slow: 0.5s ease;
}


/* ==========================================================
   2. RESET & BASE
   Normalize browser defaults for consistent styling.
   ========================================================== */

/* Box-sizing: border-box makes width/height include padding */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;    /* Smooth scrolling for anchor links */
  font-size: 100%;            /* 1rem = 16px (browser default)     */
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;      /* Footer sticks to bottom */
}

/* Remove default list styles */
ul, ol { list-style: none; }

/* Make images responsive by default */
img, picture, video, svg {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Remove default link underlines (we'll add them intentionally) */
a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover { color: var(--color-primary-dark); }

/* Focus outline for keyboard navigation (accessibility) */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid var(--color-secondary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}


/* ==========================================================
   3. TYPOGRAPHY
   ========================================================== */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-text);
  margin-bottom: var(--space-md);
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }     /* Responsive: 32px → 56px */
h2 { font-size: clamp(1.5rem, 4vw, 2.5rem); }   /* 24px → 40px */
h3 { font-size: clamp(1.25rem, 3vw, 1.75rem); }  /* 20px → 28px */
h4 { font-size: 1.125rem; }                       /* 18px */

p { margin-bottom: var(--space-md); }

/* Smaller muted text */
.text-small {
  font-size: 0.875rem;
  color: var(--color-text-light);
}

/* Section subtitle (appears above headings) */
.section-subtitle {
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--color-primary);
  margin-bottom: var(--space-sm);
}

/* Decorative line under section headings */
.section-heading {
  position: relative;
  padding-bottom: var(--space-md);
  margin-bottom: var(--space-xl);
}

.section-heading::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: var(--color-primary);
  border-radius: 2px;
}


/* ==========================================================
   4. LAYOUT UTILITIES
   ========================================================== */

/* Container: centers content with max-width and side padding */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

/* Page sections with consistent vertical padding */
.section {
  padding: var(--space-2xl) 0;
}

.section--alt {
  background-color: var(--color-bg-alt);
}

/* Flexbox row (wraps on mobile) */
.flex-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-lg);
}

/* Grid: auto-fit columns that resize responsively */
.grid {
  display: grid;
  gap: var(--space-lg);
}

.grid--2 { grid-template-columns: 1fr; }
.grid--3 { grid-template-columns: 1fr; }
.grid--4 { grid-template-columns: 1fr; }

/* Text alignment */
.text-center { text-align: center; }
.text-left   { text-align: left; }


/* ==========================================================
   5. ACCESSIBILITY — Skip Link
   Hidden link that becomes visible on Tab press,
   letting keyboard users jump straight to content.
   ========================================================== */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-md);
  background: var(--color-primary);
  color: var(--color-text-inverse);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  z-index: 1000;
  font-weight: 600;
}

.skip-link:focus {
  top: var(--space-sm);
}


/* ==========================================================
   6. HEADER & NAVIGATION
   ========================================================== */
.site-header {
  position: fixed;              /* Stays at top while scrolling   */
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--color-bg);
  z-index: 100;
  transition: box-shadow var(--transition);
}

/* Shadow appears when user scrolls (added by JS) */
.header--scrolled {
  box-shadow: var(--shadow-md);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

/* --- Logo --- */
.logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-heading);
  font-size: 1.25rem;
  color: var(--color-text);
  text-decoration: none;
}

.logo:hover { color: var(--color-primary); }

.logo-icon { font-size: 1.5rem; }

.logo-text strong {
  color: var(--color-primary);
}

/* --- Hamburger Button (mobile only) --- */
.nav-toggle {
  display: flex;             /* Visible on mobile */
  align-items: center;
  justify-content: center;
  width: 44px;               /* Minimum touch target (44×44) */
  height: 44px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 101;
}

/* Hamburger icon: middle bar + ::before (top) + ::after (bottom) */
.hamburger {
  position: relative;
  width: 24px;
  height: 2px;
  background: var(--color-text);
  transition: background var(--transition-fast);
}

.hamburger::before,
.hamburger::after {
  content: '';
  position: absolute;
  left: 0;
  width: 24px;
  height: 2px;
  background: var(--color-text);
  transition: transform var(--transition);
}

.hamburger::before { top: -7px; }
.hamburger::after  { top: 7px;  }

/* Animate hamburger → X when menu is open */
.nav-toggle--active .hamburger {
  background: transparent;   /* Hide middle bar */
}

.nav-toggle--active .hamburger::before {
  transform: rotate(45deg);
  top: 0;
}

.nav-toggle--active .hamburger::after {
  transform: rotate(-45deg);
  top: 0;
}

/* --- Navigation Menu --- */
.nav-menu {
  /* Mobile: hidden off-screen by default */
  position: fixed;
  top: var(--header-height);
  right: -100%;              /* Off-screen to the right */
  width: 280px;
  height: calc(100vh - var(--header-height));
  background: var(--color-bg);
  flex-direction: column;
  padding: var(--space-lg);
  gap: var(--space-xs);
  transition: right var(--transition);
  box-shadow: var(--shadow-lg);
  display: flex;
  overflow-y: auto;
}

/* Slide in when open */
.nav-menu--open {
  right: 0;
}

/* --- Nav Links --- */
.nav-link {
  display: block;
  padding: var(--space-sm) var(--space-md);
  color: var(--color-text);
  font-weight: 500;
  font-size: 1rem;
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast), color var(--transition-fast);
}

.nav-link:hover {
  background: var(--color-primary-light);
  color: var(--color-primary);
}

/* Active (current page) link */
.nav-link.active {
  color: var(--color-primary);
  font-weight: 700;
  background: var(--color-primary-light);
}

/* Donate button in nav — stands out with accent color */
.nav-link--cta {
  background: var(--color-accent);
  color: var(--color-text-inverse) !important;
  font-weight: 700;
  text-align: center;
  border-radius: var(--radius-md);
  margin-top: var(--space-sm);
}

.nav-link--cta:hover {
  background: #bf4400;
  color: var(--color-text-inverse) !important;
}

.nav-link--cta.active {
  background: #bf4400;
  color: var(--color-text-inverse) !important;
}


/* ==========================================================
   7. FOOTER
   ========================================================== */
.site-footer {
  background: #1a1a2e;       /* Dark navy background */
  color: #ccc;
  margin-top: auto;          /* Pushes footer to bottom of page */
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xl);
  padding: var(--space-2xl) 0 var(--space-xl);
}

.footer-logo {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  color: var(--color-text-inverse);
  font-weight: 700;
  display: inline-block;
  margin-bottom: var(--space-md);
}

.footer-logo:hover { color: var(--color-primary-light); }

.footer-desc {
  font-size: 0.9rem;
  line-height: 1.7;
  color: #aaa;
}

.footer-heading {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text-inverse);
  margin-bottom: var(--space-md);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.footer-links li { margin-bottom: var(--space-sm); }

.footer-links a {
  color: #aaa;
  font-size: 0.9rem;
  transition: color var(--transition-fast);
}

.footer-links a:hover { color: var(--color-primary-light); }

.footer-contact {
  font-style: normal;
  font-size: 0.9rem;
  line-height: 2;
}

.footer-contact a {
  color: #aaa;
}

.footer-contact a:hover { color: var(--color-primary-light); }

/* Social links */
.social-links {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.1);
  color: #ccc;
  font-size: 0.75rem;
  font-weight: 700;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.social-link:hover {
  background: var(--color-primary);
  color: var(--color-text-inverse);
}

/* Copyright bar */
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: var(--space-lg) 0;
  font-size: 0.8rem;
  color: #888;
}

.footer-bottom-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  text-align: center;
}


/* ==========================================================
   8. BUTTONS
   ========================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 0.75rem 1.75rem;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  line-height: 1.4;
  min-height: 44px;           /* Accessible touch target */
}

/* Primary button (green) */
.btn-primary {
  background: var(--color-primary);
  color: var(--color-text-inverse);
  border-color: var(--color-primary);
}

.btn-primary:hover {
  background: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
  color: var(--color-text-inverse);
}

/* Secondary button (outlined) */
.btn-secondary {
  background: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.btn-secondary:hover {
  background: var(--color-primary);
  color: var(--color-text-inverse);
}

/* Accent button (orange — for donate/CTA) */
.btn-accent {
  background: var(--color-accent);
  color: var(--color-text-inverse);
  border-color: var(--color-accent);
}

.btn-accent:hover {
  background: #bf4400;
  border-color: #bf4400;
  color: var(--color-text-inverse);
}

/* Outline white button (for dark backgrounds) */
.btn-outline-white {
  background: transparent;
  color: var(--color-text-inverse);
  border-color: var(--color-text-inverse);
}

.btn-outline-white:hover {
  background: var(--color-text-inverse);
  color: var(--color-primary);
}

/* Full-width button */
.btn-block {
  width: 100%;
}

/* Disabled state */
.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}


/* ==========================================================
   9. FORMS & INPUTS
   ========================================================== */
.form-group {
  margin-bottom: var(--space-lg);
}

.form-label {
  display: block;
  font-weight: 600;
  margin-bottom: var(--space-xs);
  font-size: 0.9rem;
  color: var(--color-text);
}

/* Required field indicator */
.form-label .required {
  color: var(--color-error);
  margin-left: 2px;
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 0.75rem 1rem;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--color-text);
  background: var(--color-bg);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  min-height: 44px;           /* Accessible touch target */
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
}

/* Focus state: blue border */
.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  border-color: var(--color-secondary);
  box-shadow: 0 0 0 3px rgba(21, 101, 192, 0.15);
  outline: none;
}

/* Error state: red border */
.form-input--error,
.form-textarea--error {
  border-color: var(--color-error);
}

/* Error message text */
.form-error {
  color: var(--color-error);
  font-size: 0.8rem;
  margin-top: var(--space-xs);
  display: none;              /* Shown via JS */
}

.form-error--visible {
  display: block;
}

/* Success message */
.form-success {
  background: var(--color-primary-light);
  color: var(--color-success);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  font-weight: 600;
  text-align: center;
  margin-bottom: var(--space-lg);
}


/* ==========================================================
   10. CARDS
   ========================================================== */
.card {
  background: var(--color-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
}

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

.card-image {
  width: 100%;
  height: 200px;
  object-fit: cover;         /* Crop to fill without distortion */
  background: var(--color-bg-alt);
}

/* Placeholder for missing images */
.card-image-placeholder {
  width: 100%;
  height: 200px;
  background: linear-gradient(135deg, var(--color-primary-light), var(--color-secondary-light));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
}

.card-body {
  padding: var(--space-lg);
}

.card-title {
  font-size: 1.25rem;
  margin-bottom: var(--space-sm);
}

.card-text {
  color: var(--color-text-light);
  font-size: 0.95rem;
  margin-bottom: var(--space-md);
}

.card-meta {
  font-size: 0.8rem;
  color: var(--color-text-light);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}


/* ==========================================================
   11. HERO SECTIONS
   Each page starts with a hero banner.
   ========================================================== */
.hero {
  padding: var(--space-3xl) 0 var(--space-2xl);
  margin-top: var(--header-height);  /* Offset for fixed header */
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* Default green gradient hero */
.hero--primary {
  background: linear-gradient(135deg, var(--color-primary) 0%, #2e7d32 100%);
  color: var(--color-text-inverse);
}

.hero--primary h1,
.hero--primary h2,
.hero--primary p {
  color: var(--color-text-inverse);
}

/* Home page hero: larger, more dramatic */
.hero--home {
  padding: var(--space-3xl) 0;
  margin-top: var(--header-height);
  background: linear-gradient(135deg, #0d4a28 0%, var(--color-primary) 50%, #2e7d32 100%);
  color: var(--color-text-inverse);
  min-height: 70vh;
  display: flex;
  align-items: center;
}

.hero--home h1,
.hero--home p {
  color: var(--color-text-inverse);
}

.hero-title {
  font-size: clamp(2.25rem, 6vw, 4rem);
  margin-bottom: var(--space-md);
  font-weight: 800;
}

.hero-subtitle {
  font-size: clamp(1.1rem, 2.5vw, 1.35rem);
  opacity: 0.9;
  max-width: 650px;
  margin: 0 auto var(--space-xl);
  line-height: 1.7;
  font-family: var(--font-body);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  justify-content: center;
}


/* ==========================================================
   12. CONTENT SECTIONS
   ========================================================== */

/* Two-column layout for text + image */
.content-split {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xl);
  align-items: center;
}

/* Value/feature cards (mission, vision, etc.) */
.value-card {
  text-align: center;
  padding: var(--space-xl) var(--space-lg);
}

.value-icon {
  font-size: 2.5rem;
  margin-bottom: var(--space-md);
}

.value-title {
  font-size: 1.25rem;
  margin-bottom: var(--space-sm);
}

/* Team member cards */
.team-card {
  text-align: center;
  padding: var(--space-lg);
}

.team-avatar {
  width: 120px;
  height: 120px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--color-primary-light), var(--color-secondary-light));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  margin: 0 auto var(--space-md);
}

.team-name {
  font-size: 1.1rem;
  margin-bottom: var(--space-xs);
}

.team-role {
  color: var(--color-primary);
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: var(--space-sm);
}

/* Timeline (About page) */
.timeline {
  position: relative;
  padding-left: var(--space-xl);
}

.timeline::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--color-primary-light);
}

.timeline-item {
  position: relative;
  margin-bottom: var(--space-xl);
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: calc(-1 * var(--space-xl) + 4px);
  top: 6px;
  width: 14px;
  height: 14px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  border: 3px solid var(--color-primary-light);
}

.timeline-year {
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: var(--space-xs);
  font-size: 1.1rem;
}

/* Testimonial / quote card */
.testimonial {
  background: var(--color-bg);
  border-left: 4px solid var(--color-primary);
  padding: var(--space-lg);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin-bottom: var(--space-lg);
  box-shadow: var(--shadow-sm);
}

.testimonial-text {
  font-style: italic;
  font-size: 1.05rem;
  line-height: 1.8;
  margin-bottom: var(--space-md);
  color: var(--color-text);
}

.testimonial-author {
  font-weight: 700;
  color: var(--color-primary);
  font-size: 0.95rem;
}

/* Donation amount selector */
.amount-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.amount-option {
  padding: var(--space-md);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  text-align: center;
  cursor: pointer;
  font-weight: 700;
  font-size: 1.1rem;
  transition: all var(--transition-fast);
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
}

.amount-option:hover {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
}

.amount-option.selected {
  border-color: var(--color-primary);
  background: var(--color-primary);
  color: var(--color-text-inverse);
}

/* Event list items */
.event-card {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: var(--space-lg);
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  background: var(--color-bg);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--space-lg);
  transition: transform var(--transition), box-shadow var(--transition);
}

.event-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.event-date-badge {
  background: var(--color-primary);
  color: var(--color-text-inverse);
  border-radius: var(--radius-md);
  text-align: center;
  padding: var(--space-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 70px;
}

.event-date-month {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

.event-date-day {
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1;
}

.event-title {
  font-size: 1.15rem;
  margin-bottom: var(--space-xs);
}

.event-meta {
  font-size: 0.85rem;
  color: var(--color-text-light);
  margin-bottom: var(--space-sm);
}

.event-desc {
  font-size: 0.95rem;
  color: var(--color-text-light);
}


/* ==========================================================
   13. STATS / COUNTERS
   Impact numbers displayed in a row.
   ========================================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-lg);
  text-align: center;
}

.stat-item {
  padding: var(--space-lg);
}

.stat-number {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  color: var(--color-primary);
  line-height: 1.1;
  margin-bottom: var(--space-xs);
}

.stat-label {
  font-size: 0.9rem;
  color: var(--color-text-light);
  font-weight: 500;
}

/* Stats on dark background (hero) */
.stats-grid--dark .stat-number {
  color: var(--color-text-inverse);
}

.stats-grid--dark .stat-label {
  color: rgba(255, 255, 255, 0.8);
}


/* ==========================================================
   14. LOADING SPINNER
   Shown while page modules are being imported.
   ========================================================== */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  gap: var(--space-md);
  color: var(--color-text-light);
  margin-top: var(--header-height);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: var(--radius-full);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}


/* ==========================================================
   15. TOAST NOTIFICATIONS
   Brief feedback messages (e.g., "Form submitted!").
   ========================================================== */
.toast {
  position: fixed;
  bottom: var(--space-xl);
  right: var(--space-md);
  background: var(--color-text);
  color: var(--color-text-inverse);
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-weight: 600;
  z-index: 200;
  animation: slideUp 0.3s ease, fadeOut 0.3s ease 2.7s;
  animation-fill-mode: forwards;
}

.toast--success { background: var(--color-success); }
.toast--error   { background: var(--color-error); }

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

@keyframes fadeOut {
  to { opacity: 0; transform: translateY(-10px); }
}


/* ==========================================================
   16. UTILITY CLASSES
   ========================================================== */
.sr-only {
  /* Visually hidden but accessible to screen readers */
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }

/* Muted text overlay pattern for hero backgrounds */
.hero-pattern {
  position: absolute;
  inset: 0;
  opacity: 0.05;
  background-image:
    radial-gradient(circle at 25% 25%, white 1px, transparent 1px),
    radial-gradient(circle at 75% 75%, white 1px, transparent 1px);
  background-size: 50px 50px;
  pointer-events: none;
}


/* ==========================================================
   17. ANIMATIONS
   Fade-in effect for page content.
   ========================================================== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeInUp 0.5s ease forwards;
}

/* Staggered animation for lists of cards */
.fade-in-delay-1 { animation-delay: 0.1s; opacity: 0; }
.fade-in-delay-2 { animation-delay: 0.2s; opacity: 0; }
.fade-in-delay-3 { animation-delay: 0.3s; opacity: 0; }
.fade-in-delay-4 { animation-delay: 0.4s; opacity: 0; }


/* ==========================================================
   18. MEDIA QUERIES
   Mobile-first → styles here ADD to the base (mobile) styles.
   ========================================================== */

/* --- Tablet (640px+) --- */
@media (min-width: 640px) {
  .grid--2 { grid-template-columns: repeat(2, 1fr); }
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
  .grid--4 { grid-template-columns: repeat(2, 1fr); }

  .stats-grid { grid-template-columns: repeat(4, 1fr); }

  .footer-grid { grid-template-columns: repeat(2, 1fr); }

  .footer-bottom-inner {
    flex-direction: row;
    justify-content: space-between;
  }

  .content-split { grid-template-columns: repeat(2, 1fr); }

  .amount-grid { grid-template-columns: repeat(3, 1fr); }
}

/* --- Desktop (900px+) --- */
@media (min-width: 900px) {
  /* Show horizontal nav, hide hamburger */
  .nav-toggle { display: none; }

  .nav-menu {
    position: static;        /* Back in normal flow */
    width: auto;
    height: auto;
    flex-direction: row;
    padding: 0;
    gap: var(--space-xs);
    box-shadow: none;
    background: transparent;
    overflow: visible;
  }

  .nav-link {
    padding: var(--space-sm) var(--space-md);
    font-size: 0.9rem;
  }

  .nav-link--cta {
    margin-top: 0;
    padding: var(--space-sm) var(--space-lg);
  }

  .grid--3 { grid-template-columns: repeat(3, 1fr); }
  .grid--4 { grid-template-columns: repeat(4, 1fr); }

  .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; }
}

/* --- Large Desktop (1100px+) --- */
@media (min-width: 1100px) {
  .container { padding: 0 var(--space-xl); }

  .hero--home { min-height: 80vh; }
}

/* --- Reduced Motion (accessibility) --- */
/* Respect users who prefer minimal animation */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html { scroll-behavior: auto; }
}
