/* ========== Public Navbar ========== */
:root {
   --brand: #0b5fff;
   --white: #ffffff;
   --text: #111827;
   --radius: 8px;
}

header.site {
   background: var(--footer-bg);;
   color: var(--white);
}

header .bar {
   display: flex;
   align-items: center;
   justify-content: space-between;
   padding: 12px 0;
}

.brand {
   color: var(--white);
   text-decoration: none;
   font-weight: 700;
}

.userbox {
   display: flex;
   align-items: center;
   gap: 14px;
}

.pill {
   background: rgba(255, 255, 255, 0.15);
   padding: 6px 10px;
   border-radius: 999px;
}
.pill-link {
   text-decoration: none;
   color: inherit;
   cursor: pointer;
}
.pill-link:hover {
   text-decoration: none;
   opacity: 0.9;
}

.btn,
.link {
   display: inline-block;
   background: var(--white);
   color: var(--brand);
   text-decoration: none;
   border-radius: var(--radius);
   padding: 8px 12px;
   border: 0;
   cursor: pointer;
}

.btn-outline {
   background: transparent;
   color: var(--white);
   border: 1px solid rgba(255, 255, 255, 0.5);
}

/* Responsive */
@media (max-width: 640px) {
   .userbox {
      gap: 8px;
   }
   .pill {
      padding: 5px 8px;
   }
   .btn,
   .link {
      padding: 8px 10px;
   }
}

/* --- burger for public navbar --- */
header.site .bar {
   position: relative;
}

/* кнопка */
.nav-toggle {
   display: none;
   border: 0;
   background: transparent;
   width: 40px;
   height: 40px;
   align-items: center;
   justify-content: center;
   border-radius: 8px;
   cursor: pointer;
   flex-direction: column;
   gap: 6px;
}
.nav-toggle .line {
   display: block;
   width: 22px;
   height: 2px;
   background: #fff;
   transition:
      transform 0.2s ease,
      opacity 0.2s ease;
}
/* крестик при открытии */
header.site.is-open .nav-toggle .line:nth-child(1) {
   transform: translateY(8px) rotate(45deg);
}
header.site.is-open .nav-toggle .line:nth-child(2) {
   opacity: 0;
}
header.site.is-open .nav-toggle .line:nth-child(3) {
   transform: translateY(-8px) rotate(-45deg);
}

/* меню */
.site-nav {
   display: flex;
   align-items: center;
   gap: 14px;
}

/* мобильное поведение */
@media (max-width: 780px) {
   .nav-toggle {
      display: inline-flex;
   }
   .site-nav {
      position: absolute;
      right: 16px;
      top: 100%;
      display: none;
      flex-direction: column;
      align-items: stretch;
      gap: 10px;
      background: #0b5fff;
      color: #fff;
      border: 1px solid rgba(255, 255, 255, 0.15);
      border-radius: 12px;
      padding: 12px;
      width: min(92vw, 320px);
      box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
   }
   header.site.is-open .site-nav {
      display: flex;
   }
   .site-nav a.link,
   .site-nav .btn,
   .site-nav form {
      width: 100%;
      display: block;
   }
   .site-nav form .btn {
      width: 100%;
   }
   .site-nav .userbox {
      flex-direction: column;
      align-items: stretch;
      gap: 10px;
   }
}

/* десктоп: обычный инлайн-нав */
@media (min-width: 781px) {
   .site-nav {
      position: static;
      background: transparent;
      border: none;
      padding: 0;
      box-shadow: none;
   }
}
/* улучшения доступности/поведения */
.nav-toggle:focus {
   outline: none;
}
.nav-toggle:focus-visible {
   box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.35);
   border-radius: 10px;
}
.nav-toggle:active {
   transform: translateY(1px);
}
header.site.is-open .site-nav {
   z-index: 60;
} /* поверх контента */
@media (prefers-reduced-motion: reduce) {
   .nav-toggle,
   .nav-toggle .line {
      transition: none !important;
   }
}
