/* Families chapter — the two-lens switch and the narrowing flowchart.
   Tokens only; every colour, size and radius comes from css/style.css. */

/* ---------- which map are we looking at ---------- */

#ch-families .lens-switch {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin: 0 0 16px;
}
#ch-families .lens-btn {
  font-family: var(--mono); font-size: 12.5px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.1em;
  padding: 7px 14px; border-radius: 999px; cursor: pointer;
  background: transparent; color: var(--ink-soft);
  border: 1.5px solid var(--line);
  transition: color 0.18s cubic-bezier(0.22, 1, 0.36, 1),
              border-color 0.18s cubic-bezier(0.22, 1, 0.36, 1);
}
#ch-families .lens-btn:hover { color: var(--ink); border-color: var(--ink-soft); }
#ch-families .lens-btn.on {
  color: var(--accent-ink); border-color: var(--accent);
}
#ch-families .lens-btn:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
#ch-families .lens-note {
  flex: 1 1 320px; min-width: 0;
  font-size: 13.5px; color: var(--ink-soft); line-height: 1.5;
}

/* The Mystery card carries no marker hue, on purpose: in this guide colour
   IS the classification, so an unclassifiable interval gets none. */
#ch-families .family-card.uncoloured { border-style: dashed; }
#ch-families .family-card.uncoloured .vibe { font-style: italic; }

/* ---------- the narrowing ---------- */

#ch-families .tree-crumbs {
  display: none; flex-wrap: wrap; align-items: center; gap: 7px;
  margin: 14px 0 4px;
}
#ch-families .tree-crumbs.show { display: flex; }
#ch-families .crumb {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--ink-soft);
  border-bottom: 1.5px solid var(--line); padding-bottom: 2px;
}
#ch-families .crumb-arr { color: var(--line); font-size: 13.5px; }

#ch-families .tree-q {
  font-family: var(--serif); font-size: 26px; line-height: 1.25;
  margin: 14px 0 14px; max-width: 34ch;
}
#ch-families .tree-opts {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr));
  gap: 10px;
}
#ch-families .tree-opt {
  display: flex; flex-direction: column; gap: 4px; text-align: left;
  padding: 13px 15px 14px; cursor: pointer;
  background: var(--card); color: var(--ink);
  border: 1.6px solid var(--line); border-radius: 12px;
  transition: border-color 0.18s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.18s cubic-bezier(0.22, 1, 0.36, 1);
}
#ch-families .tree-opt:hover { border-color: var(--accent); transform: translateY(-1px); }
#ch-families .tree-opt:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#ch-families .to-label { font-family: var(--serif); font-weight: 700; font-size: 21px; }
#ch-families .to-hint { font-size: 13.5px; color: var(--ink-soft); line-height: 1.45; }

#ch-families .tree-leaf { margin-top: 14px; }
#ch-families .leaf-label {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--ink-soft); margin-bottom: 9px;
}
#ch-families .leaf-chips { display: flex; flex-wrap: wrap; gap: 8px; }
#ch-families .leaf-why {
  margin-top: 14px; font-size: 16px; line-height: 1.6; max-width: 64ch;
}
#ch-families .leaf-said {
  margin-top: 10px; font-size: 13.5px; color: var(--ink-soft);
  line-height: 1.55; max-width: 64ch;
}

@media (prefers-reduced-motion: reduce) {
  #ch-families .lens-btn,
  #ch-families .tree-opt { transition: none; }
  #ch-families .tree-opt:hover { transform: none; }
}
