/* ==========================================================================
   bar.css — single source of truth for the bottom navigation bar
   Linked by every page that has a <nav><div class="tabbar">…</div></nav>.
   Colors come from --bar-bg / --bar-border (light-glass fallback below), so
   the bar no longer depends on each page's drifted --glass / --glass-b tokens.
   A page can theme the bar (e.g. main.html dark mode) by setting those two
   variables in its own :root.
   ========================================================================== */

nav {
  position: fixed;
  bottom: 10px;
  width: 100%;
  display: flex;
  justify-content: center;
  z-index: 999;
}

.tabbar {
  width: min(900px, 94vw);
  display: flex;
  justify-content: space-between;
  gap: 8px;
  background: var(--bar-bg, rgba(255, 255, 255, 0.36));
  border: 1px solid var(--bar-border, rgba(0, 0, 0, 0.08));
  border-radius: 18px;
  backdrop-filter: blur(12px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
  padding: 10px 16px;
}

.tab {
  flex: 1 1 0;
  min-width: 0;            /* let tabs shrink so a 5-tab bar never overflows on mobile */
  text-align: center;
  padding: 12px 8px;
  border-radius: 12px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  transition: background 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
  font-size: clamp(13px, 2.2vw, 18px);
}

/* Narrow phones: tighten spacing so all tabs (incl. the maple leaf) fit. */
@media (max-width: 480px) {
  .tabbar { gap: 4px; padding: 8px 10px; }
  .tab { padding: 10px 4px; font-size: clamp(11px, 3vw, 15px); }
  .tab img { width: clamp(16px, 4.5vw, 22px); }
}

.tab.active {
  color: var(--brand);
  background: rgba(230, 57, 70, 0.15);
}

.tab:hover {
  background: rgba(230, 57, 70, 0.05);
  color: var(--brand);
  box-shadow: 0 4px 12px rgba(230, 57, 70, 0.25);
}

.tab.active:hover {
  background: rgba(230, 57, 70, 0.25);
  color: var(--brand);
  box-shadow: 0 6px 18px rgba(230, 57, 70, 0.35);
}

/* maple icon tab – responsive size */
.tab img {
  display: block;
  margin: 0 auto;
  pointer-events: none;
  width: clamp(18px, 4vw, 26px);
  height: auto;
}
