/* ============================================
   PUBLIC HEALTH AI — Stylesheet v2
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

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

html { font-size: 18px; scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: #1a1a2e;
  background-color: #f8f9fc;
  line-height: 1.7;
}

:root {
  --primary:    #1a4f6e;
  --secondary:  #2e8b7a;
  --accent:     #e07b39;
  --light:      #f8f9fc;
  --white:      #ffffff;
  --text:       #1a1a2e;
  --text-muted: #5a5a7a;
  --border:     #dde2ec;
  --step-bg:    #eaf4f1;
}

/* --- Typography --- */
h1, h2, h3, h4 { font-weight: 700; line-height: 1.25; color: var(--primary); }
h1 { font-size: 2.4rem; }
h2 { font-size: 1.8rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.05rem; }
p  { margin-bottom: 1rem; }
a  { color: var(--secondary); text-decoration: underline; }
a:hover { color: var(--primary); }

/* --- Skip link (keyboard & screen reader users) --- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--white);
  font-weight: 600;
  padding: 0.6rem 1.2rem;
  border-radius: 0 0 6px 0;
  text-decoration: none;
  z-index: 500;
}
.skip-link:focus { left: 0; }

/* --- Layout --- */
.container       { max-width: 960px;  margin: 0 auto; padding: 0 1.5rem; }
.container--wide { max-width: 1140px; margin: 0 auto; padding: 0 1.5rem; }
section { padding: 4rem 0; }
section:nth-child(even) { background-color: var(--white); }

/* ============================================
   NAVIGATION (with dropdowns)
   ============================================ */
.site-nav {
  background-color: var(--primary);
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 1.5rem;
  max-width: 1140px;
  margin: 0 auto;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.nav-logo {
  color: var(--white);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.05rem;
  white-space: nowrap;
}
.nav-logo span { color: #7dd3c0; }

.nav-menu { display: flex; list-style: none; gap: 0.1rem; flex-wrap: wrap; }

.nav-menu > li { position: relative; }

.nav-menu > li > a,
.nav-menu > li > button {
  color: rgba(255,255,255,0.88);
  text-decoration: none;
  font-size: 0.88rem;
  padding: 0.45rem 0.7rem;
  border-radius: 4px;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.nav-menu > li > a:hover,
.nav-menu > li > button:hover,
.nav-menu > li > a.active,
.nav-menu > li > button.active {
  background-color: rgba(255,255,255,0.15);
  color: var(--white);
}

.dropdown-arrow { font-size: 0.65rem; opacity: 0.75; }

/* Dropdown panel */
.dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  min-width: 220px;
  z-index: 300;
  padding: 0.5rem 0;
}

.nav-menu > li:hover .dropdown,
.nav-menu > li.open .dropdown {
  display: block;
}

.dropdown a {
  display: block;
  padding: 0.55rem 1.1rem;
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
  transition: background 0.1s;
}

.dropdown a:hover { background-color: var(--step-bg); color: var(--primary); }

.dropdown-section {
  padding: 0.3rem 1.1rem 0.1rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 0.4rem;
}

.dropdown hr { border: none; border-top: 1px solid var(--border); margin: 0.4rem 0; }

/* Mobile toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
}

/* ============================================
   HERO
   ============================================ */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, #0d3550 60%, #1a4f6e 100%);
  color: var(--white);
  padding: 5rem 0 4rem;
  text-align: center;
}

.hero h1 { color: var(--white); font-size: 2.8rem; max-width: 800px; margin: 0 auto 1.25rem; }
.hero .subtitle { font-size: 1.15rem; color: rgba(255,255,255,0.85); max-width: 850px; margin: 0 auto 2rem; }

.hero-badge {
  display: inline-block;
  background-color: rgba(125,211,192,0.2);
  border: 1px solid rgba(125,211,192,0.4);
  color: #7dd3c0;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.3rem 0.9rem;
  border-radius: 20px;
  margin-bottom: 1.5rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-block;
  padding: 0.8rem 1.85rem;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
  cursor: pointer;
  border: none;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,0.18); }

.btn-primary  { background-color: var(--accent);   color: var(--white); }
.btn-primary:hover  { background-color: #c96e2e; color: var(--white); }
.btn-secondary { background: transparent; color: var(--white); border: 2px solid rgba(255,255,255,0.6); }
.btn-secondary:hover { background: rgba(255,255,255,0.1); color: var(--white); }
.btn-outline { background: transparent; color: var(--primary); border: 2px solid var(--primary); }
.btn-outline:hover { background: var(--primary); color: var(--white); }
.btn-green { background-color: var(--secondary); color: var(--white); }
.btn-green:hover { background-color: #236b5c; color: var(--white); }

.btn-group { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; margin-top: 2rem; }

/* ============================================
   CARDS & GRIDS
   ============================================ */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.75rem; }

.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem;
  transition: box-shadow 0.2s, transform 0.2s;
}
.card:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.08); transform: translateY(-2px); }

.card-icon { font-size: 2rem; margin-bottom: 0.4rem; }
.card h3   { margin-bottom: 0.25rem; }
.card p    { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 0; }

