/* FEARX Food Map - nav.css
 * Responsive primary navigation: left sidebar rail on PC, bottom bar on mobile.
 * Single markup adapts via media queries. Loaded in base.html for all pages.
 */

:root {
  --rail-w: 72px;
  --bar-h: 42px;
}

.nav-rail {
  position: fixed;
  z-index: 1000;
  background: var(--surface);
  display: flex;
  font-family: inherit;
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--muted);
  gap: 3px;
  transition: color 0.15s, background 0.15s;
  flex-direction: column;
  padding: 6px 4px;
}
.nav-item:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.nav-item[aria-current="page"] { color: var(--accent-text); }
.nav-item[aria-current="page"] .nav-icon { transform: scale(1.05); }

.nav-icon {
  font-size: 22px;
  line-height: 1;
  transition: transform 0.15s;
}
.nav-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: -0.2px;
  white-space: nowrap;
}

/* FEARX logo at top of rail */
.nav-logo {
  display: block;
  width: 40px; height: 40px;
  border-radius: 9px;
  background: var(--surface-2) center/cover no-repeat;
  background-image: url('/fearx-logo.jpg');
  flex-shrink: 0;
  margin: 0 auto;
}
.nav-logo-link { padding: 8px 0; display: block; }

/* On PC the FEARX logo lives only in the nav rail — hide the duplicate logo-mark
   inside the panel header. The title text stays. */
@media (min-width: 861px) {
  .panel .logo-mark { display: none; }
}

/* PC: left vertical rail */
@media (min-width: 861px) {
  .nav-rail {
    top: 0; left: 0; bottom: 0;
    width: var(--rail-w);
    flex-direction: column;
    border-right: 1px solid var(--border);
    padding-top: 10px;
    gap: 2px;
  }
  .nav-item {
    width: 100%;
    height: 60px;
  }
  /* Page content shifts right to leave room for the rail.
     Use width+left atomic to reduce layout thrashing that may cause Leaflet flicker on drag. */
  body .app, body .menu-overlay, body #kitchenBgFrame {
    left: var(--rail-w);
    width: calc(100% - var(--rail-w));
  }
}

/* Mobile: bottom horizontal bar */
@media (max-width: 860px) {
  .nav-rail {
    left: 0; right: 0; bottom: 0;
    height: var(--bar-h);
    flex-direction: row;
    border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom, 0);
  }
  .nav-item {
    flex: 1;
    height: 100%;
    gap: 0;
    padding: 2px 4px;
  }
  .nav-icon { font-size: 14px; line-height: 1; }
  .nav-label { font-size: 9px; letter-spacing: -0.3px; }
  /* Hide logo on mobile (logo already in panel header) */
  .nav-logo-link { display: none; }
  /* Page content leaves room for the bar at bottom */
  body .app, body .menu-overlay {
    bottom: calc(var(--bar-h) + env(safe-area-inset-bottom, 0px));
  }
}
