/* ── Research Library — Academic Stylesheet ── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Instrument+Serif:ital@0;1&family=Lora:ital,wght@0,400;0,600;1,400&family=JetBrains+Mono:wght@400;500&display=swap');

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

:root {
  --ink:        #1a1f2e;
  --ink-2:      #2d3444;
  --ink-3:      #5c6577;
  --ink-4:      #8a93a5;
  --accent:     #3b6ea5;
  --accent-2:   #3b6ea5;
  --border:     #ebe6dc;
  --bg:         #FAFAFA;
  --bg-subtle:  #f4f1ea;
  --bg-accent:  #e8f0fa;
  --green:      #065f46;
  --green-bg:   #ecfdf5;
  --tag-bg:     #e0f2fe;
  --tag-color:  #0369a1;
  --amber:      #d4a373;
}

html { font-size: 16px; -webkit-font-smoothing: antialiased; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
}

/* ── RUO Banner ── */
.ruo-bar {
  background: #1a1f2e; color: white;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; letter-spacing: 0.8px;
  padding: 9px 32px; text-align: center;
}
.ruo-bar span.warn { color: #fbbf24; }

/* ── Site Bar ── */
.site-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250,250,250,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  height: 56px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}
.site-bar-left { display: flex; align-items: center; gap: 14px; }
.site-bar-logo { display: flex; align-items: center; gap: 9px; text-decoration: none; }
.site-bar-logo-icon {
  width: 26px; height: 26px; border-radius: 7px;
  background: linear-gradient(135deg, #3b6ea5, #d4a373);
  color: #fff; font-weight: 800; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
}
.site-bar-logo-name {
  font-family: 'Instrument Serif', serif;
  font-style: italic; font-size: 20px; color: var(--ink);
}
.site-bar-divider { width: 1px; height: 18px; background: var(--border); }
.site-bar-section { font-size: 13px; color: var(--ink-4); font-weight: 500; }
.site-bar-nav { display: flex; align-items: center; gap: 2px; }
.site-bar-link {
  font-size: 13.5px; font-weight: 500; color: var(--ink-3);
  text-decoration: none; padding: 5px 10px; border-radius: 6px;
  transition: background .15s, color .15s; white-space: nowrap;
}
.site-bar-link:hover { background: var(--bg-subtle); color: var(--ink); }
.site-bar-link.warn { color: var(--amber); }
.site-bar-link.warn:hover { background: #faf0e3; }
.site-bar-sep { width: 1px; height: 16px; background: var(--border); margin: 0 8px; }
.site-bar-right { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.site-bar-back {
  font-size: 12.5px; font-weight: 600; color: var(--accent);
  text-decoration: none; padding: 6px 14px;
  border: 1px solid var(--border); border-radius: 6px;
  transition: background .15s, border-color .15s; white-space: nowrap;
}
.site-bar-back:hover { background: var(--bg-accent); border-color: var(--accent); }

/* Right-side controls (matches main site) */
.lang-toggle { display: inline-flex; background: var(--bg-subtle); border-radius: 999px; padding: 3px; border: 1px solid var(--border); }
.lang-btn { padding: 4px 12px; border-radius: 999px; border: none; background: transparent; color: var(--ink-3); font-weight: 600; font-size: 11px; font-family: 'JetBrains Mono', monospace; cursor: pointer; text-decoration: none; display: flex; align-items: center; }
.lang-btn.active { background: var(--ink); color: white; }
.wishlist-icon-wrap { position: relative; cursor: pointer; padding: 6px; border-radius: 50%; transition: background .15s; display: flex; align-items: center; justify-content: center; color: var(--ink-3); text-decoration: none; }
.wishlist-icon-wrap:hover { background: #fee; color: #e53e3e; }
.cart-icon-wrap { position: relative; cursor: pointer; padding: 6px; border-radius: 50%; transition: background .15s; display: flex; align-items: center; justify-content: center; color: var(--ink-3); text-decoration: none; }
.cart-icon-wrap:hover { background: var(--bg-subtle); color: var(--ink); }
.btn-dark { background: var(--ink); color: white; border: none; padding: 9px 18px; font-size: 13px; font-weight: 600; border-radius: 4px; cursor: pointer; transition: opacity .2s ease; text-decoration: none; white-space: nowrap; display: inline-flex; align-items: center; }
.btn-dark:hover { opacity: 0.85; }

@media (max-width: 760px) {
  .site-bar { grid-template-columns: 1fr auto; }
  .site-bar-nav { display: none; }
  .lang-toggle { display: none; }
  .btn-dark { display: none; }
}
@media (max-width: 440px) {
  .site-bar-section { display: none; }
  .site-bar-divider { display: none; }
  .site-bar { padding: 0 16px; }
}

/* ── Article Container ── */
.article-wrap {
  max-width: 780px;
  margin: 0 auto;
  padding: 52px 24px 96px;
}

/* ── Breadcrumb ── */
.breadcrumb {
  font-size: 12px; color: var(--ink-4);
  margin-bottom: 28px;
  display: flex; align-items: center; gap: 6px;
}
.breadcrumb a { color: var(--accent-2); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb-sep { color: var(--border); }

/* ── Article Header ── */
.article-header { margin-bottom: 36px; }
.article-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.article-tag {
  font-size: 11px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; padding: 3px 10px;
  border-radius: 999px; background: var(--tag-bg); color: var(--tag-color);
}
.article-tag.green { background: var(--green-bg); color: var(--green); }
.article-title {
  font-family: 'Lora', Georgia, serif;
  font-size: clamp(24px, 4vw, 34px);
  font-weight: 600;
  color: var(--ink);
  line-height: 1.25;
  letter-spacing: -.015em;
  margin-bottom: 14px;
}
.article-subtitle {
  font-size: 17px; color: var(--ink-3);
  line-height: 1.55; margin-bottom: 20px;
  font-family: 'Lora', Georgia, serif;
  font-style: italic;
}
.article-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 16px;
  font-size: 12px; color: var(--ink-4);
  padding-top: 16px; border-top: 1px solid var(--border);
}
.article-meta-item { display: flex; align-items: center; gap: 5px; }
.article-meta-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--border); }

/* ── Abstract ── */
.abstract-box {
  background: var(--bg-accent);
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  padding: 20px 24px;
  margin-bottom: 44px;
}
.abstract-label {
  font-size: 10px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--accent);
  margin-bottom: 8px;
}
.abstract-text {
  font-size: 14.5px; line-height: 1.7; color: var(--ink-2);
}

/* ── Table of Contents ── */
.toc-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 22px;
  margin-bottom: 48px;
}
.toc-label {
  font-size: 10px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-4);
  margin-bottom: 12px;
}
.toc-list { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.toc-list li { display: flex; align-items: baseline; gap: 10px; }
.toc-num { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--ink-4); min-width: 20px; }
.toc-list a { font-size: 13.5px; color: var(--accent-2); text-decoration: none; font-weight: 500; }
.toc-list a:hover { text-decoration: underline; }

