/* Styles for the interactive growth chart on the About page. */

#rnacentral-growth {
  margin: 1em 0 1.5em;
}

#rnacentral-growth img {
  max-width: 100%;
}

.growth-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  border-bottom: 1px solid #d8dee4;
  margin-bottom: 12px;
}

.growth-tab {
  appearance: none;
  background: none;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 4px 4px 0 0;
  padding: 7px 14px;
  margin-bottom: -1px;
  font: inherit;
  font-size: 0.9em;
  color: #4a5560;
  cursor: pointer;
}

.growth-tab:hover {
  color: #1f77b4;
  background: rgba(31, 119, 180, 0.07);
}

.growth-tab.is-active {
  color: #1f77b4;
  font-weight: 600;
  border-color: #d8dee4;
  border-bottom: 1px solid #fff;
  background: #fff;
}

.growth-tab:focus-visible {
  outline: 2px solid #1f77b4;
  outline-offset: -2px;
}

.growth-figure {
  position: relative;
}

.growth-figure svg {
  display: block;
  overflow: visible;
}

.growth-axis text {
  font-size: 11px;
  fill: #5a6570;
}

.growth-axis .domain,
.growth-axis line {
  stroke: #c6ced6;
}

.growth-grid line {
  stroke: #e4e9ee;
}

.growth-grid .domain {
  stroke: none;
}

.growth-crosshair {
  stroke: #8a97a3;
  stroke-dasharray: 3 3;
}

.growth-tooltip {
  position: absolute;
  pointer-events: none;
  background: #fff;
  border: 1px solid #d8dee4;
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  padding: 6px 10px;
  font-size: 0.82em;
  line-height: 1.35;
  color: #2c3e50;
  white-space: nowrap;
  z-index: 2;
}

.growth-tooltip-date {
  color: #6b7783;
}

@media (prefers-color-scheme: dark) {
  .growth-tabs { border-bottom-color: #3a444d; }
  .growth-tab { color: #9aa7b2; }
  .growth-tab.is-active {
    border-color: #3a444d;
    border-bottom-color: #1a1c1e;
    background: #1a1c1e;
    color: #6cb2eb;
  }
  .growth-axis text { fill: #9aa7b2; }
  .growth-axis .domain,
  .growth-axis line { stroke: #4a545d; }
  .growth-grid line { stroke: #333c44; }
  .growth-tooltip {
    background: #22262a;
    border-color: #3a444d;
    color: #dfe6ec;
  }
  .growth-tooltip-date { color: #9aa7b2; }
}

/* --- history timeline (TimelineJS) ------------------------------------- */

/* TimelineJS overwrites className on its own container, so the height lives on
   a wrapper it does not manage. */
.timeline-wrap {
  width: 100%;
  height: 0;
  margin: 1em 0 1.5em;
}

.timeline-wrap.is-ready {
  height: 560px;
}

.timeline-wrap #rnacentral-timeline {
  height: 100%;
}

/* TimelineJS measures its container and sizes slide media itself. The Read the
   Docs theme styles every image and paragraph inside .rst-content, which throws
   those measurements out, so neutralise it within the timeline only. */
#rnacentral-timeline img {
  max-width: 100%;
  max-height: 100%;
  margin: 0;
  border: 0;
  box-shadow: none;
  background: none;
}

#rnacentral-timeline .tl-media img {
  object-fit: contain;
}

#rnacentral-timeline p,
#rnacentral-timeline h1,
#rnacentral-timeline h2,
#rnacentral-timeline h3,
#rnacentral-timeline h4 {
  margin: 0 0 0.4em;
  line-height: 1.4;
}

#rnacentral-timeline .tl-caption,
#rnacentral-timeline .tl-credit {
  margin: 0.3em 0 0;
}

/* The theme's link underline styling bleeds into the navigation markers. */
#rnacentral-timeline a {
  text-decoration: none;
}

.timeline-fallback dt {
  margin-top: 0.9em;
}

@media (max-width: 900px) {
  .timeline-wrap.is-ready { height: 520px; }
}
