/* ============================================
   Bottom tab bar — fixed mobile navigation.
   Mobile-first, designed for Turbo Native WebView.
   Uses design tokens from application.css :root.
   ============================================ */

/* ============================================
   Bar container: fixed to the bottom of the
   viewport with a safe-area inset for notched
   devices (iPhone X+).
   ============================================ */
.tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding-bottom: env(safe-area-inset-bottom, 0);
  box-shadow: 0 -2px 12px rgba(27, 42, 74, 0.06);
}

/* ============================================
   Individual tab: column layout with icon + label.
   ============================================ */
.tab-bar-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.125rem;
  flex: 1;
  padding: 0.5rem 0.25rem;
  min-height: 3.25rem;
  text-decoration: none;
  color: var(--color-muted);
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: var(--font-weight-medium);
  letter-spacing: 0.01em;
  transition: color 150ms ease;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}

.tab-bar-tab:hover {
  color: var(--color-accent);
}

.tab-bar-tab:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: -2px;
  border-radius: var(--radius-sm);
}

/* ============================================
   Active tab: navy icon + gold underline accent.
   ============================================ */
.tab-bar-tab.is-active {
  color: var(--color-accent);
  font-weight: var(--font-weight-semibold);
}

.tab-bar-tab.is-active .tab-bar-icon {
  position: relative;
}

.tab-bar-tab.is-active .tab-bar-icon::after {
  content: "";
  position: absolute;
  bottom: -0.1875rem;
  left: 50%;
  transform: translateX(-50%);
  width: 1rem;
  height: 2px;
  background: var(--color-gold);
  border-radius: 1px;
}

/* ============================================
   Icon: fixed size container for inline SVGs.
   ============================================ */
.tab-bar-icon {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
}

.tab-bar-icon svg {
  width: 100%;
  height: 100%;
}

/* ============================================
   Label
   ============================================ */
.tab-bar-label {
  line-height: 1;
  white-space: nowrap;
}

/* ============================================
   Body padding: prevent page content from being
   hidden behind the fixed tab bar.
   ============================================ */
body.has-tab-bar {
  padding-bottom: calc(3.75rem + env(safe-area-inset-bottom, 0));
}

/* ============================================
   Desktop (>600px): tabs slightly larger,
   bar stays fixed at bottom.
   ============================================ */
@media (min-width: 600px) {
  .tab-bar-tab {
    font-size: 0.75rem;
    gap: 0.25rem;
    padding: 0.625rem 0.5rem;
    min-height: 3.5rem;
  }

  .tab-bar-icon {
    width: 1.375rem;
    height: 1.375rem;
  }
}

/* ============================================
   Reduced motion
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  .tab-bar-tab {
    transition-duration: 0s;
  }
}
