/* ─── Bottom Nav (モバイル専用グローバルナビ) ──────────────────────────── */
/* 表示: **1023px 以下**。1024px 以上は左の常設 drawer (pinned) が 5 目的地を持つので出さない。
   🔴 閾値が 768 でなく 1024 なのは owner 裁定 2026-09-05 — 常設 drawer は 300px 幅なので、
   768 で pin すると本文が 468px = 縦持ち phone と大差ない箱に desktop 版が入る (iPad 縦
   768〜834 が丸ごとこの帯)。⇒ **768〜1023 は header + この bar で常設ナビを保つ**ことで、
   `ART_DIRECTION.md:15-16`「768px 以上では常設ナビを持つ」を条文どおり満たしたまま
   squeeze を避ける (条文の改訂は不要)。⚠ 閾値は `shared/css/layout/drawer.css` の
   pinned media query と `ui/shell/useWideChrome.ts` の `PINNED_DRAWER_MIN_WIDTH` と同値。 */

/* === バー本体 === */
.bnav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  display: flex;
  align-items: stretch;
  background: var(--t-surface);
  border-top: 1px solid var(--t-border);
  padding-bottom: env(safe-area-inset-bottom, 0);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

@media (min-width: 1024px) {
  .bnav { display: none !important; }
}

/* ドメインページ (view-selector が代替) では非表示 */
body[data-page="domain"] .bnav { display: none !important; }

/* === タブ === */
.bnav-tab {
  flex: 1;
  min-height: 52px;
  padding: 0.4rem 0.2rem 0.3rem;
  background: none;
  border: none;
  color: var(--t-muted);
  font-family: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0.12rem;
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.bnav-tab:active {
  background: color-mix(in srgb, var(--t-accent) 8%, transparent);
}

.bnav-icon {
  font-size: 1.35rem;
  line-height: 1;
  display: block;
}

.bnav-label {
  font-size: 0.62rem;
  line-height: 1;
  white-space: nowrap;
}

.bnav-tab.is-active {
  color: var(--t-accent);
  /* 現在地は色 + もう 1 チャネル (ART_DIRECTION §4) — accent はモノクロ ink で本文色と
     ほぼ同値なので、色だけでは無変化に見える。 */
  font-weight: 700;
}

/* light theme ではアクセントが暗いので fg に override (view-selector と同じ規律) */
:where(html, body)[data-theme="light"] .bnav-tab.is-active {
  color: var(--t-fg);
}

/* === body の padding-bottom (ナビ高さ分) === */
/* ⚠ bar が出る帯と**同じ上限**にする — 768〜1023 で bar だけ出して余白を付け忘れると、
   本文の末尾が bar の裏に隠れる。
   🔴 高さは token `--t-bnav-h` (= タブの min-height 52 + border-top 1 = 53) — literal 52 だと
     border の 1px を落とし、最下端まで送っても本文末尾が 1px だけ bar の裏に残っていた
     (BACKLOG `WEB-BNAV-H-LITERAL`・同じ literal を持っていた sheet は WEB-NAV-B で撤去)。 */
@media (max-width: 1023px) {
  body[data-bnav] {
    padding-bottom: calc(var(--t-bnav-h, 53px) + env(safe-area-inset-bottom, 0px));
  }
}
