/* ============================================================
   Executive Ink Design System — PMC12230154
   GLP-1 Agonists in T2DM: Systematic Review & NMA
   ============================================================ */

/* ── Palette ──────────────────────────────────────────────── */
:root {
  --bg:           #F5F3F0;
  --surface:      #FFFFFF;
  --primary:      #2C2C34;
  --secondary:    #3D4560;
  --accent:       #5C6B8A;
  --text:         #1A1A22;
  --muted:        #7A7B85;
  --line:         #D6D4D0;
  --surface-alt:  #F0EEE9;
  --accent-light: #E8EBF2;
  --badge-green:       #2E6B4F;
  --badge-green-bg:    #E8F2EC;
  --badge-amber:       #7A5C18;
  --badge-amber-bg:    #F5EDD6;
  --badge-red:         #8B2E2E;
  --badge-red-bg:      #F5E0E0;
  --hero-overlay: rgba(28,28,36,0.72);
  --radius:       8px;
  --shadow-sm:    0 2px 12px rgba(44,44,52,0.08);
  --shadow-md:    0 6px 24px rgba(44,44,52,0.15);
  --transition:   0.25s ease;
  --font-heading: 'Playfair Display', Georgia, serif;
  --font-body:    'Source Sans 3', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', Menlo, monospace;
}

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

ul, ol {
  padding-left: 1.4em;
}

li {
  margin-bottom: 0.4em;
}

/* ── Layout ───────────────────────────────────────────────── */
.container {
  max-width: 920px;
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 48px);
}

.section {
  padding: 80px 0;
}

.section.bg-cream   { background: var(--bg); }
.section.bg-white   { background: var(--surface); }
.section.section-dark {
  background: var(--primary);
  color: #FFFFFF;
}
.section.section-dark h1,
.section.section-dark h2,
.section.section-dark h3,
.section.section-dark p,
.section.section-dark li {
  color: rgba(255,255,255,0.88);
}
.section.section-dark .section-title,
.section.section-dark .treatment-heading {
  color: #FFFFFF;
}

.metadata-section {
  border-top: 1px solid var(--line);
  padding: 48px 0;
}

/* ── Section Headers ─────────────────────────────────────── */
.section-header {
  margin-bottom: 40px;
}

.section-title {
  font-family: var(--font-heading);
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 12px;
  line-height: 1.25;
}

.section-caption {
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.5;
}

.subsection-title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 600;
  font-style: italic;
  color: var(--secondary);
  margin: 40px 0 16px;
}

.limitations-heading {
  color: var(--muted);
}

.card-heading {
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary);
  margin-bottom: 12px;
}

.section-dark .card-heading {
  color: rgba(255,255,255,0.7);
}

.figure-heading {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 600;
  font-style: italic;
  color: var(--secondary);
  margin-bottom: 16px;
}

/* ── Typography ─────────────────────────────────────────── */
.prose-block {
  margin: 40px 0;
}

.prose-block p {
  margin-bottom: 20px;
  color: var(--text);
}

.muted-text {
  color: var(--muted);
  font-size: 0.95rem;
}

.text-white { color: #FFFFFF !important; }

/* ── Hero Section ────────────────────────────────────────── */
.hero-section {
  position: relative;
  min-height: 580px;
  background-image: url('./assets/hero_bg.png');
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: stretch;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: var(--hero-overlay);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-container {
  display: flex;
  align-items: center;
  gap: 40px;
  padding-top: 48px;
  padding-bottom: 48px;
}

.hero-text {
  flex: 1;
  min-width: 0;
}

.hero-badge {
  display: inline-block;
  font-size: 0.85rem;
  color: var(--line);
  font-family: var(--font-body);
  margin-bottom: 20px;
  letter-spacing: 0.04em;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 700;
  color: #FFFFFF;
  line-height: 1.2;
  text-shadow: 0 2px 12px rgba(0,0,0,0.4);
  margin-bottom: 16px;
}

.hero-subtitle {
  font-size: 1.1rem;
  font-style: italic;
  color: var(--line);
  margin-bottom: 24px;
  line-height: 1.5;
}

.hero-meta {
  font-size: 0.9rem;
  color: #A8B4C8;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-doi-link {
  color: #A8B4C8;
  text-decoration: none;
  border-bottom: 1px solid rgba(168,180,200,0.4);
  transition: color var(--transition), border-color var(--transition);
}

.hero-doi-link:hover {
  color: #FFFFFF;
  border-color: rgba(255,255,255,0.6);
}

.hero-actions {
  margin-top: 20px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1.5px solid rgba(255,255,255,0.5);
  border-radius: 8px;
  padding: 10px 22px;
  color: #FFFFFF;
  font-size: 0.9rem;
  font-weight: 500;
  background: transparent;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
  text-decoration: none;
}
.btn:hover { background: var(--accent); border-color: var(--accent); text-decoration: none; }

.hero-thumbnail {
  flex-shrink: 0;
}

.thumbnail-img {
  width: 160px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  transform: translateY(-8px);
}

.scroll-hint {
  display: flex;
  justify-content: center;
  padding-bottom: 28px;
  color: var(--line);
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(8px); }
}

/* ── Metric Cards ────────────────────────────────────────── */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.metric-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px;
  border-left: 3px solid var(--accent);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition);
}