/* Use case cards */
.usecase-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; }
.usecase-card {
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 1.75rem;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.usecase-card:hover { border-color: var(--secondary); box-shadow: 0 4px 20px rgba(46,139,122,0.1); color: inherit; }
.usecase-card .icon { font-size: 2.25rem; margin-bottom: 0.75rem; }
.usecase-card h3 { margin-bottom: 0.4rem; }
.usecase-card p  { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 0; }

/* Step cards */
.steps-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.75rem; }
.step-card { background: var(--step-bg); border: 1px solid #c8e8e2; border-radius: 10px; padding: 1.75rem; }
.step-number {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.5rem; height: 2.5rem;
  background: var(--secondary); color: white;
  font-weight: 700; font-size: 1.1rem; border-radius: 50%; margin-bottom: 1rem;
}

/* Timeline */
.timeline {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  padding: 3rem 0 2rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 1.5rem;
  height: 2px;
  background: linear-gradient(90deg, var(--secondary) 0%, var(--secondary) 85%, transparent 100%);
  z-index: 1;
}

.timeline-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.timeline-marker {
  display: inline-flex; align-items: center; justify-content: center;
  width: 3rem; height: 3rem;
  background: var(--secondary); color: white;
  font-weight: 700; font-size: 1.3rem; border-radius: 50%;
  position: relative;
  z-index: 10;
  flex-shrink: 0;
  box-shadow: 0 0 0 4px var(--white), 0 0 0 6px var(--secondary);
  margin-bottom: 1.5rem;
}

.timeline-content {
  background: var(--step-bg);
  border: 1px solid #c8e8e2;
  border-radius: 10px;
  padding: 1.75rem;
  text-align: center;
  flex-grow: 1;
}

.timeline-content h3 {
  margin-bottom: 0.5rem;
}

.timeline-content p {
  color: var(--text-muted);
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

/* Platform cards */
.platform-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.75rem; }
.platform-card {
  background: var(--white); border: 2px solid var(--border);
  border-radius: 10px; padding: 2rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.platform-card.recommended { border-color: var(--secondary); }
.platform-card:hover { border-color: var(--secondary); box-shadow: 0 4px 16px rgba(46,139,122,0.1); }
.platform-badge {
  display: inline-block; background: var(--secondary); color: white;
  font-size: 0.72rem; font-weight: 700; padding: 0.2rem 0.7rem;
  border-radius: 20px; margin-bottom: 0.75rem;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.platform-logo { font-size: 2.25rem; margin-bottom: 0.5rem; }
.platform-card h3 { margin-bottom: 0.25rem; }
.platform-card .maker { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.75rem; }
.platform-card p { font-size: 0.9rem; color: var(--text-muted); }

/* ============================================
   SECTION HEADERS
   ============================================ */
.section-label {
  text-transform: uppercase; font-size: 0.78rem; font-weight: 700;
  letter-spacing: 0.1em; color: var(--secondary); margin-bottom: 0.4rem;
}
.section-intro { text-align: center; max-width: 640px; margin: 0 auto 2.5rem; }
.section-intro h2 { margin-bottom: 0.6rem; }
.section-intro p  { color: var(--text-muted); }

/* Page header (inner pages) */
.page-header {
  background: linear-gradient(135deg, var(--primary), #0d3550);
  color: white; padding: 3.25rem 0;
}
.page-header .section-label { color: #7dd3c0; }
.page-header h1 { color: white; margin-bottom: 0.6rem; }
.page-header p  { color: rgba(255,255,255,0.85); max-width: 820px; margin-bottom: 0; }

/* ============================================
   SETUP / STEP PAGES
   ============================================ */
.setup-step { padding: 2.5rem 0; border-bottom: 1px solid var(--border); }
.setup-step:last-of-type { border-bottom: none; }

.step-header { display: flex; align-items: flex-start; gap: 1.25rem; margin-bottom: 1rem; }
.step-num {
  flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
  width: 2.75rem; height: 2.75rem;
  background: var(--primary); color: white;
  font-weight: 700; font-size: 1.1rem; border-radius: 50%;
}
.step-body h3 { margin-bottom: 0.4rem; }
.step-body p  { color: var(--text-muted); }

.tip-box {
  background: #eaf4f1; border-left: 4px solid var(--secondary);
  padding: 1rem 1.25rem; border-radius: 0 6px 6px 0;
  margin: 1rem 0; font-size: 0.93rem;
}
.tip-box strong { color: var(--secondary); }

.warning-box {
  background: #fff7ed; border-left: 4px solid var(--accent);
  padding: 1rem 1.25rem; border-radius: 0 6px 6px 0;
  margin: 1rem 0; font-size: 0.93rem;
}
.warning-box strong { color: var(--accent); }

.info-box {
  background: #eef4fb; border-left: 4px solid var(--primary);
  padding: 1rem 1.25rem; border-radius: 0 6px 6px 0;
  margin: 1rem 0; font-size: 0.93rem;
}
.info-box strong { color: var(--primary); }

/* Optimisation section */
.optimise-section {
  background: linear-gradient(135deg, #0d3550, var(--primary));
  color: white; border-radius: 12px; padding: 2.5rem; margin: 3rem 0;
}
.optimise-section h2 { color: white; margin-bottom: 0.5rem; }
.optimise-section > p { color: rgba(255,255,255,0.85); margin-bottom: 1.75rem; }

.opt-file {
  background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px; padding: 1.25rem; margin-bottom: 1rem;
}
.opt-file h4 { color: #7dd3c0; margin-bottom: 0.3rem; font-family: monospace; font-size: 1rem; }
.opt-file p  { color: rgba(255,255,255,0.8); font-size: 0.9rem; margin-bottom: 0; }

/* ============================================
   REPOSITORY PAGE
   ============================================ */
.repo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.5rem; }

.repo-card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: 10px; padding: 1.5rem;
  transition: box-shadow 0.2s;
}
.repo-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); }

.repo-tag {
  display: inline-block; font-size: 0.75rem; font-weight: 600;
  padding: 0.2rem 0.65rem; border-radius: 20px; margin-bottom: 0.75rem;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.tag-skill    { background: #e6f4f1; color: var(--secondary); }
.tag-template { background: #fff0e6; color: var(--accent); }
.tag-tool     { background: #e8eef6; color: var(--primary); }
.tag-dataset  { background: #f0e8f6; color: #6b3fa0; }

.repo-card h3 { font-size: 1.05rem; margin-bottom: 0.3rem; }
.repo-card .repo-meta { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.6rem; }
.repo-card p  { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 1rem; }

.repo-filter { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 2rem; }
.filter-btn {
  padding: 0.4rem 1rem; border-radius: 20px; border: 1px solid var(--border);
  background: var(--white); font-size: 0.85rem; cursor: pointer;
  transition: background 0.15s, border-color 0.15s; font-family: inherit;
}
.filter-btn:hover, .filter-btn.active { background: var(--primary); color: white; border-color: var(--primary); }

/* ============================================
   COMPARISON TABLE
   ============================================ */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 2rem 0; }
.table-scroll .compare-table { margin: 0; min-width: 720px; }
.compare-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; margin: 2rem 0; }
.compare-table th { background: var(--primary); color: white; padding: 0.85rem 1rem; text-align: left; font-weight: 600; }
.compare-table td { padding: 0.8rem 1rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.compare-table tr:nth-child(even) td { background: var(--light); }

/* ============================================
   FAQ
   ============================================ */
.faq-item { border-bottom: 1px solid var(--border); padding: 1.4rem 0; }
.faq-item:last-child { border-bottom: none; }
.faq-q { font-weight: 600; color: var(--primary); font-size: 1.02rem; margin-bottom: 0.4rem; }
.faq-a { color: var(--text-muted); font-size: 0.93rem; margin-bottom: 0; }

/* ============================================
   PAGE NAV (prev / next)
   ============================================ */
.page-nav {
  display: flex; justify-content: space-between; align-items: center;
  padding: 2rem 0; border-top: 1px solid var(--border); gap: 1rem; flex-wrap: wrap;
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer { background: var(--primary); color: rgba(255,255,255,0.75); text-align: center; padding: 2.5rem 1.5rem; font-size: 0.88rem; }
.site-footer a { color: rgba(255,255,255,0.9); }
.footer-links { display: flex; justify-content: center; gap: 1.25rem; flex-wrap: wrap; list-style: none; margin-bottom: 1rem; }
.footer-links a { text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }

/* ============================================
   UTILITY
   ============================================ */
.text-center { text-align: center; }
.text-muted  { color: var(--text-muted); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-0 { margin-bottom: 0; }
.inline-code {
  font-family: monospace; background: rgba(0,0,0,0.07);
  padding: 0.1rem 0.4rem; border-radius: 3px; font-size: 0.9em;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 720px) {
  html { font-size: 16px; }
  h1 { font-size: 1.9rem; }
  .hero h1 { font-size: 1.9rem; }

  .nav-menu { display: none; flex-direction: column; width: 100%; }
  .nav-menu.open { display: flex; padding-bottom: 0.75rem; }
  .nav-menu > li { width: 100%; }
  .nav-menu > li > a, .nav-menu > li > button { width: 100%; justify-content: space-between; }
  .dropdown { position: static; box-shadow: none; border: none; border-radius: 0; background: rgba(0,0,0,0.15); }
  .dropdown a { color: rgba(255,255,255,0.88); padding-left: 2rem; }
  .dropdown a:hover { background: rgba(255,255,255,0.1); color: white; }
  .dropdown-section { color: rgba(255,255,255,0.5); }
  .dropdown hr { border-color: rgba(255,255,255,0.15); }
  .nav-toggle { display: block; }

  .page-nav { flex-direction: column; }
  .cards-grid, .usecase-grid, .steps-grid, .platform-grid { grid-template-columns: 1fr; }

  .timeline {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 0;
  }

  .timeline::before {
    display: none;
  }

  .timeline-item {
    align-items: flex-start;
    flex-direction: row;
    gap: 1.5rem;
  }

  .timeline-marker {
    margin-bottom: 0;
    flex-shrink: 0;
  }

  .timeline-content {
    text-align: left;
  }
}
