/* ============================================================
   CE4CSID Community Engagement Toolkit
   Design system: field guide meets public health editorial
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,500;0,9..144,600;0,9..144,700;1,9..144,500&family=Karla:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap');

:root {
  /* Colour system */
  --color-ink: #1B2620;
  --color-ink-soft: #3A483F;
  --color-teal-900: #0E2E2A;
  --color-teal-700: #16423C;
  --color-teal-600: #1F5951;
  --color-teal-500: #2A7268;
  --color-teal-100: #E4EEEA;
  --color-terracotta-700: #A5502B;
  --color-terracotta-600: #C1673B;
  --color-terracotta-500: #D8834F;
  --color-terracotta-100: #F6E3D4;
  --color-sand-50: #FBF8F1;
  --color-sand-100: #F6F1E7;
  --color-sand-200: #EEE6D6;
  --color-line: #DCD2BC;
  --color-white: #FFFFFF;

  /* Type */
  --font-display: 'Fraunces', 'Georgia', serif;
  --font-body: 'Karla', 'Helvetica Neue', Arial, sans-serif;

  /* Rhythm */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 22px;
  --shadow-card: 0 1px 2px rgba(27, 38, 32, 0.06), 0 8px 24px rgba(27, 38, 32, 0.07);
  --shadow-lift: 0 18px 40px rgba(14, 46, 42, 0.18);
  --max-width: 1180px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--color-ink);
  background: var(--color-sand-100);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { padding: 0; margin: 0; list-style: none; }
h1, h2, h3, h4, p, figure { margin: 0; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; font-size: 1rem; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--color-teal-900);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.15;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 28px;
}

/* Skip link */
.skip-link {
  position: absolute;
  left: -999px;
  top: auto;
  background: var(--color-teal-900);
  color: var(--color-white);
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  z-index: 999;
}
.skip-link:focus {
  left: 20px;
  top: 20px;
}

/* ---------- Topographic texture ---------- */
.texture-topo {
  background-image:
    repeating-radial-gradient(circle at 15% 20%, rgba(255,255,255,0.05) 0, rgba(255,255,255,0.05) 1px, transparent 1px, transparent 34px),
    repeating-radial-gradient(circle at 85% 75%, rgba(255,255,255,0.04) 0, rgba(255,255,255,0.04) 1px, transparent 1px, transparent 46px);
}

/* ============================================================
   Header / Navigation
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-sand-100);
  border-bottom: 1px solid var(--color-line);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  padding-bottom: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-mark { width: 40px; height: 40px; flex-shrink: 0; }
.brand-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--color-teal-900);
  line-height: 1.1;
}
.brand-text span {
  display: block;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-terracotta-700);
  margin-top: 3px;
}

.nav-toggle {
  display: none;
  background: none;
  border: 1.5px solid var(--color-teal-700);
  border-radius: var(--radius-sm);
  width: 44px;
  height: 40px;
  align-items: center;
  justify-content: center;
  position: relative;
}
.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  display: block;
  width: 20px;
  height: 2px;
  background: var(--color-teal-900);
  position: relative;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle span::before { position: absolute; top: -6px; }
.nav-toggle span::after { position: absolute; top: 6px; }
.nav-toggle[aria-expanded="true"] span { background: transparent; }
.nav-toggle[aria-expanded="true"] span::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span::after { transform: translateY(-6px) rotate(-45deg); }

.primary-nav ul {
  display: flex;
  align-items: center;
  gap: 6px;
}
.primary-nav a {
  display: inline-block;
  padding: 9px 16px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.94rem;
  color: var(--color-ink-soft);
  transition: background 0.15s ease, color 0.15s ease;
}
.primary-nav a:hover { background: var(--color-teal-100); color: var(--color-teal-900); }
.primary-nav a.is-active { background: var(--color-teal-700); color: var(--color-white); }
.primary-nav a.nav-cta {
  background: var(--color-terracotta-600);
  color: var(--color-white);
}
.primary-nav a.nav-cta:hover { background: var(--color-terracotta-700); }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 24px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.98rem;
  border: 1.5px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.btn-primary {
  background: var(--color-terracotta-600);
  color: var(--color-white);
  box-shadow: var(--shadow-card);
}
.btn-primary:hover { background: var(--color-terracotta-700); transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.btn-secondary {
  background: transparent;
  border-color: var(--color-teal-700);
  color: var(--color-teal-900);
}
.btn-secondary:hover { background: var(--color-teal-700); color: var(--color-white); transform: translateY(-2px); }
.btn-ghost {
  background: var(--color-white);
  color: var(--color-teal-900);
  border-color: var(--color-line);
}
.btn-ghost:hover { border-color: var(--color-teal-700); }
.btn-sm { padding: 9px 16px; font-size: 0.85rem; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none !important; }

/* ============================================================
   Hero
   ============================================================ */
