/* section-species.css, §4 Same gene across species. Each species gets
   a row with two columns: meta (kingdom-coloured name + identity stats
   stacked underneath) and the aligned sequence block. */

.species-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 16px;
  align-items: start;
  padding: 14px 0;
  border-top: 1px solid #eee;
}
/* Grid tracks default to min-width: auto, which lets the .species-seq
   box (white-space: pre + the longest 60-char line) push the 1fr column
   wider than the demo card. That defeats the inner overflow-x: auto and
   forces the whole page to scroll horizontally on narrow viewports. Pin
   both children to min-width: 0 so the column collapses to the card
   width and .species-seq owns the horizontal scroll itself. */
.species-row > * { min-width: 0; }
.species-row:first-child { border-top: none; }
.species-meta {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
}
.species-name {
  font-weight: 500; color: #1f1f1d;
  text-transform: uppercase; letter-spacing: 1px; font-size: 11px;
  border-left: 4px solid;
  padding-left: 8px;
}
.species-sub { color: #888; font-size: 10px; margin-top: 4px; padding-left: 12px; }
.species-stats {
  text-align: left; font-family: "JetBrains Mono", monospace;
  font-size: 11px; color: #666;
  padding-left: 12px; margin-top: 10px;
}
.species-stats .stat-id { font-size: 16px; color: #1f1f1d; font-weight: 500; font-variant-numeric: tabular-nums; }
.species-stats .stat-sub { font-size: 10px; color: #999; margin-top: 2px; }
.species-seq {
  font-family: "JetBrains Mono", monospace;
  background: #f7f5ee; border: 1px solid #eee;
  padding: 8px 12px; overflow-x: auto;
  white-space: pre; font-size: 11px;
  line-height: 1.7; letter-spacing: 0.5px;
}
.species-seq.empty { color: #ccc; padding: 18px 12px; text-align: center; }

/* On narrow viewports the 140px meta column eats half the .demo card
   and squeezes the DNA block down to ~20 bases per line. Stack the row
   so the sequence gets the full card width — the existing overflow-x
   on .species-seq keeps it horizontally scrollable when 60 bp + spaces
   still don't fit. Meta lays out as a single inline row so the species
   name, sub-meta and identity stat read as a compact header above the
   sequence rather than a tall left rail. */
@media (max-width: 720px) {
  .species-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .species-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    column-gap: 14px;
    row-gap: 4px;
  }
  .species-name { padding-left: 6px; }
  .species-sub { margin-top: 0; padding-left: 0; }
  .species-stats {
    margin-top: 0;
    padding-left: 0;
    display: flex;
    align-items: baseline;
    gap: 6px;
  }
  .species-stats .stat-id { font-size: 13px; }
  .species-stats .stat-sub { margin-top: 0; }
}
