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

:root {
  --brand: #1a3a5c;
  --brand-light: #2a5a8c;
  --accent: #c4472a;
  --accent-hover: #a33a22;
  --bg: #f5f3ef;
  --bg-card: #ffffff;
  --text: #2c2c2c;
  --text-muted: #6b6b6b;
  --border: #e0ddd8;
  --radius: 8px;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-hover: 0 4px 16px rgba(0,0,0,0.12);
  --max-width: 1200px;
}

html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
}

a { color: var(--brand-light); text-decoration: none; }
a:hover { color: var(--accent); }

/* ===== Header ===== */
.site-header {
  background: var(--brand);
  color: white;
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}
.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.site-logo {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: white;
  white-space: nowrap;
}
.site-logo span { color: #e8c87a; }

nav { display: flex; gap: 8px; flex-wrap: wrap; }
nav a {
  color: rgba(255,255,255,0.85);
  padding: 6px 14px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
}
nav a:hover, nav a.active {
  background: rgba(255,255,255,0.15);
  color: white;
}

/* ===== Hero ===== */
.hero {
  background: linear-gradient(135deg, var(--brand) 0%, #0d2137 100%);
  color: white;
  padding: 60px 24px 48px;
  text-align: center;
}
.hero h1 {
  font-size: 36px;
  font-weight: 800;
  margin-bottom: 12px;
  letter-spacing: -1px;
}
.hero p {
  font-size: 18px;
  opacity: 0.85;
  max-width: 600px;
  margin: 0 auto 24px;
}
.hero-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-top: 32px;
}
.hero-stat {
  text-align: center;
}
.hero-stat .num {
  font-size: 36px;
  font-weight: 800;
  color: #e8c87a;
}
.hero-stat .label {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.7;
}

/* ===== Search Bar ===== */
.search-section {
  max-width: var(--max-width);
  margin: -24px auto 0;
  padding: 0 24px;
  position: relative;
  z-index: 10;
}
.search-bar {
  background: white;
  border-radius: 12px;
  box-shadow: var(--shadow-hover);
  padding: 16px 20px;
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.search-bar input[type="text"] {
  flex: 1;
  min-width: 200px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 15px;
  outline: none;
  transition: border 0.2s;
}
.search-bar input[type="text"]:focus {
  border-color: var(--brand-light);
}
.search-bar select {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 14px;
  background: white;
  cursor: pointer;
  outline: none;
}
.result-count {
  font-size: 13px;
  color: var(--text-muted);
  margin-left: auto;
}

/* ===== Main Content ===== */
.main-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 32px 24px 60px;
}

/* ===== Category Cards (Landing) ===== */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 24px;
}
.category-card {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 28px 24px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: all 0.2s;
  border-left: 4px solid var(--brand);
  position: relative;
}
.category-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}
.category-card .cat-icon {
  font-size: 32px;
  margin-bottom: 12px;
}
.category-card .cat-logo {
  height: 48px;
  max-width: 180px;
  object-fit: contain;
  margin-bottom: 12px;
}
.category-card h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--brand);
}
.category-card .cat-count {
  font-size: 14px;
  color: var(--text-muted);
}
.category-card .cat-desc {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 8px;
  line-height: 1.5;
}

/* Category-specific border colors */
.category-card[data-cat="Strong Heart Study"] { border-left-color: #c4472a; }
.category-card[data-cat="Tobacco & Smoke-Free"] { border-left-color: #d4a017; }
.category-card[data-cat="Environmental Health"] { border-left-color: #2d8a4e; }
.category-card[data-cat="Behavioral Health"] { border-left-color: #7b4dbd; }
.category-card[data-cat="Nutrition & Chronic Disease"] { border-left-color: #e07b2f; }
.category-card[data-cat="COVID-19"] { border-left-color: #2196F3; }
.category-card[data-cat="Community & Cultural"] { border-left-color: #00897B; }
.category-card[data-cat="Genomics & Precision Health"] { border-left-color: #5C6BC0; }
.category-card[data-cat="Maternal & Child Health"] { border-left-color: #EC407A; }
.category-card[data-cat="Education & Workforce"] { border-left-color: #FF7043; }

/* ===== Project List ===== */
.section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.section-header h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--brand);
}
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius);
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}
.back-btn:hover { background: white; color: var(--brand); }


.project-list { display: flex; flex-direction: column; gap: 10px; }
.project-row {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 16px 20px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 16px;
}
.project-row:hover {
  box-shadow: var(--shadow-hover);
  transform: translateX(4px);
}
.project-row .proj-title {
  font-weight: 600;
  font-size: 15px;
  flex: 1;
}
.project-row .proj-meta {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  gap: 16px;
  flex-shrink: 0;
}

/* ===== Project Detail ===== */
.project-detail {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 40px;
  box-shadow: var(--shadow);
  max-width: 800px;
}
.project-detail h1 {
  font-size: 28px;
  font-weight: 800;
  color: var(--brand);
  margin-bottom: 8px;
  line-height: 1.3;
}
.project-meta-bar {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin: 16px 0 24px;
}
.meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  background: var(--bg);
  font-size: 13px;
  color: var(--text-muted);
}
.meta-chip strong { color: var(--text); }
.project-summary {
  font-size: 16px;
  line-height: 1.8;
  margin-bottom: 28px;
  white-space: pre-line;
}
.documents-section h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--brand);
}
.doc-list { list-style: none; }
.doc-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.doc-list li:last-child { border-bottom: none; }
.doc-list a {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
}
.doc-list a::before {
  content: '';
  display: inline-block;
  width: 18px;
  height: 18px;
  background: var(--brand-light);
  border-radius: 4px;
  flex-shrink: 0;
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpath d='M14 2v6h6'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpath d='M14 2v6h6'/%3E%3C/svg%3E");
}

/* ===== Timeline ===== */
.timeline {
  position: relative;
  padding-left: 40px;
  margin-top: 24px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 14px;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--border);
  border-radius: 3px;
}
.timeline-item {
  position: relative;
  margin-bottom: 24px;
  padding: 16px 20px;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: all 0.2s;
}
.timeline-item:hover {
  box-shadow: var(--shadow-hover);
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: -33px;
  top: 20px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--brand);
  border: 3px solid var(--bg);
}

.timeline-year {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 4px;
}
.timeline-title {
  font-size: 15px;
  font-weight: 600;
}
.timeline-cat {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ===== Footer ===== */
.site-footer {
  background: var(--brand);
  color: rgba(255,255,255,0.7);
  text-align: center;
  padding: 32px 24px;
  font-size: 14px;
}
.site-footer strong { color: white; }
.site-footer a { color: #e8c87a; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .header-inner { flex-direction: column; text-align: center; }
  nav { justify-content: center; }
  .hero h1 { font-size: 28px; }
  .hero-stats { flex-wrap: wrap; gap: 20px; }
  .search-bar { flex-direction: column; }
  .category-grid { grid-template-columns: 1fr; }
  .project-row { flex-direction: column; align-items: flex-start; }
  .project-detail { padding: 24px; }
  .project-detail h1 { font-size: 22px; }
  .timeline { padding-left: 32px; }
}