.hero {
  position: relative;
  background: radial-gradient(ellipse at top left, var(--color-teal-600) 0%, var(--color-teal-900) 62%);
  color: var(--color-sand-50);
  overflow: hidden;
  padding: 84px 0 96px;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 88% 18%, rgba(216,131,79,0.28) 0%, transparent 42%),
    radial-gradient(circle at 8% 92%, rgba(42,114,104,0.4) 0%, transparent 45%);
  pointer-events: none;
}
.hero .container { position: relative; z-index: 1; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-terracotta-500);
  margin-bottom: 22px;
}
.eyebrow::before {
  content: "";
  width: 26px;
  height: 2px;
  background: var(--color-terracotta-500);
}
.hero h1 {
  color: var(--color-white);
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  max-width: 15ch;
  margin-bottom: 26px;
}
.hero h1 em {
  font-style: italic;
  color: var(--color-terracotta-500);
}
.hero-lede {
  font-size: 1.15rem;
  color: rgba(251, 248, 241, 0.86);
  max-width: 58ch;
  margin-bottom: 38px;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 16px; }
.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 24px;
  margin-top: 64px;
  padding-top: 36px;
  border-top: 1px solid rgba(251,248,241,0.18);
  max-width: 780px;
}
.hero-stats .stat-num {
  font-family: var(--font-display);
  font-size: 2.1rem;
  color: var(--color-white);
  display: block;
}
.hero-stats .stat-label {
  font-size: 0.86rem;
  color: rgba(251,248,241,0.72);
}

/* ============================================================
   Sections
   ============================================================ */
section { padding: 88px 0; }
.section-tight { padding: 56px 0; }
.section-alt { background: var(--color-white); }
.section-teal {
  background: var(--color-teal-900);
  color: var(--color-sand-50);
}
.section-teal h2, .section-teal h3 { color: var(--color-white); }

.section-head {
  max-width: 62ch;
  margin-bottom: 48px;
}
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); margin-bottom: 14px; }
.section-head p { color: var(--color-ink-soft); font-size: 1.06rem; }

.pill-tag {
  display: inline-block;
  padding: 5px 13px;
  border-radius: 999px;
  background: var(--color-terracotta-100);
  color: var(--color-terracotta-700);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

/* ============================================================
   Cards & grids
   ============================================================ */
.grid { display: grid; gap: 26px; }
.grid-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }

.card {
  background: var(--color-white);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
  padding: 30px;
  box-shadow: var(--shadow-card);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); border-color: var(--color-teal-500); }
.card .card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--color-teal-100);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  color: var(--color-teal-700);
}
.card h3 { font-size: 1.2rem; margin-bottom: 10px; }
.card p { color: var(--color-ink-soft); font-size: 0.97rem; }

.value-card { border-left: 4px solid var(--color-terracotta-600); }