/* ── Article Body ── */
.article-body { counter-reset: section; }

.article-section { margin-bottom: 52px; }

.section-heading {
  font-size: 13px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--accent);
  margin-bottom: 10px;
  display: flex; align-items: center; gap: 10px;
}
.section-heading::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

.section-title {
  font-family: 'Lora', Georgia, serif;
  font-size: clamp(18px, 3vw, 22px);
  font-weight: 600; color: var(--ink);
  line-height: 1.3; margin-bottom: 18px; letter-spacing: -.01em;
}

.article-body p {
  font-size: 15.5px; color: var(--ink-2);
  line-height: 1.8; margin-bottom: 18px;
}

.article-body h3 {
  font-size: 14px; font-weight: 700;
  color: var(--ink); margin: 28px 0 10px;
  letter-spacing: -.01em;
}

/* ── Callout ── */
.callout {
  background: var(--bg-subtle); border: 1px solid var(--border);
  border-radius: 10px; padding: 18px 22px; margin: 24px 0;
}
.callout-label {
  font-size: 10px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-4); margin-bottom: 8px;
}
.callout p { font-size: 14px; color: var(--ink-2); margin: 0; line-height: 1.65; }

/* ── Mechanism Grid ── */
.mechanism-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px; margin: 24px 0;
}
.mechanism-card {
  background: var(--bg-subtle); border: 1px solid var(--border);
  border-radius: 10px; padding: 16px 18px;
}
.mechanism-card-icon { font-size: 20px; margin-bottom: 8px; }
.mechanism-card-title { font-size: 13px; font-weight: 700; color: var(--ink); margin-bottom: 4px; }
.mechanism-card-desc { font-size: 12.5px; color: var(--ink-3); line-height: 1.55; }

