/* The BVC bar — ONE stylesheet for the homepage and every project page.
   Markup: _includes/bar.html. Behaviour: js/nav.js (scrollspy +
   hamburger), js/theme.js (toggle). The bar is always dark, in both
   colour themes. Self-contained: tokens are scoped to the component;
   hosts only adjust placement (e.g. project.css full-bleeds it over the
   page padding). */

.bvc-bar {
  --bar-bg: #212529;
  --bar-ink: #ffffff;
  --bar-accent: #C00404;   /* Brown red; constant — the bar never changes theme */
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0.4rem 0;
  background: var(--bar-bg);
  /* Self-contained typography: match the homepage's body metrics so the
     bar renders identically regardless of the host page's own type. */
  font-family: "freight-sans-pro", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}
/* Replicates Bootstrap 5's .container exactly (the homepage wraps its
   nav in one): the 0.75rem side padding sits INSIDE the max-width, so
   content spans e.g. 1116px of a 1140px box — not the full 1140px. */
.bvc-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1em;
  width: 100%;
  padding: 0 0.75rem;
  margin: 0 auto;
}
/* Bootstrap 5 .container widths; the parent site caps .container at 1140px. */
@media (min-width: 576px)  { .bvc-bar-inner { max-width: 540px; } }
@media (min-width: 768px)  { .bvc-bar-inner { max-width: 720px; } }
@media (min-width: 992px)  { .bvc-bar-inner { max-width: 960px; } }
@media (min-width: 1200px) { .bvc-bar-inner { max-width: 1140px; } }

/* Mini logo: crest + "BVC" in Minion. */
.bvc-bar a.bvc-home {
  display: inline-flex;
  align-items: center;
  font-family: "minion-3", Georgia, serif;
  font-size: 1.5rem;
  color: var(--bar-ink);
  text-decoration: none;
  white-space: nowrap;
}
.bvc-bar a.bvc-home:hover,
.bvc-bar a.bvc-home:focus { color: var(--bar-ink); text-decoration: none; }
.bvc-bar a.bvc-home img {
  height: 40px;
  width: auto;
  /* nudge up so the crest's shield aligns with the text cap-height */
  transform: translateY(-4px);
}
.bvc-bar a.bvc-home span { padding-left: 5px; }

/* Section links. Inline on desktop; collapsed behind the hamburger
   below 992px. The .active link (scrollspy) gets a brand-red underline
   drawn with ::after so the text stays vertically centred. */
.bvc-links {
  display: flex;
  flex-wrap: wrap;
  flex: 1;
  margin-left: 1.25rem;
}
.bvc-links a {
  color: rgba(255, 255, 255, 0.82);
  padding: 0.25rem 0.6rem;
  text-decoration: none;
  white-space: nowrap;
  position: relative;
  transition: color 0.15s ease;
}
.bvc-links a:hover, .bvc-links a:focus { color: #ffffff; text-decoration: none; }
.bvc-links a.active { color: #ffffff; }
@media (min-width: 992px) {
  .bvc-links a.active::after {
    content: '';
    position: absolute;
    left: 0.6rem;
    right: 0.6rem;
    bottom: 0;
    height: 2px;
    background-color: var(--bar-accent);
  }
}

/* Right cluster: theme toggle + social icons + hamburger. */
.bvc-bar-right { display: flex; align-items: center; }
.bvc-bar .theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: none;
  background: none;
  color: var(--bar-ink);
  cursor: pointer;
}
.bvc-bar .theme-toggle svg { width: 20px; height: 20px; vertical-align: middle; }
.bvc-bar .theme-toggle:hover { opacity: 0.7; }
.bvc-bar .theme-toggle:focus { outline: none; }
.bvc-bar .social-link {
  display: inline-block;
  margin-left: 16px;
  line-height: 1;
  color: var(--bar-ink);
}
.bvc-bar .social-link svg { width: 20px; height: 20px; vertical-align: middle; }
.bvc-bar .social-link:hover { opacity: 0.7; }
.bvc-hamburger {
  display: none;
  border: none;
  background: none;
  color: var(--bar-ink);
  padding: 0.25rem 0.4rem;
  margin-left: 12px;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}
.bvc-hamburger svg { width: 1em; height: 1em; vertical-align: middle; }
.bvc-hamburger:focus { outline: none; }

/* Small screens: smaller logo, tighter icons, links collapse behind the
   hamburger and drop below the bar as a full-width column; the active
   link gets a red left bar instead of the underline. */
@media (max-width: 575.98px) {
  .bvc-bar a.bvc-home { font-size: 15px; }
  .bvc-bar a.bvc-home img { height: 30px; transform: translateY(-3px); }
  .bvc-bar .social-link { margin-left: 12px; }
}
@media (max-width: 991.98px) {
  .bvc-bar-inner { flex-wrap: wrap; }
  .bvc-hamburger { display: inline-flex; }
  .bvc-links { display: none; }
  .bvc-bar.open .bvc-links {
    display: flex;
    flex-direction: column;
    order: 10;
    flex-basis: 100%;
    margin-left: 0;
    padding: 0.4rem 0 0.2rem;
  }
  .bvc-bar.open .bvc-links a { padding-top: 0.45rem; padding-bottom: 0.45rem; }
  .bvc-bar.open .bvc-links a.active {
    border-left: 3px solid var(--bar-accent);
    padding-left: calc(0.6rem - 3px);
  }
}

@media print {
  .bvc-bar { display: none; }
}
