/* The site shell (#626/#627, #97): the one top bar and the breadcrumb of every
   page of the site: the hub, the project pages, the game, the docs
   (mkdocs-material) and the API reference (Doxygen). Its markup is
   topbar.html; its colours, radii and fonts are tokens.css (loaded before
   this file); day/night follows html[data-theme] (theme.js), else the OS. */
.ahn-bar {
  position: sticky; top: 0; z-index: 50; box-sizing: border-box;
  background: var(--surface); color: var(--ink); border-bottom: 1px solid var(--border);
  font: 600 15px/1.3 var(--font);
}
.ahn-bar * { box-sizing: border-box; }
.ahn-row { display: flex; align-items: center; gap: 6px 10px; min-height: 48px; padding: 4px 16px; }
.ahn-brand { display: inline-flex; align-items: center; gap: 9px; margin-right: 6px; color: var(--ink); text-decoration: none;
  font: 800 17px/1.2 var(--font-display); letter-spacing: -0.01em; white-space: nowrap; }
.ahn-logo { width: 26px; height: 26px; border-radius: 50%; flex: none; background:
  radial-gradient(circle at 35% 40%, var(--accent) 0 22%, transparent 23%),
  radial-gradient(circle at 62% 58%, var(--accent) 0 18%, transparent 19%), var(--accent-soft); }
.ahn-tops { display: flex; align-items: center; gap: 2px; flex: 1; min-width: 0; }
.ahn-top { padding: 7px 12px; border-radius: var(--r-pill); color: var(--ink-2); text-decoration: none; font: 700 15px/1.3 var(--font); white-space: nowrap; }
.ahn-top:hover { background: var(--surface-2); color: var(--ink); }
.ahn-top[aria-current] { background: var(--accent-soft); color: var(--ink); box-shadow: inset 0 0 0 1px var(--border); }
.ahn-ext { margin-left: auto; }
.ahn-ext::after { content: "↗" / ""; margin-left: 4px; font-size: 0.8em; color: var(--ink-3); }
.ahn-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 36px; height: 36px; padding: 0 9px;
  border-radius: var(--r-md); border: 1px solid var(--border); background: var(--surface-2); color: var(--ink-2);
  font: 700 15px var(--font); text-decoration: none; cursor: pointer;
}
.ahn-btn:hover { border-color: var(--accent); color: var(--ink); }
.ahn-menu { display: none; }
.ahn-bar a:focus-visible, .ahn-bar button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* AntHocNet's own row: its name (the project page), its places, the docs search */
.ahn-row2 { min-height: 42px; padding-top: 3px; padding-bottom: 3px; background: var(--surface-2); border-top: 1px solid var(--border); }
.ahn-here { color: var(--ink); text-decoration: none; font: 800 15px/1.3 var(--font-display); white-space: nowrap; }
.ahn-here::after { content: "›" / ""; margin-left: 10px; color: var(--ink-3); font-weight: 600; }
.ahn-here:hover { text-decoration: underline; }
.ahn-places { display: flex; gap: 2px; min-width: 0; }
.ahn-place { display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px; border-radius: var(--r-pill); color: var(--ink-2);
  text-decoration: none; font: 700 14px/1.3 var(--font); white-space: nowrap; }
.ahn-place i { width: 10px; height: 10px; border-radius: var(--r-xs); display: inline-block; }
.ahn-place[data-place="guide"] i { background: var(--place-guide); }
.ahn-place[data-place="lab"] i { background: var(--place-lab); }
.ahn-place[data-place="shop"] i { background: var(--place-shop); }
.ahn-place[data-place="arch"] i { background: var(--place-arch); }
.ahn-place:hover { background: var(--surface); color: var(--ink); }
.ahn-place[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--border); }
.ahn-search { position: relative; margin-left: auto; }
.ahn-search input {
  width: 260px; max-width: 34vw; padding: 6px 12px; border-radius: var(--r-pill);
  border: 1px solid var(--border); background: var(--well); color: var(--ink);
  font: 600 14px var(--font);
}
.ahn-search input::placeholder { color: var(--ink-3); opacity: 1; }
.ahn-search input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.ahn-results {
  position: absolute; right: 0; top: calc(100% + 6px); width: min(480px, 92vw); max-height: 60vh; overflow: auto;
  margin: 0; padding: 6px; list-style: none; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--elev);
}
.ahn-results a { display: block; padding: 8px 10px; border-radius: var(--r-md); color: var(--ink); text-decoration: none; }
.ahn-results a:hover, .ahn-results a:focus { background: var(--accent-soft); outline: none; }
.ahn-results small { display: block; color: var(--ink-3); font-weight: 500; }
.ahn-results .ahn-place-tag { font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.ahn-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (max-width: 720px) {
  /* Phone: one row (the brand, Menu, day/night); the places and AntHocNet's
     row open under it. The bar scrolls away with the page. Without script
     (no .js on <html>, theme.js sets it) everything stays open and wraps. */
  .ahn-bar { position: relative; }
  .ahn-row { flex-wrap: wrap; padding: 4px 10px; }
  .ahn-brand { margin-right: auto; }
  .ahn-tops { order: 9; flex: 0 0 100%; flex-direction: column; align-items: stretch; padding: 4px 0 8px; }
  .ahn-top { padding: 10px 12px; border-radius: var(--r-md); }
  .ahn-ext { margin-left: 0; }
  .ahn-row2 { padding: 8px 10px; }
  .ahn-places { flex: 1 1 100%; flex-wrap: wrap; order: 2; }
  .ahn-search { order: 3; flex: 1 1 100%; margin-left: 0; }
  .ahn-search input { width: 100%; max-width: none; }
  .js .ahn-menu { display: inline-flex; }
  .js .ahn-bar:not(.ahn-open) .ahn-tops, .js .ahn-bar:not(.ahn-open) .ahn-row2 { display: none; }
}

/* The breadcrumb (#652, #97): the trail from the site root to the page, on
   every page; the AntHocNet place is in its colour. A crumb bar pairs it with
   the page's counterpart link (the game and AntHocNet's project page point at
   each other there). */
.ahn-crumb { min-width: 0; font: 700 14px var(--font); color: var(--ink-3); }
.ahn-crumb ol { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; margin: 0; padding: 0; list-style: none; }
.ahn-crumb li { display: inline-flex; align-items: center; gap: 6px; min-width: 0; margin: 0; }
.ahn-crumb li + li::before { content: "›" / ""; color: var(--ink-3); }
.ahn-crumb a { color: inherit; text-decoration: none; }
.ahn-crumb a:hover, .ahn-crumb a:focus-visible { text-decoration: underline; }
.ahn-crumb [aria-current="page"] { color: var(--ink); font-weight: 800; overflow-wrap: anywhere; }
.ahn-crumb[data-place] li:nth-child(3) > * { font-weight: 800; }
.ahn-crumb[data-place="guide"] li:nth-child(3) > * { color: var(--place-guide); }
.ahn-crumb[data-place="lab"] li:nth-child(3) > * { color: var(--place-lab); }
.ahn-crumb[data-place="shop"] li:nth-child(3) > * { color: var(--place-shop); }
.ahn-crumb[data-place="arch"] li:nth-child(3) > * { color: var(--place-arch); }
.ahn-crumbbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px; }
.ahn-pair { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: var(--r-pill);
  border: 1px solid var(--border); background: var(--surface); color: var(--link); text-decoration: none; font: 700 14px var(--font); }
.ahn-pair:hover { border-color: var(--accent); }
