/* tree.html only -- the cladogram SVG itself (.cladogram-*) is shared with
   species.html's "Position in the tree of life" section and lives in
   style.css instead. */

/* Wider than the shared `main { max-width: 1100px }` -- the full cladogram's
   aligned tip-label column needs more horizontal room than a text page does
   to stay readable without horizontal scrolling on a typical desktop
   viewport (see tree.js's COL_WIDTH comment). */
.tree-main {
  max-width: 1500px;
}

.tree-content {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.tree-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.tree-search {
  position: relative;
  flex: 1 1 260px;
  max-width: 360px;
}

.tree-search .search-box {
  width: 100%;
}

.tree-search-results {
  position: absolute;
  z-index: 5;
  top: calc(100% + 0.25rem);
  left: 0;
  right: 0;
  margin: 0;
  padding: 0.25rem 0;
  list-style: none;
  background: var(--paper-box);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
  max-height: 260px;
  overflow-y: auto;
}

.tree-search-result {
  display: block;
  width: 100%;
  text-align: left;
  font: inherit;
  font-size: 0.85rem;
  padding: 0.35rem 0.7rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ink);
}

.tree-search-result:hover,
.tree-search-result:focus-visible {
  background: var(--paper);
  color: var(--green);
}

.tree-search-empty {
  padding: 0.35rem 0.7rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.tree-zoom-controls {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-sans);
  font-size: 0.85rem;
}

.tree-zoom-btn {
  width: 1.9rem;
  height: 1.9rem;
  line-height: 1;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper-box);
  color: var(--ink);
  cursor: pointer;
  font-size: 1.05rem;
}

.tree-zoom-btn:hover,
.tree-zoom-btn:focus-visible {
  border-color: var(--green);
  color: var(--green);
}

.tree-zoom-level {
  min-width: 3.2rem;
  text-align: center;
  color: var(--muted);
}

.tree-zoom-reset {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper-box);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 0.8rem;
  padding: 0.3rem 0.6rem;
}

.tree-zoom-reset:hover,
.tree-zoom-reset:focus-visible {
  border-color: var(--green);
  color: var(--green);
}

/* The tree itself is very tall by design (577 species down one column) --
   this box is what actually scrolls, so the toolbar above stays put instead
   of scrolling away with it. */
.tree-scroll {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper-box);
  max-height: 75vh;
}

.tree-scroll .cladogram-canvas {
  border: none;
  border-radius: 0;
  overflow: visible;
}
