/* ========================================
   Grant Finder - Professional Nonprofit Grant Database
   ======================================== */

/* Reset & Base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy: #1a1a2e;
  --navy-light: #16213e;
  --navy-mid: #0f3460;
  --teal: #00b4d8;
  --teal-dark: #0096b7;
  --teal-light: #90e0ef;
  --green: #10b981;
  --green-light: #d1fae5;
  --white: #ffffff;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;
  --red: #ef4444;
  --orange: #f59e0b;
  --purple: #8b5cf6;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1);
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --transition: all 0.2s ease;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--gray-800);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--teal-dark); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--navy); }

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

/* Typography */
h1, h2, h3, h4, h5 { color: var(--navy); line-height: 1.3; font-weight: 700; }
h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

/* Container */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.container-narrow { max-width: 800px; margin: 0 auto; padding: 0 24px; }

/* ========================================
   Navigation
   ======================================== */
.navbar {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(10px);
  background: rgba(255,255,255,0.95);
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -0.5px;
}

.navbar-brand svg { width: 32px; height: 32px; }

.navbar-brand span.accent { color: var(--teal); }

.navbar-links {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
}

.navbar-links a {
  padding: 8px 16px;
  color: var(--gray-600);
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: var(--radius);
  transition: var(--transition);
}

.navbar-links a:hover, .navbar-links a.active {
  color: var(--navy);
  background: var(--gray-100);
}

.navbar-cta {
  background: var(--teal) !important;
  color: var(--white) !important;
  font-weight: 600 !important;
}
.navbar-cta:hover {
  background: var(--teal-dark) !important;
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.mobile-menu-btn svg { width: 24px; height: 24px; color: var(--navy); }

/* ========================================
   Hero Section
   ======================================== */
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 50%, var(--navy-light) 100%);
  color: var(--white);
  padding: 80px 0;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(0,180,216,0.15) 0%, transparent 70%);
  border-radius: 50%;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(16,185,129,0.1) 0%, transparent 70%);
  border-radius: 50%;
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 720px;
  margin: 0 auto;
}

.hero h1 {
  font-size: 3.2rem;
  color: var(--white);
  margin-bottom: 20px;
  letter-spacing: -1px;
  line-height: 1.15;
}

.hero h1 .highlight {
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.2rem;
  color: rgba(255,255,255,0.75);
  margin-bottom: 36px;
  line-height: 1.7;
}

/* Search Bar */
.search-bar {
  display: flex;
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 6px;
  box-shadow: var(--shadow-xl);
  max-width: 600px;
  margin: 0 auto 48px;
}

.search-bar input {
  flex: 1;
  border: none;
  padding: 14px 20px;
  font-size: 1rem;
  color: var(--gray-800);
  background: transparent;
  outline: none;
  font-family: inherit;
}

.search-bar input::placeholder { color: var(--gray-400); }

.search-bar button {
  background: var(--teal);
  color: var(--white);
  border: none;
  padding: 14px 28px;
  border-radius: var(--radius-lg);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  white-space: nowrap;
}

.search-bar button:hover { background: var(--teal-dark); }

/* Stats */
.hero-stats {
  display: flex;
  justify-content: center;
  gap: 48px;
}

.hero-stats .stat {
  text-align: center;
}

.hero-stats .stat-value {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--teal-light);
  display: block;
}

.hero-stats .stat-label {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.6);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 500;
}

/* ========================================
   Page Hero (inner pages)
   ======================================== */
.page-hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
  color: var(--white);
  padding: 48px 0;
  text-align: center;
}

.page-hero h1 {
  color: var(--white);
  font-size: 2.4rem;
  margin-bottom: 12px;
}

.page-hero p {
  color: rgba(255,255,255,0.7);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
}

