/* Research reader aligned with the Elite AI PM curriculum reading shell. */
:root {
  --research-ink: #171717;
  --research-muted: #666662;
  --research-paper: #fafafa;
  --research-surface: #ffffff;
  --research-line: #e5e5e5;
  --research-line-strong: #cfcfcb;
  --research-accent: #c92e4d;
  --research-complete: #bfe8dc;
  --research-display: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --research-body: "Avenir Next", Avenir, "Segoe UI", system-ui, -apple-system, sans-serif;
}

body[data-research-shell] {
  color: var(--research-ink);
  background: var(--research-paper);
  font-family: var(--research-body);
  font-size: 16px;
  line-height: 1.68;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body[data-research-shell] .research-reader-layout { grid-template-columns: 288px minmax(0, 1fr); }

body[data-research-shell] .research-rail {
  width: 288px;
  padding: 24px 20px 36px;
  background: var(--research-surface);
  border-color: var(--research-line);
}

.research-rail-head { margin-bottom: 26px; }
.research-brand { grid-template-columns: 38px minmax(0, 1fr); gap: 11px; }
.research-brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--research-ink);
  font: 800 1.2rem/1 var(--research-display);
}
.research-brand strong { font: 700 .9rem/1.2 var(--research-body); letter-spacing: 0; }
.research-brand small { margin-top: 2px; font: 500 .72rem/1.2 var(--research-body); letter-spacing: 0; }

