/* === DataDrivenMed — Academic Publication Stylesheet === */

@import url('https://fonts.googleapis.com/css2?family=Crimson+Pro:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400;1,500&family=Libre+Franklin:ital,wght@0,400;0,500;0,600;0,700;1,400&family=JetBrains+Mono:wght@400&display=swap');

:root {
  --serif: 'Crimson Pro', 'Georgia', 'Times New Roman', serif;
  --sans: 'Libre Franklin', 'Helvetica Neue', 'Arial', sans-serif;
  --mono: 'JetBrains Mono', 'Courier New', monospace;

  --ink: #111827;
  --body: #1f2937;
  --secondary: #4b5563;
  --muted: #6b7280;
  --rule: #d1d5db;
  --rule-light: #e5e7eb;
  --surface: #ffffff;
  --bg: #fafaf8;
  --accent: #1a4f6e;
  --accent-hover: #0f3a52;
  --red: #991b1b;
  --callout-bg: #f8f7f4;
  --callout-border: #c9c5b8;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

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

body {
  font-family: var(--serif);
  font-size: 1rem;
  line-height: 1.78;
  color: var(--body);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* === SITE MASTHEAD === */
.masthead {
  border-bottom: 3px solid var(--ink);
  background: var(--surface);
  padding: 0;
}
.masthead-inner {
  max-width: 780px;
  margin: 0 auto;
  padding: 28px 24px 20px;
}
.masthead-title {
  font-family: var(--serif);
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1.2;
  text-decoration: none;
  display: block;
}
.masthead-title:hover { color: var(--accent); }
.masthead-tagline {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 4px;
}
.masthead-rule {
  border: none;
  border-top: 1px solid var(--rule);
  margin-top: 16px;
}

/* === ARTICLE LIST (INDEX) === */
.index-body { max-width: 780px; margin: 0 auto; padding: 48px 24px 80px; }
.index-section-label {
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  padding-bottom: 12px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 32px;
}
.article-entry { margin-bottom: 40px; }
.article-entry-date {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.article-entry-title {
  font-family: var(--serif);
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.3;
  margin: 6px 0 8px;
}
.article-entry-title a {
  color: var(--ink);
  text-decoration: none;
  transition: color 0.15s;
}
.article-entry-title a:hover { color: var(--accent); }
.article-entry-desc {
  font-family: var(--serif);
  font-size: 0.95rem;
  color: var(--secondary);
  line-height: 1.6;
}
.article-entry + .article-entry {
  padding-top: 32px;
  border-top: 1px solid var(--rule-light);
}

/* === ARTICLE PAGE === */
.article-header {
  max-width: 780px;
  margin: 0 auto;
  padding: 48px 24px 0;
}
.article-type {
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}
.article-title {
  font-family: var(--serif);
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin-bottom: 12px;
}
.article-subtitle {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 400;
  font-style: italic;
  color: var(--secondary);
  line-height: 1.5;
  margin-bottom: 24px;
}

/* Metadata block */
.article-meta {
  font-family: var(--sans);
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.7;
  padding: 16px 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.article-meta strong { color: var(--secondary); font-weight: 600; }
.article-meta a { color: var(--accent); text-decoration: none; }
.article-meta a:hover { text-decoration: underline; }

/* Article body */
.article-body {
  max-width: 780px;
  margin: 0 auto;
  padding: 36px 24px 80px;
}
.article-body p { margin-bottom: 1.1em; }
.article-body h2 {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  padding-top: 36px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--accent);
  margin-bottom: 20px;
}
.article-body h3 {
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--ink);
  margin-top: 32px;
  margin-bottom: 12px;
  line-height: 1.3;
}
.article-body h4 {
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-top: 28px;
  margin-bottom: 10px;
}

/* Blockquotes — used for key concept callouts */
.article-body blockquote {
  margin: 28px 0;
  padding: 20px 24px;
  background: var(--callout-bg);
  border-left: 3px solid var(--callout-border);
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--secondary);
}
.article-body blockquote strong { color: var(--ink); }
.article-body blockquote p { margin-bottom: 0.6em; }
.article-body blockquote p:last-child { margin-bottom: 0; }

/* Lists */
.article-body ul, .article-body ol { padding-left: 1.4em; margin-bottom: 1.1em; }
.article-body li { margin-bottom: 0.5em; }
.article-body li::marker { color: var(--accent); }

/* Bold emphasis */
.article-body strong { font-weight: 600; color: var(--ink); }
.article-body em { font-style: italic; }

/* Links */
.article-body a { color: var(--accent); text-decoration: underline; text-decoration-color: rgba(26,79,110,0.3); text-underline-offset: 2px; transition: text-decoration-color 0.15s; }
.article-body a:hover { text-decoration-color: var(--accent); }

/* Data table (as description list) */
.data-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 0;
  margin: 24px 0;
  border: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 0.82rem;
  line-height: 1.55;
  background: var(--surface);
}
.data-grid-header {
  background: var(--ink);
  color: white;
  font-weight: 600;
  padding: 10px 14px;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.data-grid dt, .data-grid dd {
  padding: 10px 14px;
  border-bottom: 1px solid var(--rule-light);
}
.data-grid dt { font-weight: 600; color: var(--ink); background: #f9fafb; }
.data-grid dd { color: var(--body); }
.data-grid .danger { color: var(--red); font-weight: 600; }

/* Sources */
.sources {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.6;
}
.sources h2 {
  font-family: var(--sans) !important;
  font-size: 0.68rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase !important;
  color: var(--muted) !important;
  border-bottom: none !important;
  padding-top: 0 !important;
  padding-bottom: 8px !important;
  margin-bottom: 8px !important;
}
.sources p { margin-bottom: 4px; font-size: 0.82rem; }
.sources a { color: var(--accent); }

/* Contact block */
.contact-block {
  margin-top: 32px;
  padding: 20px 24px;
  background: var(--callout-bg);
  border: 1px solid var(--rule-light);
  font-size: 0.88rem;
  font-style: italic;
  color: var(--secondary);
  line-height: 1.65;
}

/* === SITE FOOTER === */
.site-footer {
  border-top: 3px solid var(--ink);
  background: var(--surface);
  padding: 24px;
  text-align: center;
  font-family: var(--sans);
  font-size: 0.7rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}

/* === RESPONSIVE === */
@media (max-width: 640px) {
  html { font-size: 16px; }
  .article-header, .article-body, .index-body { padding-left: 18px; padding-right: 18px; }
  .data-grid { grid-template-columns: 1fr; }
  .data-grid dt { border-bottom: none; padding-bottom: 2px; }
  .data-grid dd { padding-top: 0; }
}

/* === PRINT === */
@media print {
  body { background: white; font-size: 11pt; }
  .masthead, .site-footer { display: none; }
  .article-body blockquote { border-left: 2pt solid #999; }
}
