/* The header menu with the niche tree and the link block inside a guide.

The same skeleton on every chain of the family: the menu carries every niche
page in four levels (family, the family inside a family, the pages, the index
of all niches), and every niche guide ends with a block of live links of the
same family. The menu itself is pulled into the page from one shared file,
so the pages stay light.
*/
.bf-menu { position: relative; }
.bf-menu > summary {
  cursor: pointer; list-style: none; color: var(--ink-2); font-weight: 600;
  font-size: 15px; padding: 8px 2px; border-bottom: 2px solid transparent;
  display: inline-flex; align-items: center;
}
.bf-menu > summary::-webkit-details-marker { display: none; }
.bf-menu > summary::after { content: " ▾"; font-size: 11px; color: var(--muted); }
.bf-menu[open] > summary { color: var(--brand-strong); border-bottom-color: var(--brand); }
.bf-menu__panel {
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 120;
  width: min(1180px, 94vw); max-height: 72vh; overflow: auto;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px 22px;
  padding: 20px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 18px; box-shadow: var(--shadow-card);
}
.bf-menu__group { border-top: 1px solid var(--line); padding-top: 10px; }
.bf-menu__group > summary {
  cursor: pointer; list-style: none; font-size: 13px; letter-spacing: .02em;
  text-transform: uppercase; color: var(--muted); margin: 0 0 8px;
}
.bf-menu__group > summary::-webkit-details-marker { display: none; }
.bf-menu__group > summary::after { content: " \25BE"; font-size: 10px; }
.bf-menu__group[open] > summary { color: var(--brand-strong); }
.bf-menu__group > summary a { color: inherit; text-decoration: none; }
.bf-menu__group > summary a:hover { color: var(--brand-strong); }
.bf-menu__count {
  display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px;
  background: var(--line); color: var(--muted); font-size: 11px; letter-spacing: 0;
}
.bf-menu__subs { display: grid; gap: 4px; }
.bf-menu__sub > summary {
  cursor: pointer; list-style: none; font-size: 13px; color: var(--ink-2);
  font-weight: 600; margin: 2px 0 4px;
}
.bf-menu__sub > summary::-webkit-details-marker { display: none; }
.bf-menu__sub > summary::before { content: "\25B8 "; color: var(--muted); font-size: 10px; }
.bf-menu__sub[open] > summary::before { content: "\25BE "; }
.bf-menu__group ul { list-style: none; margin: 0 0 8px; padding: 0; columns: 2; column-gap: 16px; }
.bf-menu__group li { break-inside: avoid; margin: 0 0 6px; font-size: 13.5px; }
.bf-menu__group a { color: var(--ink-2); text-decoration: none; }
.bf-menu__group a:hover { color: var(--brand-strong); text-decoration: underline; }
.bf-menu__more { grid-column: 1 / -1; padding-top: 12px; border-top: 1px solid var(--line); }
.bf-menu__more a { color: var(--brand-strong); font-weight: 600; text-decoration: none; }
.bf-menu__more a:hover { text-decoration: underline; }

/* the related block inside a niche guide */
.bf-related {
  margin: 18px 0 22px; padding: 16px 18px; border: 1px solid var(--line);
  border-radius: 16px; background: var(--soft);
}
.bf-related__title {
  margin: 0 0 10px; font-size: 12.5px; letter-spacing: .04em;
  text-transform: uppercase; color: var(--muted); font-weight: 700;
}
.bf-related ul { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.bf-related li a {
  display: inline-block; padding: 7px 12px; border-radius: 999px; background: var(--surface);
  border: 1px solid var(--line); color: var(--ink-2); font-size: 13.5px; text-decoration: none;
}
.bf-related li a:hover { border-color: var(--brand); color: var(--brand-strong); }
.bf-related__all { font-size: 13.5px; font-weight: 650; color: var(--brand-strong); text-decoration: none; }
.bf-related__all:hover { text-decoration: underline; }

@media (max-width: 900px) {
  .bf-menu__panel { grid-template-columns: repeat(2, minmax(0, 1fr)); width: 92vw; }
}
@media (max-width: 560px) {
  .bf-menu__panel { grid-template-columns: 1fr; max-height: 64vh; }
  .bf-menu__group ul { columns: 1; }
}