/* Resource / download listing */
.resource-group { margin-bottom: 60px; }
.resource-group-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 2px solid var(--color-teal-900);
  padding-bottom: 14px;
  margin-bottom: 26px;
}
.resource-group-head h3 { font-size: 1.5rem; }
.resource-group-head .count {
  font-size: 0.85rem;
  color: var(--color-ink-soft);
  font-weight: 600;
}
.resource-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 20px;
  padding: 20px;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  background: var(--color-white);
  margin-bottom: 14px;
}
.resource-item .file-badge {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-sm);
  background: var(--color-teal-100);
  color: var(--color-teal-700);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.03em;
}
.resource-item h4 { font-size: 1.05rem; margin-bottom: 4px; color: var(--color-teal-900); }
.resource-item p { color: var(--color-ink-soft); font-size: 0.92rem; }
.resource-meta { font-size: 0.78rem; color: var(--color-ink-soft); margin-top: 6px; display: flex; gap: 12px; }

/* ============================================================
   Checklist tool
   ============================================================ */
.checklist-shell {
  background: var(--color-white);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.checklist-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  padding: 26px 30px;
  background: var(--color-teal-900);
  color: var(--color-white);
}
.progress-block { flex: 1; min-width: 240px; }
.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  margin-bottom: 8px;
  color: rgba(251,248,241,0.85);
}
.progress-label strong { color: var(--color-white); font-family: var(--font-display); font-size: 1.05rem; }
.progress-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(251,248,241,0.18);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--color-terracotta-500), var(--color-terracotta-600));
  border-radius: 999px;
  transition: width 0.35s ease;
}
.checklist-toolbar-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.checklist-stage { border-bottom: 1px solid var(--color-line); }
.checklist-stage:last-child { border-bottom: none; }
.stage-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 30px;
  cursor: pointer;
  background: var(--color-sand-50);
}
.stage-head:hover { background: var(--color-teal-100); }
.stage-head h3 {
  font-size: 1.12rem;
  display: flex;
  align-items: center;
  gap: 12px;
}
.stage-number {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--color-teal-700);
  color: var(--color-white);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.stage-progress { font-size: 0.82rem; color: var(--color-ink-soft); font-weight: 600; white-space: nowrap; }
.stage-caret { transition: transform 0.2s ease; color: var(--color-teal-700); }
.checklist-stage.is-open .stage-caret { transform: rotate(180deg); }

.stage-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.28s ease;
  padding: 0 30px;
}
.checklist-stage.is-open .stage-body { padding: 6px 30px 28px; }

.check-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 0;
  border-top: 1px dashed var(--color-line);
}
.check-item:first-child { border-top: none; }
.check-item input[type="checkbox"] {
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 2px solid var(--color-teal-600);
  flex-shrink: 0;
  margin-top: 2px;
  position: relative;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.check-item input[type="checkbox"]:checked {
  background: var(--color-teal-700);
  border-color: var(--color-teal-700);
}
.check-item input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 2px;
  width: 6px;
  height: 11px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(40deg);
}
.check-item-body { flex: 1; }
.check-item label { font-weight: 600; cursor: pointer; display: block; margin-bottom: 4px; }
.check-item .item-desc { font-size: 0.88rem; color: var(--color-ink-soft); margin-bottom: 10px; }
.check-item.is-checked label { color: var(--color-teal-700); }
.check-item.is-checked .item-desc { opacity: 0.7; }
.note-field {
  width: 100%;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 0.88rem;
  background: var(--color-sand-50);
  resize: vertical;
  min-height: 44px;
}
.note-field:focus { outline: 2px solid var(--color-teal-500); outline-offset: 1px; }

.checklist-footer {
  padding: 22px 30px;
  background: var(--color-sand-50);
  font-size: 0.85rem;
  color: var(--color-ink-soft);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

/* ============================================================
   Forms
   ============================================================ */
.form-grid { display: grid; gap: 20px; }
.form-field label {
  display: block;
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 8px;
  color: var(--color-teal-900);
}
.form-field input,
.form-field textarea,
.form-field select {
  width: 100%;
  padding: 13px 14px;
  border: 1.5px solid var(--color-line);
  border-radius: var(--radius-sm);
  background: var(--color-white);
}
.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
  outline: none;
  border-color: var(--color-teal-500);
  box-shadow: 0 0 0 3px var(--color-teal-100);
}
.form-note { font-size: 0.82rem; color: var(--color-ink-soft); margin-top: 8px; }

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  background: var(--color-teal-900);
  color: rgba(251,248,241,0.82);
  padding: 64px 0 32px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(251,248,241,0.14);
}
.footer-brand .brand-text { color: var(--color-white); }
.footer-brand p { margin-top: 16px; font-size: 0.92rem; max-width: 42ch; color: rgba(251,248,241,0.68); }
.footer-col h4 {
  color: var(--color-white);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: var(--font-body);
  margin-bottom: 16px;
}
.footer-col ul li { margin-bottom: 10px; }
.footer-col a { font-size: 0.92rem; color: rgba(251,248,241,0.78); }
.footer-col a:hover { color: var(--color-terracotta-500); }
.footer-bottom {
  padding-top: 26px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.82rem;
  color: rgba(251,248,241,0.55);
}

