/* Navigation pieces: logo, top-bar links, breadcrumb, progress chip, burger, lesson tree and pager. */

/* logo: SVG files from static/img; the light and dark variants swap by theme */
.logo { display: inline-flex; align-items: center; height: 24px; flex: none; }
.logo img { height: 22px; width: auto; display: block; }
.logo .logo-dark { display: none; }
:root[data-theme="dark"] .logo .logo-light { display: none; }
:root[data-theme="dark"] .logo .logo-dark { display: block; }

.crumb { color: var(--muted); font-size: 14px; display: flex; gap: var(--s-2); align-items: center; min-width: 0; }
.crumb b { color: var(--text); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top nav a { color: var(--text); margin: 0 10px; font-size: 14px; }
.top nav a.active { color: var(--accent); font-weight: 600; }

.chip {
  display: inline-flex; align-items: center; gap: var(--s-2); white-space: nowrap;
  background: var(--accent-soft); color: var(--accent);
  border-radius: var(--r-pill); padding: var(--s-1) var(--s-3); font-size: 13px; font-weight: 600;
}
.chip .bar { width: 70px; height: 5px; background: color-mix(in srgb, var(--accent) 25%, transparent); border-radius: var(--r-3); overflow: hidden; }
.chip .bar i { display: block; height: 100%; width: calc(var(--p, 0) * 1%); background: var(--accent); } /* --p = percent, supplied by the template */

.burger { display: none; }

.tree { list-style: none; margin: 0; padding: 0; }
.tree > li { margin: 2px 0; }
.tree .topic {
  display: flex; align-items: center; gap: 10px; padding: var(--s-2) 10px; border-radius: var(--r); min-height: 38px;
  color: var(--text); font-weight: 500; font-size: 14px;
}
.tree .topic:hover { background: var(--surface-2); text-decoration: none; }
.tree .topic.open { background: var(--accent-soft); color: var(--accent); }
.tree .topic.locked { color: var(--muted); }
.tree .num { font-family: var(--mono); font-size: 12px; color: var(--muted); width: 22px; }
.tree .topic.open .num { color: var(--accent); }
.tree .state { margin-left: auto; font-size: 13px; }
.tree .state.done { color: var(--ok); }
.tree .state.now { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.tree .sub { list-style: none; margin: 2px 0 6px var(--s-5); padding: 0 0 0 18px; border-left: 1px solid var(--border); }
.tree .sub a { display: flex; gap: var(--s-2); align-items: center; padding: 7px 10px; border-radius: var(--r-m); font-size: 13.5px; color: var(--text); min-height: 36px; }
.tree .sub a:hover { background: var(--surface-2); text-decoration: none; }
.tree .sub a.current { color: var(--accent); font-weight: 600; background: var(--accent-soft); }
.tree .sub a .dot { width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid var(--border); flex: none; }
.tree .sub a.done .dot { background: var(--ok); border-color: var(--ok); }
.tree .sub a.current .dot { background: var(--accent); border-color: var(--accent); }

.pager { display: flex; gap: 10px; justify-content: space-between; align-items: center; margin-top: 48px; padding-top: var(--s-5); border-top: 1px solid var(--border); flex-wrap: wrap; }
.pager .btn { white-space: normal; text-align: center; }

@media (max-width: 860px) {
  .top nav, .crumb, .chip { display: none; }
  .burger { display: inline-flex; }
  .tree .topic, .tree .sub a { min-height: 44px; }
}
