/* Tree of Life (/evolution) layout chrome.

   This sheet is linked by exactly two pages: the site's /evolution page and the
   offline ToL iOS app's mirror of it (Web/evolution/index.html). It once also
   dressed the /map and /portfolio pages, which were retired 2026-06-18; their
   rules (loading screen, leaflet map + region labels, tree/map search, the
   jh-treeviz SVG, film dialogs, the dev preview toggle) were pruned 2026-07-22
   once john-portfolio-clean.js — the only thing that emitted that markup — was
   deleted. Everything left here is reachable from the two pages above. */

.jh-portfolio-layout {
  position: relative;
  width: min(var(--jh-max), calc(100% - 40px));
  margin: 0 auto;
  padding: 16px 0 0;
  --jh-tree-side-column: clamp(220px, 24vw, 300px);
  --jh-layout-gap: clamp(24px, 2.6vw, 40px);
}

.jh-portfolio-layout.is-tree-view {
  display: grid;
  grid-template-columns: minmax(220px, var(--jh-tree-side-column)) minmax(0, 1fr);
  gap: 28px var(--jh-layout-gap);
  align-items: start;
}

.jh-portfolio-layout.is-tree-view .jh-breadcrumb {
  grid-column: 1 / -1;
}

.jh-breadcrumb {
  display: grid;
  align-items: start;
  gap: 18px var(--jh-layout-gap);
}

.jh-portfolio-layout.is-tree-view .jh-breadcrumb {
  grid-template-columns: minmax(220px, var(--jh-tree-side-column)) minmax(0, 1fr);
}

.jh-breadcrumb__trail {
  display: flex;
  align-items: center;
  align-content: center;
  flex-wrap: wrap;
  gap: 10px;
  grid-column: 1;
  min-width: 0;
}

.jh-breadcrumb__trail button,
.jh-breadcrumb__trail .jh-breadcrumb__sep {
  white-space: nowrap;
  word-break: keep-all;
  overflow-wrap: normal;
}

.jh-portfolio-layout.is-tree-view [data-jh-tree-panel] {
  grid-column: 1;
  margin: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}

.jh-portfolio-layout.is-tree-view .jh-photo-rail {
  width: 100%;
  margin: 0;
  grid-column: 2;
  position: sticky;
  top: 16px;
}

.jh-portfolio-layout.is-tree-view .jh-photo-rail__meta {
  font-family: var(--jh-font-display);
  letter-spacing: 0.06em;
  text-transform: none;
}

.jh-portfolio-panel {
  background: rgba(255, 252, 246, 0.74);
  border: 1px solid var(--jh-line);
  box-shadow: var(--jh-shadow);
  padding: 22px;
}

@media (max-width: 860px) {
  .jh-portfolio-layout.is-tree-view {
    grid-template-columns: 1fr;
  }

  .jh-portfolio-layout.is-tree-view [data-jh-tree-panel],
  .jh-portfolio-layout.is-tree-view .jh-photo-rail {
    grid-column: 1;
  }

  .jh-portfolio-layout.is-tree-view .jh-photo-rail {
    position: static;
  }

  .jh-breadcrumb {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
}

/* Chip styling mirrors .jh-safari-badge in john-safaris-clean.css exactly —
   the Map / Evolution / Safari badge surfaces must stay visually identical. */
.jh-safari-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border: 1px solid var(--jh-line);
  border-radius: 999px;
  background: var(--jh-panel);
  color: var(--jh-text);
  font-family: var(--jh-font-body);
  font-size: 0.85rem;
  line-height: 1;
  letter-spacing: 0.01em;
  text-decoration: none;
  white-space: nowrap;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease, transform 160ms ease,
    box-shadow 160ms ease;
}

.jh-safari-badge:hover,
.jh-safari-badge:focus-visible {
  background: var(--jh-accent);
  border-color: var(--jh-accent);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(17, 17, 17, 0.14);
  outline: none;
}

.jh-safari-badge__icon {
  width: 13px;
  height: 13px;
  flex: none;
  fill: currentColor;
  opacity: 0.55;
}

.jh-safari-badge:hover .jh-safari-badge__icon,
.jh-safari-badge:focus-visible .jh-safari-badge__icon {
  opacity: 1;
}

/* Collapsible wildlife class groups (Mammals / Birds / Reptiles …). Shared look
   with the Safari + Evolution surfaces. Native <details>/<summary>, no JS. */
.jh-taxa-groups {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 9px;
}

.jh-taxa-group {
  flex: 0 1 auto;
}

.jh-taxa-group[open] {
  flex-basis: 100%;
}

.jh-taxa-group__header {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--jh-line);
  background: var(--jh-panel);
  color: var(--jh-text);
  font-family: var(--jh-font-body);
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  list-style: none;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.jh-taxa-group__header::-webkit-details-marker { display: none; }

.jh-taxa-group__header:hover {
  background: var(--jh-accent);
  color: #fff;
  border-color: var(--jh-accent);
}

.jh-taxa-group__icon { width: 14px; height: 14px; flex: none; fill: currentColor; opacity: 0.6; }

.jh-taxa-group__header:hover .jh-taxa-group__icon { opacity: 1; }

.jh-taxa-group__name { font-weight: 400; }

.jh-taxa-group__count {
  background: rgba(23, 21, 17, 0.1);
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 0.72rem;
}

.jh-taxa-group__header::after {
  content: "›";
  margin-left: 2px;
  opacity: 0.55;
  transition: transform 150ms ease;
}

.jh-taxa-group[open] .jh-taxa-group__header::after { transform: rotate(90deg); }

.jh-taxa-group__tray {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 9px;
}