/* ========================================
   Buttons
   ======================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  font-family: inherit;
  text-decoration: none;
}

.btn-primary {
  background: var(--teal);
  color: var(--white);
}
.btn-primary:hover { background: var(--teal-dark); color: var(--white); }

.btn-secondary {
  background: var(--white);
  color: var(--navy);
  border: 1px solid var(--gray-300);
}
.btn-secondary:hover { border-color: var(--gray-400); background: var(--gray-50); }

.btn-outline {
  background: transparent;
  color: var(--teal);
  border: 2px solid var(--teal);
}
.btn-outline:hover { background: var(--teal); color: var(--white); }

.btn-sm { padding: 8px 16px; font-size: 0.85rem; }
.btn-lg { padding: 16px 32px; font-size: 1.05rem; }

/* ========================================
   Cards
   ======================================== */
.card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: var(--transition);
}

.card:hover {
  border-color: var(--gray-300);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

/* Grant Card */
.grant-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.grant-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.grant-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.4;
}

.grant-card-title a { color: var(--navy); }
.grant-card-title a:hover { color: var(--teal); }

.grant-card-amount {
  font-size: 1rem;
  font-weight: 700;
  color: var(--green);
  white-space: nowrap;
  background: var(--green-light);
  padding: 4px 12px;
  border-radius: 20px;
}

.grant-card-funder {
  font-size: 0.9rem;
  color: var(--gray-500);
  font-weight: 500;
}

.grant-card-description {
  font-size: 0.9rem;
  color: var(--gray-600);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.grant-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.grant-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 16px;
  border-top: 1px solid var(--gray-100);
}

/* Tags/Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.badge-category {
  background: #e0f2fe;
  color: #0369a1;
}

.badge-state {
  background: var(--gray-100);
  color: var(--gray-600);
}

.badge-deadline {
  background: #fef3c7;
  color: #92400e;
}

.badge-deadline.urgent {
  background: #fee2e2;
  color: #991b1b;
}

.badge-featured {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #ffffff;
}

.badge-new {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  animation: pulse-new 2s ease-in-out infinite;
}

@keyframes pulse-new {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.8; }
}

/* "NEW" corner ribbon badge on grant cards */
.new-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 3px 10px;
  border-radius: 4px;
  text-transform: uppercase;
  box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
  z-index: 2;
}

.grant-card {
  position: relative;
}

