/* ============================================================
   Antimicrobial Resistance Explained — shared stylesheet
   Static site, no JavaScript required.
   ============================================================ */

:root {
  /* Ink & surfaces */
  --page: #f9f9f7;
  --surface: #fcfcfb;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #898781;
  --hairline: #e1e0d9;
  --border: rgba(11, 11, 11, 0.10);

  /* Accent (blue ramp) */
  --accent: #2a78d6;
  --accent-strong: #1c5cab;
  --accent-deep: #0d366b;
  --accent-deeper: #104281;
  --accent-tint: #cde2fb;
  --accent-wash: #eaf2fc;

  /* Status (used sparingly, always with a label) */
  --critical: #d03b3b;
  --good-text: #006300;

  --radius: 10px;
  --wrap: 68rem;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
}

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ---------- Header & navigation ---------- */

.site-header {
  background: var(--accent-deep);
  color: #fff;
  border-bottom: 4px solid var(--accent);
}

.header-inner { padding: 1rem 1.25rem 0.75rem; }

.brand {
  display: inline-block;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 0.01em;
  margin-bottom: 0.5rem;
}

.brand span { color: #9ec5f4; font-weight: 400; }

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.25rem;
  padding-bottom: 0.5rem;
}

.site-nav a {
  color: #d9e7fa;
  text-decoration: none;
  font-size: 0.9rem;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  white-space: nowrap;
}

.site-nav a:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }

.site-nav a[aria-current="page"] {
  background: #fff;
  color: var(--accent-deep);
  font-weight: 600;
}

/* ---------- Page hero ---------- */

.hero {
  background: var(--surface);
  border-bottom: 1px solid var(--hairline);
  padding: 3rem 0 2.5rem;
}

.hero .eyebrow {
  color: var(--accent-strong);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 0.5rem;
}

.hero h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.9rem, 4.5vw, 2.75rem);
  line-height: 1.15;
  letter-spacing: -0.015em;
}

.hero .lede {
  margin: 0;
  max-width: 46rem;
  font-size: 1.2rem;
  color: var(--ink-2);
}

/* ---------- Main content ---------- */

main { padding: 2.5rem 0 3.5rem; }

main h2 {
  font-size: 1.5rem;
  line-height: 1.25;
  margin: 2.5rem 0 0.75rem;
  letter-spacing: -0.01em;
}

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

main h3 { font-size: 1.15rem; margin: 1.75rem 0 0.5rem; }

main p { margin: 0 0 1rem; max-width: 46rem; }

main ul, main ol { max-width: 44rem; padding-left: 1.4rem; margin: 0 0 1rem; }

main li { margin-bottom: 0.45rem; }

main a { color: var(--accent-strong); }

main a:hover { color: var(--accent-deep); }

blockquote {
  margin: 1.5rem 0;
  padding: 0.75rem 1.25rem;
  border-left: 4px solid var(--accent);
  background: var(--surface);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--ink-2);
  font-style: italic;
  max-width: 44rem;
}

blockquote cite { display: block; margin-top: 0.5rem; font-style: normal; font-size: 0.9rem; color: var(--muted); }

/* ---------- Stat tiles ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 1rem;
  margin: 1.5rem 0 2rem;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem 1rem;
}

.stat .value {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--accent-deeper);
}

.stat .label {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.9rem;
  color: var(--ink-2);
}

/* ---------- Card grid (index) ---------- */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1rem;
  margin: 1.5rem 0 2rem;
}

.card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem 1.3rem;
  text-decoration: none;
  color: inherit;
}

.card:hover { border-color: var(--accent); box-shadow: 0 2px 10px rgba(13, 54, 107, 0.08); }

.card .num {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent-strong);
  background: var(--accent-wash);
  border-radius: 999px;
  padding: 0.1rem 0.6rem;
  margin-bottom: 0.55rem;
  letter-spacing: 0.05em;
}

.card h3 { margin: 0 0 0.4rem; font-size: 1.1rem; color: var(--accent-deep); }

.card p { margin: 0; font-size: 0.92rem; color: var(--ink-2); }

/* ---------- Bar charts (single series, direct-labeled) ---------- */

.figure {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.3rem 1.4rem 1.1rem;
  margin: 1.5rem 0 2rem;
}

.figure figcaption, .figure .fig-title {
  font-weight: 600;
  font-size: 1rem;
  margin: 0 0 0.15rem;
}

.figure .fig-sub {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0 0 1.1rem;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(7.5rem, 12rem) 1fr;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 0.7rem;
}

.bar-row .bar-label { font-size: 0.9rem; color: var(--ink-2); text-align: right; line-height: 1.3; }