.metric-card:hover {
  box-shadow: var(--shadow-md);
}

.metric-number {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 700;
  color: var(--primary);
  line-height: 1.1;
  margin-bottom: 8px;
}

.metric-number-sm {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
}

.metric-label {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 12px;
  line-height: 1.4;
}

.metric-sub {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 8px;
  font-family: var(--font-mono);
}

/* ── Badges ─────────────────────────────────────────────── */
.badge {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 8px;
}

.badge-green {
  background: var(--badge-green-bg);
  color: var(--badge-green);
}

.badge-amber {
  background: var(--badge-amber-bg);
  color: var(--badge-amber);
}

.badge-red {
  background: var(--badge-red-bg);
  color: var(--badge-red);
}

.badge-accent {
  background: var(--accent-light);
  color: var(--secondary);
}

.badge-secondary {
  background: var(--accent-light);
  color: var(--secondary);
}

.badge-muted {
  background: var(--bg);
  color: var(--muted);
  border: 1px solid var(--line);
}

.badge-green-inv {
  background: var(--badge-green-bg);
  color: var(--badge-green);
}

.badge-light-inv {
  background: var(--accent-light);
  color: var(--secondary);
}

.badge-amber-inv {
  background: var(--badge-amber-bg);
  color: var(--badge-amber);
}

/* ── Two-Column Layout ───────────────────────────────────── */
.two-col-layout {
  display: grid;
  grid-template-columns: 60% 40%;
  gap: 40px;
  align-items: start;
}

.discussion-layout {
  grid-template-columns: 65% 35%;
}

.col-main p,
.col-main li {
  margin-bottom: 20px;
}

.col-side-left {
  grid-column: 1;
}

.col-main-right {
  grid-column: 2;
}

/* ── Problem Box (Introduction) ─────────────────────────── */
.problem-box {
  background: var(--surface-alt);
  border-left: 3px solid var(--secondary);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 20px 24px;
  margin: 24px 0;
}

.problem-box p {
  margin: 0;
  color: var(--secondary);
  font-weight: 500;
}

/* ── Drug Badges ─────────────────────────────────────────── */
.drug-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.drug-badge {
  background: var(--accent-light);
  color: var(--secondary);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 999px;
  white-space: nowrap;
}

/* ── Info Box ────────────────────────────────────────────── */
.info-box {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 20px;
  margin-top: 20px;
}

.info-box h3 {
  margin-bottom: 10px;
}

.info-box ul {
  color: var(--text);
}

/* ── Figure Cards ────────────────────────────────────────── */
.figure-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  margin: 32px 0;
  transition: box-shadow var(--transition);
}

.figure-card:hover {
  box-shadow: var(--shadow-md);
}

.figure-scroll-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.figure-img {
  max-width: 100%;
  border-radius: 4px;
  margin: 0 auto;
}

.figure-caption {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 12px;
  line-height: 1.5;
}

.figure-note {
  background: var(--bg);
  border-radius: 4px;
  padding: 12px 16px;
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--text);
  font-family: var(--font-mono);
  line-height: 1.6;
}

.figure-note p {
  margin: 0;
}

/* ── Reading Guide ───────────────────────────────────────── */
.reading-guide {
  background: var(--accent-light);
  border-radius: 6px;
  padding: 16px 20px;
  margin-top: 16px;
}

.reading-guide p {
  font-size: 0.9rem;
  color: var(--secondary);
  margin-bottom: 6px;
  line-height: 1.5;
}

.reading-guide p:last-child {
  margin-bottom: 0;
}

/* ── 3-Column Cards Grid ─────────────────────────────────── */
.cards-grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin: 32px 0;
}

/* Method Cards */
.method-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px;
  border-top: 3px solid var(--accent);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition);
}

.method-card:hover {
  box-shadow: var(--shadow-md);
}

.method-icon {
  color: var(--accent);
  margin-bottom: 16px;
}

.method-card p {
  font-size: 0.95rem;
  color: var(--text);
  margin-bottom: 16px;
  line-height: 1.65;
}

/* Safety Cards */
.safety-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px;
  border-top: 3px solid var(--line);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition);
}

.safety-card:hover {
  box-shadow: var(--shadow-md);
}

.safety-card p,
.safety-card li {
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.65;
}

/* QA Cards */
.qa-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.qa-card p {
  font-size: 0.9rem;
  color: var(--muted);
  margin-top: 8px;
  line-height: 1.6;
}

/* ── Ranking Cards ───────────────────────────────────────── */
.ranking-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin: 32px 0;
}

.ranking-card {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 24px;
  border-left: 4px solid var(--line);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition);
}

