/* figures.css — Publication-quality figure page styles */

.figures-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.figures-header {
  text-align: center;
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 2px solid #e2e8f0;
}

.figures-header h1 {
  font-size: 1.5rem;
  font-weight: 800;
  color: #1a202c;
  line-height: 1.4;
  max-width: 900px;
  margin: 0 auto 0.75rem;
}

.figures-subtitle {
  font-size: 1rem;
  color: #718096;
  font-weight: 500;
  margin: 0;
}

.figures-toc {
  background: #f7fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 2.5rem;
}

.figures-toc h2 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #4a5568;
  margin: 0 0 0.75rem;
}

.figures-toc ol {
  margin: 0;
  padding-left: 1.25rem;
  columns: 2;
  column-gap: 2rem;
}

.figures-toc li {
  font-size: 0.88rem;
  line-height: 1.8;
  color: #2d3748;
  break-inside: avoid;
}

.figures-toc a {
  color: #2b6cb0;
  text-decoration: none;
}

.figures-toc a:hover {
  text-decoration: underline;
}

.figures-container {
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

/* ── Individual figure block ── */
.figure-block {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 2rem;
  position: relative;
}

.figure-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #4a5568;
  margin-bottom: 1rem;
}

/* ── Panel layouts ── */
.figure-panels {
  margin-bottom: 1.5rem;
}

.figure-panels-grid {
  display: grid;
  gap: 1.5rem;
}

.figure-panels-grid.cols-2 {
  grid-template-columns: 1fr 1fr;
}

.figure-panels-grid.cols-3 {
  grid-template-columns: 1fr 1fr 1fr;
}

.figure-panels-grid.cols-5 {
  grid-template-columns: repeat(5, 1fr);
}

.figure-panel {
  position: relative;
  min-height: 200px;
}

.figure-panel.full-width {
  grid-column: 1 / -1;
}

.panel-label {
  position: absolute;
  top: 4px;
  left: 8px;
  font-size: 0.9rem;
  font-weight: 800;
  color: #2d3748;
  z-index: 10;
  background: rgba(255,255,255,0.85);
  padding: 0 4px;
  border-radius: 2px;
}

/* ── Figure legends ── */
.figure-legend {
  font-size: 0.88rem;
  line-height: 1.7;
  color: #2d3748;
  max-width: 1000px;
  border-top: 1px solid #edf2f7;
  padding-top: 1rem;
}

.figure-legend p {
  margin: 0;
}

.figure-legend em {
  font-style: italic;
}

.figure-legend code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82em;
  background: #edf2f7;
  padding: 0.1em 0.3em;
  border-radius: 3px;
}

.legend-val {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  color: #2b6cb0;
}

/* ── Pipeline schematic (Figure 1) ── */
.pipeline-schematic {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 2rem 0;
  overflow-x: auto;
}

.pipeline-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-width: 130px;
  max-width: 160px;
}

.pipeline-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 800;
  font-family: 'JetBrains Mono', 'Inter', monospace;
  color: #fff;
  margin-bottom: 0.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.pipeline-stage-name {
  font-size: 0.75rem;
  font-weight: 700;
  color: #2d3748;
  line-height: 1.3;
  margin-bottom: 0.25rem;
}

.pipeline-stage-detail {
  font-size: 0.68rem;
  color: #718096;
  line-height: 1.3;
}

.pipeline-arrow {
  font-size: 1.2rem;
  color: #a0aec0;
  margin: 0 0.25rem;
  flex-shrink: 0;
  align-self: center;
  margin-bottom: 1.5rem;
}

/* ── Styled tables in figure panels ── */
.figure-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.figure-table th {
  background: #f7fafc;
  border-bottom: 2px solid #e2e8f0;
  padding: 0.5rem 0.75rem;
  text-align: left;
  font-weight: 700;
  color: #4a5568;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.figure-table td {
  padding: 0.45rem 0.75rem;
  border-bottom: 1px solid #edf2f7;
  color: #2d3748;
}

.figure-table tr:hover {
  background: #f7fafc;
}

.figure-table .text-mono {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
}

/* ── Cancer biology strip ── */
.bio-strip {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem;
  background: #f7fafc;
  border-radius: 6px;
}

.bio-strip-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.8rem;
  line-height: 1.5;
}

.bio-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  color: #fff;
  font-weight: 700;
  font-size: 0.72rem;
  min-width: 42px;
  text-align: center;
  flex-shrink: 0;
}

/* ── Pathway network (Figure 5B) ── */
.pathway-network {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  padding: 1rem;
}

.pathway-group {
  background: #f7fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.75rem;
}

.pathway-group-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #4a5568;
  margin-bottom: 0.5rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid #e2e8f0;
}

.pathway-gene {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  margin: 0.15rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  font-style: italic;
  color: #fff;
}

/* ── Drug table (Figure 8C) ── */
.drug-status {
  display: inline-block;
  padding: 0.12rem 0.4rem;
  border-radius: 3px;
  font-size: 0.7rem;
  font-weight: 600;
}

.drug-status.approved {
  background: #c6f6d5;
  color: #22543d;
}

.drug-status.trials {
  background: #fefcbf;
  color: #744210;
}

.drug-status.experimental {
  background: #fed7d7;
  color: #742a2a;
}

/* ── Loading state ── */
.figure-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 250px;
  color: #a0aec0;
  font-size: 0.9rem;
}

.figure-loading::after {
  content: '';
  width: 24px;
  height: 24px;
  border: 3px solid #e2e8f0;
  border-top-color: #2b6cb0;
  border-radius: 50%;
  animation: fig-spin 0.8s linear infinite;
  margin-left: 0.75rem;
}

@keyframes fig-spin {
  to { transform: rotate(360deg); }
}

.figure-error {
  text-align: center;
  padding: 2rem;
  color: #e53e3e;
  font-size: 0.85rem;
  background: #fff5f5;
  border-radius: 6px;
}

/* ── UCEC warning ── */
.tmb-warning {
  display: inline-block;
  background: #fefcbf;
  color: #744210;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  margin-left: 0.3rem;
}

/* ── Print styles ── */
@media print {
  .figures-page { max-width: 100%; padding: 0; }
  .figure-block {
    box-shadow: none;
    border: 1px solid #ccc;
    page-break-inside: avoid;
    break-inside: avoid;
  }
  .figures-header { border-bottom-color: #ccc; }
  nav, .nav-toggle, footer { display: none !important; }
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .figures-page { padding: 1rem; }
  .figures-header h1 { font-size: 1.15rem; }
  .figure-block { padding: 1rem; }
  .figure-panels-grid.cols-2,
  .figure-panels-grid.cols-3,
  .figure-panels-grid.cols-5 {
    grid-template-columns: 1fr;
  }
  .pipeline-schematic {
    flex-direction: column;
    gap: 0.5rem;
  }
  .pipeline-arrow {
    transform: rotate(90deg);
    margin: 0;
  }
  .pathway-network {
    grid-template-columns: 1fr;
  }
  .figures-toc ol {
    columns: 1;
  }
}
