/* css/botnav.css */

:root {
  --botnav-h: 52px;
}

.botnav {
  display: none;
}

@media (max-width: 767.98px) {
  .botnav {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    height: calc(var(--botnav-h) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    /* Стекло: тот же оттенок, что был сплошным фоном (--c-ink-2), но
       полупрозрачный + блюр контента под панелью. */
    background: color-mix(in srgb, var(--c-ink-2) 70%, transparent);
    backdrop-filter: blur(20px) saturate(1.4);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    transition: transform var(--dur-ui) var(--ease-soft);
  }

  /* Старые браузеры без backdrop-filter — полупрозрачный фон без блюра
     нечитаем, оставляем сплошной, как было раньше. */
  @supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .botnav {
      background: var(--c-ink-2);
    }
  }

  .botnav.is-hidden {
    transform: translateY(100%);
  }

  /* Открытая модалка (проекта и т.п.) — панель полностью убрана, не просто
     задвинута transform-ом, чтобы точно не перекрывала контент модалки. */
  body.has-open-modal .botnav {
    display: none;
  }

  body {
    padding-bottom: calc(var(--botnav-h) + env(safe-area-inset-bottom));
    /* body сам по себе белый (base.css) — без этого в зарезервированной
       под botnav полосе снизу (после последней секции — футера) просвечивал
       бы белый фон body, а не тёмный фон футера/панели над ним. */
    background: var(--c-ink);
  }
}

.botnav__list {
  display: flex;
  align-items: stretch;
  height: var(--botnav-h);
  margin: 0;
  padding-inline: 8px;
  list-style: none;
}

.botnav__list > li {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
}

.botnav__link {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  overflow: hidden;
  text-align: center;
  color: color-mix(in srgb, var(--c-body-dark), var(--c-white) 25%);
  transition: color var(--dur-ui) var(--ease-soft);
}

/* Тонкая линия сверху над активным пунктом, шириной в сам пункт */
.botnav__link.is-active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--c-accent);
}

.botnav__label {
  font-family: var(--f-body);
  font-size: 12px;
  line-height: 1;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.botnav__link.is-active {
  color: var(--c-white);
}

.botnav__link.is-active .botnav__label {
  font-weight: 500;
}

@media (prefers-reduced-motion: reduce) {
  .botnav {
    transition: none;
  }
}
