/* ============================================================
   Bottom Navigation
   5 items: 지도 / 목록 / 기여 / 내정보 / 소개
   ============================================================ */

/* Floating nav: detached from the very bottom so the full-bleed map shows
   around, below, and behind it (no opaque white strip against the browser
   chrome). It rides above the iOS home indicator via safe-area-inset. */
.nav {
  position: fixed;
  bottom: calc(env(safe-area-inset-bottom, 0px) + var(--space-3));
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 2 * var(--space-4));
  max-width: calc(var(--layout-max-width) - 2 * var(--space-4));
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: var(--color-surface);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  z-index: var(--z-nav);
}

@media (min-width: 768px) {
  .nav {
    /* Docked at the bottom of the desktop card (not floating) */
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    transform: none;
    width: auto;
    max-width: none;
    border: 0;
    border-top: 1px solid var(--color-border-subtle);
    border-radius: 0 0 var(--radius-2xl) var(--radius-2xl);
    box-shadow: none;
    overflow: hidden;
  }
}

.nav__item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  height: var(--nav-height);
  color: var(--color-text-tertiary);
  font-size: var(--font-size-2xs);
  font-weight: var(--font-weight-medium);
  letter-spacing: var(--letter-spacing-wide);
  transition:
    color var(--duration-fast) var(--easing-standard),
    background-color var(--duration-fast) var(--easing-standard);
}

.nav__item:hover,
.nav__item:focus-visible {
  background-color: var(--color-surface-tonal);
}

.nav__item:active {
  background-color: var(--color-brand-primary-tint);
}

.nav__item[aria-current="page"] {
  color: var(--color-brand-primary);
}

.nav__item[aria-current="page"]::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 32px;
  height: 2px;
  background: var(--color-brand-primary);
  border-radius: 0 0 var(--radius-full) var(--radius-full);
}

.nav__icon {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  stroke-width: 1.75;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