/* ============================================================
   Misc components
   ============================================================ */
.breadcrumb {
  font-size: 0.85rem;
  color: rgba(251,248,241,0.75);
  margin-bottom: 18px;
}
.breadcrumb a { color: rgba(251,248,241,0.75); }
.breadcrumb a:hover { color: var(--color-white); }

.callout {
  border: 1.5px dashed var(--color-terracotta-500);
  background: var(--color-terracotta-100);
  border-radius: var(--radius-md);
  padding: 22px 26px;
  color: var(--color-terracotta-700);
  font-size: 0.94rem;
}
.callout strong { color: var(--color-terracotta-700); }

.divider-line {
  height: 1px;
  background: var(--color-line);
  margin: 56px 0;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: start;
}

.numbered-steps { counter-reset: step; }
.numbered-steps li {
  counter-increment: step;
  display: flex;
  gap: 18px;
  padding: 20px 0;
  border-top: 1px solid var(--color-line);
}
.numbered-steps li:first-child { border-top: none; }
.numbered-steps li::before {
  content: counter(step);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--color-terracotta-600);
  width: 36px;
  height: 36px;
  border: 1.5px solid var(--color-terracotta-500);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.numbered-steps h4 { font-size: 1.02rem; margin-bottom: 4px; }
.numbered-steps p { color: var(--color-ink-soft); font-size: 0.92rem; }

.toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--color-teal-900);
  color: var(--color-white);
  padding: 14px 24px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: var(--shadow-lift);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 500;
}
.toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 900px) {
  .grid-3 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .two-col { grid-template-columns: 1fr; gap: 36px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  .nav-toggle { display: inline-flex; }
  .primary-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-sand-100);
    border-bottom: 1px solid var(--color-line);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
  }
  .primary-nav.is-open { max-height: 420px; }
  .primary-nav ul { flex-direction: column; align-items: stretch; padding: 10px 28px 24px; gap: 4px; }
  .primary-nav a { width: 100%; text-align: left; }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .hero-stats { grid-template-columns: 1fr; gap: 18px; }
  section { padding: 60px 0; }
  .hero { padding: 56px 0 64px; }
  .resource-item { grid-template-columns: auto 1fr; }
  .resource-item .btn { grid-column: 1 / -1; justify-self: start; margin-top: 6px; }
  .footer-grid { grid-template-columns: 1fr; }
  .checklist-toolbar { flex-direction: column; align-items: stretch; }
}

/* ============================================================
   Print styles (checklist export)
   ============================================================ */
@media print {
  .site-header, .site-footer, .checklist-toolbar-actions, .nav-toggle,
  .hero-actions, .no-print, .stage-caret, .toast { display: none !important; }
  body { background: white; }
  .checklist-shell { box-shadow: none; border: none; }
  .stage-body { max-height: none !important; padding: 6px 0 20px !important; }
  .stage-head { background: none; cursor: default; padding: 14px 0; }
  .checklist-toolbar { background: none; color: var(--color-ink); padding: 0 0 20px; border-bottom: 2px solid var(--color-ink); }
  .progress-label, .progress-label strong { color: var(--color-ink); }
  .container { padding: 0; max-width: 100%; }
  .check-item { break-inside: avoid; }
  a[href]::after { content: ""; }
}