/* Category colors */
.badge-education { background: #dbeafe; color: #1e40af; }
.badge-health { background: #fce7f3; color: #9d174d; }
.badge-arts { background: #ede9fe; color: #6d28d9; }
.badge-environment { background: #d1fae5; color: #065f46; }
.badge-social { background: #ffedd5; color: #9a3412; }
.badge-technology { background: #e0f2fe; color: #0369a1; }
.badge-community { background: #fef3c7; color: #92400e; }
.badge-youth { background: #fce7f3; color: #9d174d; }
.badge-housing { background: #f3e8ff; color: #7c3aed; }
.badge-research { background: #ecfdf5; color: #047857; }

/* ========================================
   Grant Grid
   ======================================== */
.grants-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

/* ========================================
   Filters
   ======================================== */
.filters-section {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
}

.filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}

.filter-group {
  flex: 1;
  min-width: 180px;
}

.filter-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.filter-group select,
.filter-group input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 0.9rem;
  color: var(--gray-800);
  background: var(--white);
  font-family: inherit;
  outline: none;
  transition: var(--transition);
}

.filter-group select:focus,
.filter-group input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(0,180,216,0.1);
}

.filters-actions {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.results-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  color: var(--gray-500);
  font-size: 0.9rem;
}

.results-info strong { color: var(--navy); }

/* Sort dropdown */
.sort-select {
  padding: 8px 12px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 0.85rem;
  color: var(--gray-700);
  background: var(--white);
  font-family: inherit;
  cursor: pointer;
}

/* ========================================
   Section styles
   ======================================== */
.section { padding: 64px 0; }
.section-alt { background: var(--gray-50); }

.section-header {
  text-align: center;
  margin-bottom: 40px;
}

.section-header h2 { margin-bottom: 12px; }

.section-header p {
  color: var(--gray-500);
  font-size: 1.05rem;
  max-width: 600px;
  margin: 0 auto;
}

/* ========================================
   Featured Grants
   ======================================== */
.featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 20px;
}

/* ========================================
   Categories Grid
   ======================================== */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.category-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  transition: var(--transition);
  cursor: pointer;
  text-decoration: none;
}

.category-card:hover {
  border-color: var(--teal);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.category-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.category-card-info h3 {
  font-size: 1rem;
  margin-bottom: 2px;
}

.category-card-info span {
  font-size: 0.85rem;
  color: var(--gray-500);
}

/* ========================================
   States Grid
   ======================================== */
.states-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.state-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  transition: var(--transition);
  text-decoration: none;
  color: var(--gray-800);
}

.state-card:hover {
  border-color: var(--teal);
  background: var(--gray-50);
  color: var(--navy);
}

.state-card .count {
  background: var(--gray-100);
  color: var(--gray-600);
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

/* ========================================
   Grant Detail
   ======================================== */
.grant-detail {
  padding: 48px 0;
}

.grant-detail-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.grant-detail-header {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
  color: var(--white);
  padding: 40px;
}

.grant-detail-header h1 {
  color: var(--white);
  font-size: 2rem;
  margin-bottom: 8px;
}

.grant-detail-header .funder {
  color: var(--teal-light);
  font-size: 1.1rem;
  font-weight: 500;
}

.grant-detail-body { padding: 40px; }

.grant-detail-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 40px;
}

.grant-detail-main h2 {
  font-size: 1.3rem;
  margin: 28px 0 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--gray-100);
}

.grant-detail-main h2:first-child { margin-top: 0; }

.grant-detail-main p {
  color: var(--gray-600);
  line-height: 1.8;
  margin-bottom: 16px;
}

.grant-detail-sidebar .info-box {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 20px;
}

.info-box h3 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gray-500);
  margin-bottom: 8px;
}

.info-box .value {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--navy);
}

.info-box .value.amount { color: var(--green); }

/* ========================================
   Blog
   ======================================== */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
}

.blog-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition);
}

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

.blog-card-image {
  height: 200px;
  background: linear-gradient(135deg, var(--navy-light), var(--navy-mid));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
}

.blog-card-body { padding: 24px; }

.blog-card-body h3 {
  font-size: 1.15rem;
  margin-bottom: 8px;
  line-height: 1.4;
}

.blog-card-body h3 a { color: var(--navy); }
.blog-card-body h3 a:hover { color: var(--teal); }

.blog-card-body p {
  color: var(--gray-500);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 16px;
}

.blog-card-meta {
  font-size: 0.8rem;
  color: var(--gray-400);
}

/* ========================================
   Form styles
   ======================================== */
.form-section { padding: 48px 0; }

.form-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-xl);
  padding: 40px;
  max-width: 720px;
  margin: 0 auto;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 0.95rem;
  color: var(--gray-800);
  font-family: inherit;
  outline: none;
  transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(0,180,216,0.1);
}

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

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-group .hint {
  font-size: 0.8rem;
  color: var(--gray-400);
  margin-top: 4px;
}

/* ========================================
   Footer
   ======================================== */
.footer {
  background: var(--navy);
  color: rgba(255,255,255,0.7);
  padding: 64px 0 32px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-brand {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--white);
  margin-bottom: 12px;
}

.footer-brand .accent { color: var(--teal); }

.footer-desc {
  font-size: 0.9rem;
  line-height: 1.7;
  max-width: 320px;
}

.footer h4 {
  color: var(--white);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 16px;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-links a {
  color: rgba(255,255,255,0.6);
  font-size: 0.9rem;
  transition: var(--transition);
}

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

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
}

/* ========================================
   About page
   ======================================== */
.about-content {
  padding: 48px 0;
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
  margin-bottom: 64px;
}