.ranking-card:hover {
  box-shadow: var(--shadow-md);
}

.ranking-1st { border-left-color: var(--badge-green); }
.ranking-2nd { border-left-color: var(--secondary); }
.ranking-3rd { border-left-color: var(--accent); }

.ranking-drug {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary);
  margin: 10px 0 16px;
  line-height: 1.3;
}

.ranking-stats {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.stat-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.stat-label {
  color: var(--muted);
  flex-shrink: 0;
}

.stat-value {
  font-weight: 600;
  color: var(--primary);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  text-align: right;
}

/* ── Weight Stats ────────────────────────────────────────── */
.weight-stats {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.weight-row {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.weight-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.weight-row strong {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.ci-text {
  font-size: 0.8rem;
  color: var(--muted);
  font-family: var(--font-mono);
  display: block;
  margin-top: 2px;
}

/* ── Discussion Layout ───────────────────────────────────── */
.discussion-side {
  position: sticky;
  top: 80px;
  align-self: start;
}

.side-card {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

.side-card-accent {
  background: var(--accent-light);
}

.side-card p {
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.6;
  margin: 0;
}

/* ── Conclusion / Treatment Cards ────────────────────────── */
.conclusion-text {
  margin-bottom: 48px;
}

.conclusion-text p {
  margin-bottom: 20px;
  font-size: 1.05rem;
  line-height: 1.75;
}

.treatment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin: 0 0 48px;
}

.treatment-card {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius);
  padding: 24px;
  transition: background var(--transition), box-shadow var(--transition);
}

.treatment-card:hover {
  background: rgba(255,255,255,0.13);
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.treatment-heading {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.65);
  margin-bottom: 8px;
}

.treatment-drug {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 700;
  color: #FFFFFF;
  margin-bottom: 12px;
  line-height: 1.2;
}

.treatment-card p {
  font-size: 0.92rem;
  color: rgba(255,255,255,0.78);
  margin-bottom: 16px;
  line-height: 1.6;
}

.conclusion-footer {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.15);
}

.conclusion-footer p {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.4);
  margin-bottom: 4px;
  line-height: 1.5;
}

/* ── Metadata / Footer ───────────────────────────────────── */
.metadata-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}

.author-list,
.metadata-list {
  list-style: none;
  padding: 0;
}

.author-list li,
.metadata-list li {
  font-size: 0.9rem;
  color: var(--muted);
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
  line-height: 1.5;
}

.author-list li:last-child,
.metadata-list li:last-child {
  border-bottom: none;
}

.doi-link {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

/* ── Reveal Animations ───────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.4s ease-out, transform 0.4s ease-out;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Flecto Explanation UI Classes (Step 6b) ─────────────── */

/* Shared base styles */
.flecto-note,
.flecto-callout,
.flecto-card,
.flecto-panel {
  position: relative;
  border-radius: var(--radius);
  padding: 20px 24px;
  margin: 24px 0;
  font-family: var(--font-body);
}

/* ::before label for all explanation classes */
.flecto-note::before,
.flecto-callout::before,
.flecto-card::before,
.flecto-panel::before {
  content: "🤖 AI explanation";
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #60a5fa;
  letter-spacing: 0.06em;
  display: block;
  margin-bottom: 0.5em;
}

/* flecto-note: small inline supplemental note */
.flecto-note {
  background: var(--surface);
  border-left: 3px solid var(--accent);
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.65;
  box-shadow: var(--shadow-sm);
}

/* flecto-callout: prominent highlighted block */
.flecto-callout {
  background: var(--accent-light);
  border: 1px solid rgba(92, 107, 138, 0.2);
  color: var(--secondary);
  font-size: 1rem;
  line-height: 1.7;
  box-shadow: var(--shadow-sm);
}

/* flecto-card: card with heading, body, and list */
.flecto-card {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
}

.flecto-card .flecto-card-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 10px;
}

.flecto-card p,
.flecto-card li {
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.7;
}

/* flecto-panel: large rich panel with heading hierarchy */
.flecto-panel {
  background: var(--surface-alt);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
  padding: 28px 32px;
}

.flecto-panel h2 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 12px;
}

.flecto-panel h3 {
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--secondary);
  margin: 20px 0 8px;
}

.flecto-panel p,
.flecto-panel li {
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.75;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .section { padding: 48px 0; }

  .hero-container {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-thumbnail {
    display: none;
  }

  .two-col-layout,
  .discussion-layout {
    grid-template-columns: 1fr;
  }

  .col-side-left,
  .col-main-right {
    grid-column: auto;
  }

  .discussion-side {
    position: static;
  }

  .metadata-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .metrics-grid,
  .ranking-grid,
  .cards-grid-3,
  .treatment-grid {
    grid-template-columns: 1fr;
  }

  .stat-row {
    flex-direction: column;
    gap: 2px;
  }
}

/* ── Reduced Motion ──────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0ms !important;
    transition-duration: 0ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }

  .scroll-hint {
    animation: none;
  }
}
