/* SUNDUQ v143 — шапка в одну строку + меню поверх плеера радио.
   Заменяет header-city-v142.css.

   Что было не так: шапка главной — CSS-сетка с жёсткими колонками
   (grid-template-columns: 1fr auto). Добавленные кнопка «☰» и выбор
   города в эти колонки не поместились и перенеслись второй строкой,
   налезая на ленту.

   Решение: на узких экранах шапка становится обычной строкой (flex),
   всё выстраивается по горизонтали, а выбор города уезжает в меню —
   в шапке телефона ему всё равно не хватает места. */

/* ------------------------------------------------- панель фильтров долой */
.nhFilterBar { display: none !important; }

/* ------------------------------------------------------- город в шапке */
.suHeaderCity { position: relative; margin-left: 10px; }

.suHeaderCity > button,
.suHeaderCity .nhCitySelect > button {
  display: inline-flex; align-items: center; gap: 7px;
  height: 42px; padding: 0 14px;
  border: 1px solid #1b3d52; border-radius: 14px;
  background: #091d2c; color: #dfeaf2;
  font: inherit; font-size: 14.5px; font-weight: 600;
  cursor: pointer; white-space: nowrap; min-width: 0;
}
.suHeaderCity button:hover { background: #102b3d; border-color: #31556c; }
.suHeaderCity button i { font-style: normal; color: #6f8da1; font-size: 12px; }
.suHeaderCity button > span:first-child { color: #f0184f; font-size: 10px; }

.suHeaderCity .nhCityMenu {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 220;
  min-width: 190px; background: #0e1e2e; border: 1px solid #1c3348;
  border-radius: 12px; box-shadow: 0 14px 34px rgba(0,0,0,.5); padding: 6px;
}
.suHeaderCity .nhCityMenu.hidden { display: none; }
.suHeaderCity .nhCityMenu button {
  display: block; width: 100%; text-align: left; height: auto;
  background: transparent; border: 0; color: #e8eef5;
  padding: 9px 12px; border-radius: 8px; font: inherit; font-size: 14.5px; cursor: pointer;
}
.suHeaderCity .nhCityMenu button:hover { background: #12283b; }

/* --------------------------------------------- типы под кнопкой «☷» */
.nhTypeFilters.suTypesTucked { display: none; gap: 8px; flex-wrap: wrap; padding: 10px 0 4px; }
.nhTypeFilters.suTypesTucked.su-open { display: flex; }

/* ------------------------------------------------ меню разделов */
.suHomeMenuBtn {
  display: none; width: 42px; height: 42px; flex: 0 0 auto;
  border: 1px solid #1b3d52; border-radius: 14px;
  background: #091d2c; color: #dfeaf2; font-size: 19px;
  cursor: pointer; place-items: center; margin-right: 10px;
}
.suHomeMenu {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: min(86vw, 330px); z-index: 9800;
  background: #06111b; border-right: 1px solid #1c3348;
  padding: 16px 12px; overflow-y: auto;
  box-shadow: 0 0 60px rgba(0,0,0,.6);
}
.suHomeMenu.hidden { display: none; }
.suHomeMenu a {
  display: block; padding: 12px 14px; border-radius: 11px;
  color: #e8eef5; text-decoration: none; font-size: 15.5px;
}
.suHomeMenu a:hover { background: #12283b; }
.suHomeMenuShade {
  position: fixed; inset: 0; z-index: 9790;
  background: rgba(3,10,17,.6); backdrop-filter: blur(2px);
}
.suHomeMenuShade.hidden { display: none; }

/* Город, переехавший внутрь меню. */
.suHomeMenu .suHeaderCity {
  margin: 0 0 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #1c3348;
}
.suHomeMenu .suHeaderCity > button,
.suHomeMenu .suHeaderCity .nhCitySelect > button { width: 100%; justify-content: flex-start; height: 46px; }
.suHomeMenu .suHeaderCity .nhCityMenu { position: static; box-shadow: none; margin-top: 6px; width: 100%; }

/* ============================================ мобильный: одна строка */
@media (max-width: 900px) {

  /* Ключевое: сетка превращается в строку, поэтому ничего не переносится. */
  header.nhTop {
    display: flex !important;
    align-items: center;
    flex-wrap: nowrap !important;
    gap: 8px;
    height: 58px !important;
    padding: 0 12px !important;
    overflow: hidden;
  }
  header.nhTop .nhBrand { flex: 1 1 auto; min-width: 0; overflow: hidden; }
  header.nhTop .nhBrandText { min-width: 0; overflow: hidden; }
  header.nhTop .nhBrandText b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; font-size: 16px !important; }
  header.nhTop .nhBrandText small { display: none !important; }
  header.nhTop .nhMainNav { display: none !important; }

  header.nhTop .nhHeaderActions {
    display: flex !important;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
    margin-left: auto;
  }
  /* Круглые кнопки в шапке телефона не нужны: поиск, сообщения
     и уведомления есть в нижней панели. */
  header.nhTop .nhHeaderActions .nhCircleBtn { display: none !important; }

  /* Город в шапке телефона не помещается — он переезжает в меню. */
  header.nhTop .suHeaderCity { display: none !important; }

  header.nhTop .nhUserMenuWrap { display: flex !important; align-items: center; gap: 4px; flex: 0 0 auto; }
  header.nhTop .nhAuthBox { display: flex !important; }
  header.nhTop .nhUserArrow { display: none !important; }
  header.nhTop .nhWriteBtn { display: none !important; }

  .suHomeMenuBtn { display: grid !important; width: 40px; height: 40px; margin-right: 0; }

  /* Общая шапка внутренних страниц: возвращаем вход. */
  .suTop .suUser #authBox { display: flex !important; align-items: center; }

  .suTop .suUser #authBox button,
  .suTop .suUser #authBox .profile,
  header.nhTop .nhAuthBox button,
  header.nhTop .nhAuthBox .profile,
  header.nhTop .nhAuthBox a {
    display: inline-flex; align-items: center; gap: 6px;
    height: 38px; padding: 0 13px; border-radius: 12px;
    border: 1px solid #1b3d52; background: #091d2c; color: #e8eef5;
    font: inherit; font-size: 13.5px; font-weight: 600;
    text-decoration: none; white-space: nowrap;
    max-width: 128px; overflow: hidden; text-overflow: ellipsis;
  }
  .suTop .suUser #authBox button,
  header.nhTop .nhAuthBox button {
    background: #f0184f; border-color: #f0184f; color: #fff;
  }
}

@media (max-width: 420px) {
  header.nhTop .nhBrandText b { font-size: 15px !important; }
  header.nhTop .nhAuthBox button,
  header.nhTop .nhAuthBox .profile,
  header.nhTop .nhAuthBox a { max-width: 104px; }
}

/* ------------------------------------------------------- светлая тема */
body.siteTheme-light .suHeaderCity > button,
body.siteTheme-light .suHeaderCity .nhCitySelect > button,
body.siteTheme-light .suHomeMenuBtn { background: #fff; border-color: #dbe6f0; color: #102033; }
body.siteTheme-light .suHeaderCity .nhCityMenu,
body.siteTheme-light .suHomeMenu { background: #fff; border-color: #dbe6f0; }
body.siteTheme-light .suHeaderCity .nhCityMenu button,
body.siteTheme-light .suHomeMenu a { color: #102033; }
body.siteTheme-light .suHeaderCity .nhCityMenu button:hover,
body.siteTheme-light .suHomeMenu a:hover { background: #f1f6fb; }

/* ---------------------------------------------- меню и плеер радио
   У мини-плеера радио z-index 9700 — он оказывался поверх открытого
   меню и перекрывал пункты. Меню поднято выше, а сам плеер на время
   прячется: два слоя друг на друге всё равно нечитаемы. */
body.su-menu-open #su112MiniRadio,
body.su-menu-open .su112MiniRadio,
body.su-menu-open #su127Restore { display: none !important; }

/* Нижняя панель навигации тоже уходит под меню. */
body.su-menu-open .nhMobileNav,
body.su-menu-open .su112MobileNav { z-index: 1 !important; }
