/* Общая шапка сайта с бургер-меню (index, account, privacy). Разметка — в каждом HTML, логика — site-menu.js. */

@font-face {
  font-family: "Bebas Neue";
  src: url("/bebas-neue.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

.sh {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 64px;
  padding: 0 max(10px, calc((100% - 1080px) / 2 - 10px)) 0 max(16px, calc((100% - 1080px) / 2));
  background: rgba(10, 10, 9, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.sh-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
  min-width: 0;
  color: var(--text);
  text-decoration: none;
  font-family: "Bebas Neue", "Arial Narrow", "PT Sans Narrow", sans-serif;
  font-size: 30px;
  line-height: 1;
  letter-spacing: 0.5px;
}

.sh-brand img { height: 30px; width: auto; display: block; }
.sh-brand span { color: var(--accent); }

.sh-icon,
.sh button.sh-icon,
.sm button.sh-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  border-radius: 10px;
  background: none;
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
}

.sh .sh-icon:hover,
.sm .sh-icon:hover { background: rgba(255, 255, 255, 0.07); }
.sh-icon:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.sh-icon[hidden] { display: none; }

.sh-icon svg,
.sm-item svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: block;
}

/* Вошедший пользователь: точка-индикатор у иконки аккаунта */
.sh-icon.is-signed-in::after {
  content: "";
  position: absolute;
  top: 9px;
  right: 9px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 2px #0a0a09;
}

/* ---- Выезжающее меню ---- */

.sm-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000; /* выше слоёв Leaflet и плавающих панелей карты */
  background: rgba(0, 0, 0, 0.55);
}

.sm-overlay[hidden] { display: none; }

.sm {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 2001;
  width: min(340px, 86vw);
  display: flex;
  flex-direction: column;
  background: #121211;
  border-left: 1px solid var(--border);
  transform: translateX(100%);
  visibility: hidden;
  transition: transform 0.25s ease, visibility 0.25s ease;
}

.sm.is-open { transform: none; visibility: visible; }

.sm-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  padding: 0 10px 0 20px;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  font-size: 15px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1.2px;
}

.sm-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 10px 10px 20px;
}

.sm-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sm-sep {
  height: 1px;
  margin: 10px 10px;
  background: var(--border);
}

.sm-item {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 12px 12px;
  border: none;
  border-radius: 10px;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 16px;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.sm-item svg { width: 22px; height: 22px; color: var(--muted); flex: 0 0 auto; }
.sm-item:hover { background: rgba(255, 255, 255, 0.06); }
.sm-item:hover svg { color: var(--accent); }
.sm-item:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.sm-item[hidden] { display: none; }

.sm-item[aria-current="page"] {
  background: rgba(212, 194, 79, 0.12);
  color: var(--accent);
}

.sm-item[aria-current="page"] svg { color: var(--accent); }

.sm-item .sm-ext {
  margin-left: auto;
  color: var(--muted);
  font-size: 13px;
}

.sm-foot {
  padding: 14px 22px 22px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.sm-foot a { color: var(--muted); }
.sm-foot a:hover { color: var(--accent); }

html.sm-locked,
html.sm-locked body { overflow: hidden; }

@media (max-width: 420px) {
  .sh-brand { font-size: 26px; }
  .sh-brand img { height: 26px; }
  .sh-icon { width: 40px; height: 40px; }
}

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

/* Баннер о cookie (логика — в конце site-menu.js). */
.cookie-notice {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  z-index: 2000;
  display: flex;
  align-items: center;
  gap: 14px;
  width: min(720px, calc(100% - 32px));
  box-sizing: border-box;
  padding: 12px 14px;
  background: #141412;
  color: #e8e6d8;
  border: 1px solid #2c2b25;
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.55);
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.cookie-notice p { margin: 0; flex: 1; min-width: 0; }
.cookie-notice a { color: #d4c24f; }
.cookie-notice button {
  flex: none;
  padding: 8px 16px;
  background: #d4c24f;
  color: #151510;
  border: 1px solid #d4c24f;
  border-radius: 6px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.cookie-notice button:focus-visible, .cookie-notice a:focus-visible { outline: 2px solid #d4c24f; outline-offset: 2px; }
@media (max-width: 560px) {
  .cookie-notice { flex-direction: column; align-items: stretch; bottom: 8px; font-size: 13px; }
}

/* Движение в шапке и меню на всех страницах. */
@keyframes sh-item-in { from { opacity: 0; translate: 24px 0; } to { opacity: 1; translate: none; } }
@keyframes sh-glitch {
  0%, 100% { transform: none; filter: none; }
  20% { transform: translate(-2px, 1px) skewX(-6deg); filter: drop-shadow(2px 0 #c8553d) drop-shadow(-2px 0 #6fb0c8); }
  40% { transform: translate(2px, -1px); filter: drop-shadow(-2px 0 #c8553d) drop-shadow(2px 0 #6fb0c8); }
  60% { transform: translate(-1px, 0) skewX(4deg); filter: none; }
}
@keyframes sh-notice-in { from { opacity: 0; translate: 0 24px; } to { opacity: 1; translate: none; } }
@keyframes sh-fade { from { opacity: 0; } to { opacity: 1; } }

.sh-brand:hover img { animation: sh-glitch 0.45s steps(2, end) 1; }
.sh-brand span { transition: text-shadow 0.3s; }
.sh-brand:hover span { text-shadow: 0 0 14px rgba(212, 194, 79, 0.6); }
.sh-icon { transition: background 0.15s, transform 0.15s; }
.sh-icon:active { transform: scale(0.9); }
.sm-overlay:not([hidden]) { animation: sh-fade 0.25s ease both; }
.sm.is-open .sm-list > li { animation: sh-item-in 0.35s cubic-bezier(.2, .7, .2, 1) both; }
.sm.is-open .sm-list > li:nth-child(2) { animation-delay: 0.04s; }
.sm.is-open .sm-list > li:nth-child(3) { animation-delay: 0.08s; }
.sm.is-open .sm-list > li:nth-child(4) { animation-delay: 0.12s; }
.sm.is-open .sm-list > li:nth-child(5) { animation-delay: 0.16s; }
.sm.is-open .sm-list > li:nth-child(6) { animation-delay: 0.2s; }
.sm-item svg { transition: color 0.15s, transform 0.25s cubic-bezier(.3, 1.6, .5, 1); }
.sm-item:hover svg { transform: scale(1.12); }
.cookie-notice { animation: sh-notice-in 0.5s 0.6s cubic-bezier(.2, .7, .2, 1) both; }

@media (prefers-reduced-motion: reduce) {
  .sh-brand:hover img, .sm.is-open .sm-list > li, .sm-overlay:not([hidden]), .cookie-notice { animation: none; }
  .sm-item svg, .sh-icon { transition: none; }
}
