/*
 * NIH Funded-Pattern Map -- Light Editorial styling
 * Tokens copied from CLAUDE.md (canonical design system, March 2026).
 */

:root {
  /* Backgrounds */
  --bg: #f7f5f0;
  --bg-deep: #efede6;
  --bg-card: #ffffff;
  --bg-elevated: #eae8e1;
  --nav-bg: rgba(247, 245, 240, 0.92);
  --footer-bg: #1c1c1a;

  /* Text */
  --text: #1c1c1a;
  --text-hi: rgba(28, 28, 26, 0.90);
  --text-mid: rgba(28, 28, 26, 0.64);
  --text-lo: rgba(28, 28, 26, 0.50);

  /* Accent (amber, used sparingly) */
  --accent: #d47a00;
  --accent-bright: #b86b00;
  --accent-10: rgba(212, 122, 0, 0.08);
  --accent-20: rgba(212, 122, 0, 0.14);

  /* Semantic */
  --green: #16a360;
  --border: rgba(28, 28, 26, 0.10);
  --border-hover: rgba(212, 122, 0, 0.30);

  /* Buttons */
  --btn-bg: var(--text);
  --btn-text: #f7f5f0;
  --btn-hover-bg: #333330;

  /* Radius / spacing */
  --radius: 8px;
  --radius-md: 10px;
  --radius-pill: 100px;
  --section-pad-lg: 120px;
  --section-pad: 88px;
  --section-pad-sm: 64px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: 'Manrope', Arial, sans-serif;
  font-weight: 400;
  font-size: 1.02rem;
  line-height: 1.55;
  color: var(--text-hi);
  background: var(--bg);
}

/* ---- Navigation ---- */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
  font-size: 1.0rem;
}
.nav nav { display: flex; gap: 20px; }
.nav nav a {
  color: var(--text-mid);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
}
.nav nav a:hover { color: var(--accent-bright); }

/* ---- Layout ---- */
main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 64px 24px 88px;
}

section { margin-bottom: 64px; }

/* ---- Typography ---- */
h1 {
  font-size: clamp(2.4rem, 5.5vw, 3.6rem);
  font-weight: 800;
  margin: 0 0 18px;
  color: var(--text);
  line-height: 1.1;
}
h2 {
  font-size: clamp(1.5rem, 3.4vw, 2.1rem);
  font-weight: 700;
  color: var(--text);
  margin: 0 0 18px;
}
h3 {
  font-size: 1.0rem;
  font-weight: 700;
  color: var(--text);
  margin: 18px 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.eyebrow {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.88rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0 0 8px;
}
.lede {
  font-size: 1.2rem;
  color: var(--text);
  font-weight: 500;
  margin: 0 0 24px;
  max-width: 640px;
}
.meta {
  color: var(--text-lo);
  font-size: 0.88rem;
}
.caveat {
  border-left: 3px solid var(--accent);
  padding: 10px 14px;
  background: var(--accent-10);
  color: var(--text-hi);
  font-size: 0.94rem;
  margin-bottom: 18px;
  border-radius: 4px;
}

/* Quieter caveat for section-level disclaimers. No tint, so it doesn't
 * compete with the data it accompanies. */
.caveat-soft {
  border-left: 2px solid var(--border);
  padding: 2px 0 2px 14px;
  color: var(--text-mid);
  font-size: 0.88rem;
  margin: -2px 0 18px;
  max-width: 720px;
}

/* Profile hero summary -- the one-line read the user sees first. */
.hero-summary {
  font-size: 1.15rem;
  color: var(--text-hi);
  font-weight: 400;
  margin: 4px 0 12px;
  max-width: 720px;
  line-height: 1.5;
}
.hero-summary strong {
  color: var(--text);
  font-weight: 700;
}

/* Pattern read -- promote the editorial content above the data tables.
 * Subtle left rail in amber to mark it as the "human read", not data. */
.pattern-read {
  border-left: 3px solid var(--accent);
  padding: 4px 0 4px 22px;
  margin-bottom: 64px;
}
.pattern-read h2 { margin-bottom: 12px; }
.pattern-prose {
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--text);
  max-width: 720px;
  margin: 0 0 18px;
}
.pattern-callouts {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  max-width: 720px;
}
@media (min-width: 720px) {
  .pattern-callouts { grid-template-columns: 1fr 1fr; gap: 28px; }
}
.pattern-callout h3 {
  margin: 0 0 6px;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
}
.pattern-callout ul {
  margin: 0;
  padding-left: 18px;
  list-style: none;
}
.pattern-callout li {
  position: relative;
  margin-bottom: 6px;
  padding-left: 4px;
  color: var(--text-hi);
  font-size: 0.96rem;
  line-height: 1.5;
}
.pattern-callout li::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 0.65em;
  width: 6px;
  height: 1px;
  background: var(--text-lo);
}
.pattern-fits h3 { color: var(--green); }
.pattern-watch h3 { color: var(--accent-bright); }
.pattern-fits li::before { background: var(--green); width: 8px; }
.pattern-watch li::before { background: var(--accent); width: 8px; }