.research-track-links {
  gap: 5px;
  margin: -4px 0 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--research-line);
}
.research-track-links a {
  min-height: 34px;
  padding: 7px 8px;
  color: var(--research-muted);
  border: 0;
  border-radius: 6px;
  font: 700 .68rem/1.3 var(--research-body);
}
.research-track-links a:hover,
.research-track-links a[aria-current="page"] { background: #f1f1ef; border: 0; }

.research-progress-card {
  margin-bottom: 22px;
  padding: 14px;
  background: var(--research-paper);
  border: 1px solid var(--research-line);
  border-radius: 10px;
}
.research-progress-head {
  display: flex;
  justify-content: space-between;
  color: var(--research-muted);
  font: 500 .74rem/1.3 var(--research-body);
}
.research-progress-head strong { color: var(--research-ink); }
.research-progress-track {
  height: 5px;
  margin-top: 10px;
  overflow: hidden;
  background: var(--research-line);
  border-radius: 999px;
}
.research-progress-track span { display: block; width: 0; height: 100%; background: var(--research-accent); transition: width .2s ease; }

.research-nav-label { margin: 0 9px 7px; color: #90908b; font-size: .62rem; letter-spacing: .13em; }
.research-session-nav { gap: 0; }
.research-session-link {
  grid-template-columns: 32px minmax(0, 1fr) 16px;
  gap: 8px;
  min-height: 42px;
  padding: 8px 9px;
  border-radius: 7px;
}
.research-session-link:hover,
.research-session-link[aria-current="page"] { background: #f1f1ef; }
.research-session-number { color: #9a9a95; font: 500 .68rem/1.2 "SFMono-Regular", Consolas, monospace; letter-spacing: 0; }
.research-session-title { font-size: .76rem; font-weight: 600; line-height: 1.35; }
.research-session-state { color: #36735e; font-size: .7rem; font-weight: 800; text-align: center; }

.research-section-nav { margin-top: 24px; padding: 20px 9px 0; border-color: var(--research-line); }
body[data-research-shell] .reader-sidebar-title { font: 750 .62rem/1.3 var(--research-body); letter-spacing: .1em; }
body[data-research-shell] .reader-toc a { padding: 6px 7px; font: 600 .7rem/1.35 var(--research-body); }

body[data-research-shell] .reader-progress span { background: var(--research-accent); }
body[data-research-shell] .reader-top {
  min-height: 62px;
  padding: 0 clamp(22px, 4vw, 60px);
  background: rgba(255, 255, 255, .96);
  border-bottom: 1px solid var(--research-line);
}
.research-crumb { color: var(--research-muted); font: 500 .78rem/1.4 var(--research-body); }
.reader-actions { gap: 8px; }
body[data-research-shell] .reader-actions a,
body[data-research-shell] .reader-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 13px;
  border: 1px solid var(--research-line-strong);
  border-radius: 7px;
  font: 700 .76rem/1 var(--research-body);
}
body[data-research-shell] .reader-actions a:hover { color: var(--research-ink); background: var(--research-surface); border-color: var(--research-ink); }
body[data-research-shell] .reader-actions .research-complete-button { color: #fff; background: var(--research-ink); border-color: var(--research-ink); }
body[data-research-shell] .reader-actions .research-complete-button:hover { color: #fff; background: #2b2b2b; }
body[data-research-shell] .reader-actions .research-complete-button.is-complete { color: #173f34; background: var(--research-complete); border-color: #95ccb9; }

body[data-research-shell] .reader-main { min-height: calc(100vh - 62px); }
body[data-research-shell] .hero {
  padding: clamp(48px, 6vw, 76px) clamp(24px, 5vw, 70px) 60px;
  background: var(--research-paper);
  border-bottom: 0;
}
body[data-research-shell] .hero-grid { display: block; width: min(100%, 1020px); max-width: none; margin: 0 auto; }
body[data-research-shell] .hero-grid > div:first-child { max-width: 780px; }
body[data-research-shell] .eyebrow {
  margin: 0 0 14px;
  color: var(--research-accent);
  font: 750 .68rem/1.4 var(--research-body);
  letter-spacing: .1em;
}
body[data-research-shell] .hero h1 {
  max-width: 780px;
  margin: 14px 0 18px;
  font-family: var(--research-display);
  font-size: clamp(3rem, 5.5vw, 4.65rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -.025em;
}
body[data-research-shell] .hero-deck {
  max-width: 700px;
  margin: 0;
  color: #494946;
  font-family: var(--research-body);
  font-size: clamp(1.08rem, 1.7vw, 1.3rem);
  line-height: 1.58;
}
body[data-research-shell] .hero-meta { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 24px; padding: 0; border: 0; }
body[data-research-shell] .hero-meta > div {
  display: block;
  padding: 5px 9px;
  background: var(--research-surface);
  border: 1px solid var(--research-line);
  border-radius: 999px;
}
body[data-research-shell] .hero-meta dt { display: none; }
body[data-research-shell] .hero-meta dd { margin: 0; color: var(--research-muted); font: 650 .68rem/1.35 var(--research-body); }
body[data-research-shell] .hero-grid > :not(:first-child) { max-width: 720px; margin-top: 28px; }

body[data-research-shell] .content {
  width: min(100%, 1020px);
  max-width: none;
  margin: 0 auto;
  padding: 0 clamp(24px, 5vw, 70px) 100px;
}
body[data-research-shell] .section { max-width: 720px; margin: 0 0 64px; padding-top: 0; border-top: 0; }
body[data-research-shell] .section-kicker { margin: 0 0 9px; color: var(--research-accent); font: 750 .68rem/1.4 var(--research-body); letter-spacing: .08em; }
body[data-research-shell] .section h2 {
  max-width: 720px;
  margin: 0 0 20px;
  font-family: var(--research-display);
  font-size: clamp(1.9rem, 3vw, 2.65rem);
  line-height: 1.08;
  letter-spacing: -.025em;
}
body[data-research-shell] .section h3 { margin: 28px 0 10px; font-family: var(--research-display); font-size: 1.42rem; line-height: 1.2; }
body[data-research-shell] .section p,
body[data-research-shell] .section li { font-family: var(--research-body); font-size: 1.02rem; line-height: 1.74; }
body[data-research-shell] .section p { margin: 0 0 20px; }
body[data-research-shell] .section .lede { color: #494946; font-size: 1.08rem; line-height: 1.68; }
body[data-research-shell] .section > .lede:first-of-type::first-letter { float: none; margin: 0; font: inherit; }
body[data-research-shell] .quote {
  margin: 30px 0;
  padding: 20px 0;
  border-top: 2px solid var(--research-ink);
  border-bottom: 1px solid var(--research-line-strong);
  font-family: var(--research-display);
  font-size: 1.35rem;
  font-style: normal;
  line-height: 1.45;
}
body[data-research-shell] .callout,
body[data-research-shell] .challenge { padding: 18px; border-radius: 9px; box-shadow: none; }
body[data-research-shell] .table-wrap { max-width: 100%; margin: 24px 0; border-color: var(--research-line-strong); border-radius: 8px; box-shadow: none; }
body[data-research-shell] table { font-family: var(--research-body); font-size: .82rem; }
body[data-research-shell] th { color: #52524e; background: #f3f3f1; }
body[data-research-shell] th,
body[data-research-shell] td { padding: 12px 14px; border-color: var(--research-line); }
body[data-research-shell] pre { border-radius: 8px; box-shadow: none; }

body[data-research-shell] .library { width: min(100%, 1020px); max-width: none; padding: clamp(48px, 6vw, 76px) clamp(24px, 5vw, 70px) 100px; }
body[data-research-shell] .library-kicker { font: 750 .68rem/1.4 var(--research-body); letter-spacing: .1em; }
body[data-research-shell] .library h1 { max-width: 780px; margin: 14px 0 18px; font-size: clamp(3rem, 5.5vw, 4.65rem); line-height: 1.08; }
body[data-research-shell] .library-intro { max-width: 700px; margin: 0; font: 400 clamp(1.08rem, 1.7vw, 1.3rem)/1.58 var(--research-body); }
body[data-research-shell] .library-grid { max-width: 780px; margin-top: 48px; border-color: var(--research-line-strong); }
body[data-research-shell] .research-card { grid-template-columns: 92px minmax(0, 1fr); grid-template-areas: "number title" "meta title" ". theme"; gap: 10px 18px; padding: 20px 8px; border-color: var(--research-line); }
body[data-research-shell] .research-card h2 { font-size: 1.55rem; line-height: 1.12; }

body[data-research-shell] .reader-nav { max-width: 880px; padding: 0 24px 72px; }
body[data-research-shell] .reader-nav a { border-color: var(--research-ink); border-radius: 0; }

@media (max-width: 900px) {
  body[data-research-shell] .research-reader-layout { grid-template-columns: 1fr; }
  body[data-research-shell] .research-rail { width: min(88vw, 360px); padding: calc(20px + env(safe-area-inset-top)) 18px calc(28px + env(safe-area-inset-bottom)); box-shadow: 22px 0 55px rgba(23, 23, 23, .16); }
  .research-rail-close { width: 42px; height: 42px; border-radius: 7px; }
}

@media (max-width: 760px) {
  body[data-research-shell] .reader-top { min-height: 62px; padding: 0 14px; gap: 10px; }
  .research-menu-button { flex: 0 0 42px; width: 42px; height: 42px; border-radius: 7px; font-size: 1rem; }
  .research-crumb { display: none; }
  body[data-research-shell] .reader-actions { flex: 1; justify-content: flex-end; }
  body[data-research-shell] .reader-actions a,
  body[data-research-shell] .reader-actions button { min-height: 42px; padding: 8px 12px; white-space: nowrap; }
  body[data-research-shell] .hero { padding: 32px 18px 54px !important; }
  body[data-research-shell] .hero h1 { max-width: 100% !important; font-size: clamp(2.65rem, 12vw, 3.8rem) !important; line-height: 1 !important; overflow-wrap: anywhere; }
  body[data-research-shell] .hero-deck { font-size: 1.08rem; line-height: 1.58; }
  body[data-research-shell] .hero-meta { display: flex !important; gap: 7px !important; margin-top: 24px !important; }
  body[data-research-shell] .hero-meta > div { min-width: 0 !important; }
  body[data-research-shell] .hero-grid > :not(:first-child) { display: none; }
  body[data-research-shell] .content { padding: 0 18px calc(74px + env(safe-area-inset-bottom)) !important; }
  body[data-research-shell] .section { margin-bottom: 48px !important; }
  body[data-research-shell] .section h2 { font-size: clamp(1.8rem, 8vw, 2.25rem) !important; line-height: 1.08 !important; }
  body[data-research-shell] .section p,
  body[data-research-shell] .section li { font-size: 1rem; line-height: 1.72; }
  body[data-research-shell] .table-wrap { max-width: 100% !important; overflow-x: auto !important; -webkit-overflow-scrolling: touch; }
  body[data-research-shell] table { min-width: 560px; }
  body[data-research-shell] pre { max-width: 100%; white-space: pre-wrap; overflow-wrap: anywhere; }
  body[data-research-shell] .library { padding: 32px 18px calc(74px + env(safe-area-inset-bottom)); }
  body[data-research-shell] .library h1 { font-size: clamp(2.65rem, 12vw, 3.8rem); line-height: 1; }
  body[data-research-shell] .library-grid { margin-top: 36px; }
  body[data-research-shell] .research-card { grid-template-columns: 1fr; grid-template-areas: "number" "title" "theme" "meta"; gap: 6px; padding: 18px 2px; }
  body[data-research-shell] .reader-nav { padding: 0 18px 54px; }
}

@media (max-width: 410px) {
  body[data-research-shell] .reader-actions a,
  body[data-research-shell] .reader-actions button { padding-inline: 9px; font-size: .7rem; }
}

@media (prefers-reduced-motion: reduce) {
  .research-progress-track span { transition: none; }
}