/* ── Evidence Table ── */
.evidence-table {
  width: 100%; border-collapse: collapse; margin: 24px 0;
  font-size: 13.5px;
}
.evidence-table thead th {
  text-align: left; font-size: 11px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-4); padding: 8px 12px;
  border-bottom: 2px solid var(--border);
}
.evidence-table tbody td {
  padding: 10px 12px; border-bottom: 1px solid var(--border);
  color: var(--ink-2); vertical-align: top; line-height: 1.5;
}
.evidence-table tbody tr:last-child td { border-bottom: none; }
.evidence-table tbody tr:hover td { background: var(--bg-subtle); }
.badge-level {
  font-size: 10px; font-weight: 700; padding: 2px 7px;
  border-radius: 4px; white-space: nowrap;
}
.badge-high   { background: var(--green-bg); color: var(--green); }
.badge-medium { background: #fef9c3; color: #854d0e; }
.badge-vitro  { background: var(--tag-bg); color: var(--tag-color); }

/* ── Dosing ── */
.dosing-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px; margin: 24px 0;
}
.dosing-card {
  border: 1px solid var(--border); border-radius: 10px; padding: 16px 18px;
  border-top: 3px solid var(--accent);
}
.dosing-card-label {
  font-size: 10px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--ink-4); margin-bottom: 8px;
}
.dosing-card-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 15px; font-weight: 600; color: var(--ink);
  margin-bottom: 4px;
}
.dosing-card-note { font-size: 12px; color: var(--ink-3); line-height: 1.5; }

/* ── References ── */
.references-section { margin-top: 56px; }
.references-divider {
  border: none; border-top: 2px solid var(--ink); margin-bottom: 20px;
}
.references-title {
  font-size: 14px; font-weight: 700; color: var(--ink);
  letter-spacing: .03em; margin-bottom: 16px;
}
.ref-list { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.ref-item { display: flex; gap: 14px; font-size: 13px; line-height: 1.6; }
.ref-num {
  font-family: 'JetBrains Mono', monospace; font-size: 11px;
  font-weight: 600; color: var(--ink-4); min-width: 22px; padding-top: 2px;
}
.ref-body { color: var(--ink-2); }
.ref-body strong { color: var(--ink); font-weight: 600; }
.ref-link {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600; color: var(--accent);
  text-decoration: none; padding: 1px 7px; margin-left: 6px;
  border: 1px solid currentColor; border-radius: 4px; vertical-align: middle;
  opacity: .8; transition: opacity .15s;
}
.ref-link:hover { opacity: 1; }
.ref-placeholder {
  font-size: 11px; color: var(--ink-4); font-style: italic; margin-left: 6px;
}

/* ── Footer ── */
.article-footer {
  margin-top: 64px; padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex; flex-wrap: wrap; justify-content: space-between;
  align-items: center; gap: 12px;
}
.article-footer-ruo { font-size: 11.5px; color: var(--ink-4); max-width: 540px; line-height: 1.55; }
.article-footer-back {
  font-size: 12px; font-weight: 600; color: var(--accent-2);
  text-decoration: none; white-space: nowrap;
}
.article-footer-back:hover { text-decoration: underline; }

/* ── Responsive ── */
@media (max-width: 600px) {
  .article-wrap { padding: 32px 18px 64px; }
  .mechanism-grid { grid-template-columns: 1fr; }
  .dosing-grid { grid-template-columns: 1fr; }
  .evidence-table { font-size: 12px; }
  .evidence-table thead th, .evidence-table tbody td { padding: 8px; }
}