/* ---- Hero ---- */
.hero {
  padding: 24px 0 32px;
  max-width: 720px;
}
.hero-prose {
  color: var(--text-mid);
  max-width: 600px;
}

/* ---- Tag picker + grid ---- */
.tag-picker input[type="search"] {
  width: 100%;
  max-width: 420px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font: inherit;
  background: var(--bg-card);
  margin-bottom: 18px;
}
.tag-grid, .ic-grid {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.tag-grid li a, .ic-grid li a {
  display: block;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  transition: border-color 120ms ease, transform 120ms ease;
}
.tag-grid li a:hover, .ic-grid li a:hover {
  border-color: var(--border-hover);
  transform: translateY(-1px);
}
.tag-name, .ic-code { display: block; font-weight: 600; }
.ic-acronym {
  font-weight: 500;
  color: var(--text-mid);
  font-size: 0.92em;
}
.tag-count, .ic-name {
  display: block;
  color: var(--text-lo);
  font-size: 0.88rem;
  margin-top: 4px;
}

/* ---- Profile pages ---- */
.profile-hero { padding-bottom: 16px; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 18px;
}
.stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.stat-number {
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--text);
}
.stat-label {
  color: var(--text-mid);
  font-size: 0.88rem;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.94rem;
}
.data-table th, .data-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.data-table thead th {
  color: var(--text-mid);
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--text-lo);
}
.status-open { color: var(--green); font-weight: 600; }
.status-expired { color: var(--text-mid); font-weight: 600; }
.status-reauthorization_gap { color: var(--accent-bright); font-weight: 600; }
.status-unknown { color: var(--text-lo); }

.panel-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.panel-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}
.panel-name { font-weight: 600; color: var(--text); }
.panel-count { color: var(--text-lo); font-size: 0.88rem; }
.panel-link {
  margin-left: auto;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.88rem;
}

.draft-banner {
  background: var(--accent-10);
  border: 1px dashed var(--accent);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 0.92rem;
  color: var(--accent-bright);
}

.commentary-body { color: var(--text-hi); }
.commentary-body ul { padding-left: 18px; }
.commentary-body li { margin-bottom: 4px; }

.limitations ul { color: var(--text-mid); padding-left: 20px; }

/* ---- Prose pages ---- */
.prose-page { max-width: 720px; }
.prose-page p, .prose-page li { color: var(--text-hi); }
.prose-page dl dt { font-weight: 700; margin-top: 14px; color: var(--text); }
.prose-page dl dd { margin: 4px 0 12px 0; color: var(--text-mid); }
.ic-code-table { margin-top: 6px; font-size: 0.92rem; }
.ic-code-table th { font-size: 0.78rem; }
.ic-code-table td:first-child { font-weight: 600; color: var(--text); width: 56px; }
.ic-code-table td:nth-child(2) { color: var(--accent); font-weight: 600; width: 80px; }

/* ---- CTA band ---- */
.cta-band {
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 48px 24px;
}
.cta-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.cta-prompt {
  margin: 0;
  font-size: 1.2rem;
  color: var(--text);
  font-weight: 500;
}
.cta-button {
  display: inline-block;
  background: var(--btn-bg);
  color: var(--btn-text);
  padding: 14px 24px;
  border-radius: var(--radius-pill);
  text-decoration: none;
  font-weight: 600;
  transition: background-color 120ms ease, box-shadow 120ms ease;
}
.cta-button:hover {
  background: var(--btn-hover-bg);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.10);
}

/* ---- Footer ---- */
.footer {
  background: var(--footer-bg);
  color: #d6d4cd;
}
.footer-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 32px 24px;
  font-size: 0.88rem;
  color: rgba(247, 245, 240, 0.7);
}