.about-text h2 { margin-bottom: 16px; }
.about-text p { color: var(--gray-600); line-height: 1.8; margin-bottom: 16px; }

.about-image {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
  border-radius: var(--radius-xl);
  height: 360px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5rem;
}

.values-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.value-card {
  text-align: center;
  padding: 32px 24px;
  background: var(--gray-50);
  border-radius: var(--radius-lg);
}

.value-card .icon {
  font-size: 2.5rem;
  margin-bottom: 16px;
}

.value-card h3 { font-size: 1.1rem; margin-bottom: 8px; }
.value-card p { font-size: 0.9rem; color: var(--gray-500); line-height: 1.6; }

/* ========================================
   Pagination
   ======================================== */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 32px;
}

.pagination button {
  padding: 8px 14px;
  border: 1px solid var(--gray-300);
  background: var(--white);
  border-radius: var(--radius);
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  color: var(--gray-700);
}

.pagination button:hover { border-color: var(--teal); color: var(--teal); }
.pagination button.active { background: var(--teal); color: var(--white); border-color: var(--teal); }
.pagination button:disabled { opacity: 0.5; cursor: not-allowed; }

/* ========================================
   Toast / Notifications
   ======================================== */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--navy);
  color: var(--white);
  padding: 14px 24px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-xl);
  z-index: 9999;
  font-size: 0.9rem;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s ease;
}

.toast.show { transform: translateY(0); opacity: 1; }

/* ========================================
   Loading / Empty states
   ======================================== */
.empty-state {
  text-align: center;
  padding: 64px 24px;
  color: var(--gray-400);
}

.empty-state svg { width: 64px; height: 64px; margin-bottom: 16px; opacity: 0.5; }
.empty-state h3 { color: var(--gray-500); margin-bottom: 8px; }
.empty-state p { font-size: 0.9rem; }

/* ========================================
   Modal
   ======================================== */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.show { opacity: 1; pointer-events: all; }

.modal {
  background: var(--white);
  border-radius: var(--radius-xl);
  max-width: 700px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  padding: 32px;
  transform: translateY(20px);
  transition: transform 0.2s ease;
}

.modal-overlay.show .modal { transform: translateY(0); }

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
}

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--gray-400);
  font-size: 1.5rem;
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 768px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.5rem; }

  .hero { padding: 48px 0; }
  .hero h1 { font-size: 2.2rem; }
  .hero p { font-size: 1rem; }
  .hero-stats { gap: 24px; }
  .hero-stats .stat-value { font-size: 1.6rem; }

  .search-bar { flex-direction: column; }
  .search-bar button { width: 100%; }

  .navbar-links { display: none; }
  .navbar-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    padding: 16px;
    box-shadow: var(--shadow-lg);
  }
  .mobile-menu-btn { display: block; }

  .grants-grid { grid-template-columns: 1fr; }
  .featured-grid { grid-template-columns: 1fr; }
  .categories-grid { grid-template-columns: 1fr 1fr; }
  .states-grid { grid-template-columns: 1fr 1fr; }

  .filters-row { flex-direction: column; }
  .filter-group { min-width: 100%; }

  .grant-detail-grid { grid-template-columns: 1fr; }

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

  .about-grid { grid-template-columns: 1fr; }
  .values-grid { grid-template-columns: 1fr; }

  .form-row { grid-template-columns: 1fr; }

  .blog-grid { grid-template-columns: 1fr; }

  .section { padding: 40px 0; }
}

@media (max-width: 480px) {
  .hero-stats { flex-direction: column; gap: 16px; }
  .categories-grid { grid-template-columns: 1fr; }
  .states-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; gap: 12px; text-align: center; }
}

/* ========================================
   Utility classes
   ======================================== */
.text-center { text-align: center; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mt-48 { margin-top: 48px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.gap-8 { gap: 8px; }
.gap-16 { gap: 16px; }
.hidden { display: none !important; }
