/* TOFANTARA — Shared Navigation styles (B1b)
 * Companion to assets/nav.js. Drives layout via <html data-view>:
 *   desktop  -> fixed left sidebar, no bottom bar, content shifted right.
 *   mobile/Android -> bottom bar, sidebar hidden.
 * Also hides legacy per-page navs (<aside class="sidebar"> / .bnav) so no
 * duplicated navigation appears. Pages loading this stylesheet opt into the
 * shared shell. home.html keeps its approved B0 shell and does not load this.
 */

/* ---------- Sidebar (hidden by default = mobile-first) ---------- */
.tf-sidebar {
  display: none;
  box-sizing: border-box;
  z-index: 40;
}

/* ---------- Bottom bar (mobile / Android) ---------- */
.tf-bnav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  display: flex;
  background: #ffffff;
  border-top: 1px solid #e7ece8;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, .07);
  padding-bottom: env(safe-area-inset-bottom);
}
.tf-bnav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 9px 0 11px;
  text-decoration: none;
  color: #9aa6a0;
  font-weight: 600;
  font-size: 10px;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}
.tf-bnav a.active { color: #2d6a4f; }
.tf-bnav a .i { font-size: 20px; line-height: 1; }

/* ---------- Desktop (>=900px, except forced-Android) ---------- */
@media (min-width: 900px) {
  html:not([data-view="android"]) .tf-sidebar {
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 240px;
    background: #0f3d22;
    color: #eafff3;
    box-shadow: 4px 0 18px rgba(15, 40, 28, .12);
  }
  html:not([data-view="android"]) .tf-bnav { display: none; }
  html:not([data-view="android"]) body { padding-left: 240px; }
}

/* ---------- Android always mobile ---------- */
html[data-view="android"] .tf-bnav { display: flex; }
html[data-view="android"] .tf-sidebar { display: none; }
html[data-view="android"] body { padding-left: 0; }

/* ---------- Sidebar branding + menu ---------- */
.tf-sidebar .tf-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
  flex-shrink: 0;
}
.tf-sidebar .tf-logo { width: 40px; height: 40px; border-radius: 11px; overflow: hidden; flex-shrink: 0; }
.tf-sidebar .tf-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tf-sidebar .tf-brandtxt b { display: block; font-size: 15px; color: #fff; font-family: 'Segoe UI', system-ui, sans-serif; }
.tf-sidebar .tf-brandtxt small { font-size: 11px; opacity: .8; font-family: 'Segoe UI', system-ui, sans-serif; }
.tf-sidebar .tf-menu {
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  overflow-y: auto;
  margin: 0;
}
.tf-sidebar .tf-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 11px;
  color: #d3efe0;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  font-family: 'Segoe UI', system-ui, sans-serif;
}
.tf-sidebar .tf-menu a:hover { background: rgba(255, 255, 255, .09); color: #fff; }
.tf-sidebar .tf-menu a.active { background: #2ba55d; color: #fff; }
.tf-sidebar .tf-menu a .i { width: 20px; height: 20px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; font-size: 16px; }

/* ---------- Content bottom padding for desktop-style pages on mobile ---------- */
html[data-view="mobile"] .app main,
html[data-view="android"] .app main { padding-bottom: 76px; }

/* ---------- Hide legacy per-page nav so only shared nav shows ---------- */
.phone .bnav,
aside.sidebar,
.app .sidebar { display: none !important; }

/* ---------- Print: hide nav, reset padding ---------- */
@media print {
  .tf-sidebar, .tf-bnav { display: none !important; }
  body { padding-left: 0 !important; }
}