.bar-track { display: flex; align-items: center; gap: 0.55rem; }

.bar-fill {
  height: 14px;
  border-radius: 0 4px 4px 0;
  background: var(--accent);
  min-width: 3px;
  width: var(--w, 50%);
}

.bar-fill.forecast {
  background: repeating-linear-gradient(135deg, var(--accent) 0 6px, var(--accent-tint) 6px 9px);
}

.bar-value { font-size: 0.9rem; font-weight: 600; color: var(--ink); white-space: nowrap; }

.fig-note { font-size: 0.82rem; color: var(--muted); margin: 0.9rem 0 0; }

@media (max-width: 540px) {
  .bar-row { grid-template-columns: 1fr; gap: 0.2rem; }
  .bar-row .bar-label { text-align: left; }
}

/* ---------- Tables ---------- */

.table-scroll { overflow-x: auto; margin: 1.5rem 0 2rem; }

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 34rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.95rem;
}

caption {
  caption-side: top;
  text-align: left;
  font-weight: 600;
  padding: 0 0 0.6rem;
}

th, td {
  text-align: left;
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid var(--hairline);
  vertical-align: top;
}

thead th {
  background: var(--accent-wash);
  color: var(--accent-deep);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

tbody tr:last-child td { border-bottom: none; }

td.numcol, th.numcol { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Priority tier styling ---------- */

.tier {
  border-left: 5px solid var(--muted);
  background: var(--surface);
  border-radius: 0 var(--radius) var(--radius) 0;
  border-top: 1px solid var(--border);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 1rem 1.3rem;
  margin: 1rem 0;
  max-width: 46rem;
}

.tier h3 { margin: 0 0 0.5rem; }

.tier p:last-child, .tier ul:last-child { margin-bottom: 0; }

.tier.critical { border-left-color: var(--critical); }
.tier.high { border-left-color: #ec835a; }
.tier.medium { border-left-color: #fab219; }

.tier .tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-radius: 999px;
  padding: 0.1rem 0.6rem;
  margin-bottom: 0.4rem;
  color: #fff;
  background: var(--muted);
}

.tier.critical .tag { background: var(--critical); }
.tier.high .tag { background: #c65a32; }
.tier.medium .tag { background: #8a6100; }

/* ---------- Timeline ---------- */

.timeline {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 2rem;
  border-left: 3px solid var(--accent-tint);
  max-width: 46rem;
}

.timeline li {
  position: relative;
  padding: 0 0 1.4rem 1.5rem;
  margin: 0;
}

.timeline li::before {
  content: "";
  position: absolute;
  left: -8px;
  top: 0.45rem;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--page);
}

.timeline .year {
  font-weight: 700;
  color: var(--accent-deep);
  display: block;
  font-size: 1rem;
}

/* ---------- Callout boxes ---------- */

.callout {
  background: var(--accent-wash);
  border: 1px solid var(--accent-tint);
  border-radius: var(--radius);
  padding: 1rem 1.3rem;
  margin: 1.5rem 0;
  max-width: 46rem;
}

.callout h3, .callout p:first-child { margin-top: 0; }
.callout p:last-child { margin-bottom: 0; }

/* ---------- Do / don't lists ---------- */

.dolist { list-style: none; padding-left: 0; }

.dolist li {
  padding-left: 1.7rem;
  position: relative;
  margin-bottom: 0.55rem;
}

.dolist li::before {
  content: "✓";
  position: absolute;
  left: 0;
  font-weight: 700;
  color: var(--good-text);
}

.dolist.dont li::before { content: "✕"; color: var(--critical); }

/* ---------- Sources ---------- */

.sources {
  margin-top: 3rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--hairline);
}

.sources h2 { font-size: 1.05rem; margin: 0 0 0.6rem; }

.sources ul { font-size: 0.88rem; color: var(--ink-2); }

.sources li { margin-bottom: 0.3rem; overflow-wrap: anywhere; }

/* ---------- Prev / next pagination ---------- */

.pager {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2.5rem;
  flex-wrap: wrap;
}

.pager a {
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.7rem 1.1rem;
  color: var(--accent-deep);
  font-weight: 600;
  font-size: 0.95rem;
}

.pager a:hover { border-color: var(--accent); }

.pager .next { margin-left: auto; }

.pager .dir { display: block; font-size: 0.75rem; font-weight: 400; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }

/* ---------- Footer ---------- */

.site-footer {
  background: var(--accent-deep);
  color: #d9e7fa;
  padding: 2rem 0;
  font-size: 0.88rem;
}

.site-footer p { margin: 0 0 0.5rem; max-width: none; }

.site-footer a { color: #9ec5f4; }
