/* ==========================================================================
   ШАПКА 2026 — «Интересная Россия»
   Подключается ПОСЛЕ styles.css, чтобы перекрывать старые правила.
   ========================================================================== */

:root {
    /* цвета берутся из общей палитры в начале styles.css */
    --hdr-navy:        var(--c-navy);
    --hdr-navy-2:      #17274a;
    --hdr-nav-bg:      var(--c-navy-2);
    --hdr-blue:        var(--c-accent);
    --hdr-blue-dark:   var(--c-accent-dark);
    --hdr-red:         var(--c-red);
    --hdr-red-dark:    #b8172a;
    --hdr-text:        #ffffff;
    --hdr-text-dim:    rgba(255,255,255,.72);
    --hdr-radius:      10px;
}

/* --------------------------------------------------------------------------
   1. ОБЩИЙ КОНТЕЙНЕР
   Приём margin/padding 1000px — растягиваем фон на всю ширину экрана,
   оставляя контент внутри колонки .wrap-center (1280px).
   -------------------------------------------------------------------------- */
.hdr {
    position: relative;
    z-index: 100;
}

.hdr-top,
.hdr-nav,
.hdr-search {
    margin: 0 -1000px;
    padding-left: 1000px;
    padding-right: 1000px;
}

/* --------------------------------------------------------------------------
   2. ВЕРХНЯЯ ПОЛОСА: логотип, слоган, погода, поиск
   -------------------------------------------------------------------------- */
.hdr-top {
    padding-top: 18px;
    padding-bottom: 18px;
    background-color: var(--hdr-navy);
    background-image:
        linear-gradient(90deg,
            rgba(16,29,56,.97) 0%,
            rgba(16,29,56,.92) 38%,
            rgba(16,29,56,.55) 68%,
            rgba(16,29,56,.35) 100%),
        url('../images/nebo3.jpg');
    background-size: auto, 120% auto;
    background-repeat: no-repeat, no-repeat;
    background-position: center, left center;
    animation: hdrClouds 60s ease-in-out infinite alternate;
}

@keyframes hdrClouds {
    0%   { background-position: center, left center; }
    100% { background-position: center, right center; }
}

.hdr-top-in {
    display: flex;
    align-items: center;
    gap: 22px;
}

/* --- бургер (только мобильные) --- */
.hdr .btn-menu {
    display: none;
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    line-height: 42px;
    text-align: center;
    font-size: 22px;
    margin: 0;
    cursor: pointer;
    color: #fff;
    border-radius: 8px;
    background: rgba(255,255,255,.12);
}

/* --- логотип --- */
.hdr .site-branding {
    flex: 0 0 auto;
    margin: 0;
    padding: 0;
    display: block;
    text-align: left;
}

.hdr .site-logotype {
    margin: 0;
    line-height: 0;
}

.hdr .site-logotype img {
    display: block;
    width: auto;
    height: 54px;
    max-height: 54px;
}

/* --- слоган --- */
.hdr-slogan {
    flex: 1 1 auto;
    min-width: 0;
    color: var(--hdr-text-dim);
    font-size: 14px;
    line-height: 1.35;
    padding-left: 22px;
    border-left: 1px solid rgba(255,255,255,.18);
}

/* --- правый блок --- */
.hdr-tools {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 14px;
}

/* --- виджет погоды (модуль DLE) --- */
.hdr-weather {
    display: flex;
    align-items: center;
    padding: 6px 14px;
    min-height: 46px;
    border-radius: 999px;
    background: rgba(255,255,255,.10);
    border: 1px solid rgba(255,255,255,.18);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

/* переопределяем инлайновые стили модуля json_openweathermap_pogoda_one_day.php */
.hdr-weather .pogod__box {
    background: none;
    box-shadow: none;
    padding: 0;
    border-radius: 0;
    color: #fff;
    font-family: inherit;
}

.hdr-weather .pogod__main {
    margin-right: 13px;
    padding-right: 13px;
    border-right: 1px solid rgba(255,255,255,.22);
}

.hdr-weather .pogod__main img {
    width: 30px;
    height: 30px;
    margin-right: 9px;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,.45)) saturate(1.35) brightness(1.12);
}

.hdr-weather .pogod__tem {
    font-size: 21px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -.5px;
}

.hdr-weather .pogod__wea {
    gap: 10px;
    font-size: 12px;
    color: rgba(255,255,255,.72);
}

.hdr-weather .pogod__city {
    padding-left: 13px;
    text-transform: uppercase;
    font-size: 10px;
    letter-spacing: .5px;
    color: rgba(255,255,255,.55);
}

/* --- круглая кнопка поиска ---
   класс .search-btn в разметке обязателен: он исключает кнопку из глобального
   зелёного правила button:not(...):not(.search-btn) в styles.css          */
.hdr .hdr-search-btn {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255,255,255,.20);
    border-radius: 50%;
    cursor: pointer;
    background: rgba(255,255,255,.10);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    color: #fff;
    font-size: 17px;
    line-height: 1;
    box-shadow: none;
    transition: background .25s, color .25s, border-color .25s;
}

.hdr .hdr-search-btn:hover {
    background: #fff;
    border-color: #fff;
    color: var(--hdr-navy);
}

.hdr .hdr-search-btn.is-active {
    background: var(--hdr-blue);
    border-color: var(--hdr-blue);
    color: #fff;
}

/* в открытом состоянии лупа превращается в крестик */
.hdr .hdr-search-btn.is-active .fa-search::before { content: "\f00d"; }

/* --------------------------------------------------------------------------
   3. ВЫПАДАЮЩАЯ СТРОКА ПОИСКА
   -------------------------------------------------------------------------- */
.hdr-search {
    background: var(--hdr-navy-2);
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s ease;
}

.hdr-search.is-open { max-height: 120px; }

.hdr-search-in { padding: 16px 0; }

.hdr-search .search-box { margin: 0; position: relative; }

.hdr-search .search-box input {
    width: 100%;
    height: 46px;
    padding: 0 56px 0 18px;
    border-radius: var(--hdr-radius);
    border: 0;
    background: #fff;
    font-size: 15px;
}

.hdr .hdr-search .search-box button {
    position: absolute;
    right: 0;
    top: 0;
    width: 52px;
    height: 46px;
    line-height: 46px;
    padding: 0;
    border: 0;
    background: none;
    box-shadow: none;
    color: #12203c;
    font-size: 16px;
    cursor: pointer;
    border-radius: 0 var(--hdr-radius) var(--hdr-radius) 0;
}

.hdr .hdr-search .search-box button:hover { color: var(--hdr-blue); background: none; }

/* --------------------------------------------------------------------------
   4. ПАНЕЛЬ НАВИГАЦИИ
   -------------------------------------------------------------------------- */
.hdr-nav {
    background: var(--hdr-nav-bg);
    box-shadow: 0 4px 14px rgba(0,0,0,.18);
}

.hdr-nav-in {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 54px;
}

/* --- иконка «домой» --- */
.hdr-nav .nav-home {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    line-height: 40px;
    text-align: center;
    color: #fff;
    font-size: 17px;
    border-radius: 8px;
    transition: background .25s;
}

.hdr-nav .nav-home:hover { background: rgba(255,255,255,.12); }

/* --- само меню --- */
.hdr-menu {
    display: flex;
    align-items: center;
    flex: 1 1 auto;
    min-width: 0;
    gap: 2px;
    margin: 0;
    padding: 0;
    list-style: none;
    background: none;
    width: auto;
}

.hdr-menu > li { position: relative; }

.hdr-menu > li > a {
    display: block;
    white-space: nowrap;
    color: var(--hdr-text-dim);
    text-transform: uppercase;
    font-weight: 500;
    font-size: 13.5px;
    letter-spacing: .2px;
    line-height: 36px;
    padding: 0 13px;
    border-radius: 8px;
    transition: color .25s, background .25s;
}

.hdr-menu > li > a:hover {
    color: #fff;
    background: rgba(255,255,255,.1);
}

.hdr-menu > li.is-active > a,
.hdr-menu > li > a.is-active {
    color: #fff;
    background: var(--hdr-blue);
    box-shadow: 0 3px 10px rgba(47,128,237,.4);
}

/* --- правый блок навигации --- */
.hdr-nav-right {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    padding-left: 10px;
}

/* --- кнопка LIVE --- */
.nav-live {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 34px;
    padding: 0 16px;
    border-radius: 8px;
    color: #fff !important;
    background: var(--hdr-red);
    font-weight: 700;
    font-size: 13px;
    letter-spacing: .6px;
    box-shadow: 0 0 0 0 rgba(224,32,52,.7);
    animation: hdrPulse 2s infinite;
    transition: background .25s;
}

.nav-live:hover { background: var(--hdr-red-dark); }

.nav-live .fa-play,
.nav-live .fas { font-size: 10px; }

@keyframes hdrPulse {
    0%   { box-shadow: 0 0 0 0   rgba(224,32,52,.65); }
    70%  { box-shadow: 0 0 0 9px rgba(224,32,52,0); }
    100% { box-shadow: 0 0 0 0   rgba(224,32,52,0); }
}

/* --- соцсети (иконки — встроенные SVG, всегда однотонные) --- */
.nav-soc {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: #fff;
    background: rgba(255,255,255,.10);
    border: 1px solid rgba(255,255,255,.14);
    transition: background .25s, border-color .25s;
}

.nav-soc svg {
    display: block;
    width: 17px;
    height: 17px;
    fill: currentColor;
}

.nav-soc:hover {
    background: var(--hdr-blue);
    border-color: var(--hdr-blue);
}

/* оптическая подгонка: у иконок разные пропорции */
.nav-soc--dzen svg { width: 18px; height: 18px; }
.nav-soc--ok   svg { width: 15px; height: 15px; }
.nav-soc--vk   svg { width: 18px; height: 18px; }

/* --------------------------------------------------------------------------
   5. АДАПТИВ
   -------------------------------------------------------------------------- */

/* Планшеты и узкие ноутбуки: меню прокручивается по горизонтали */
@media screen and (max-width: 1180px) {
    .hdr-menu {
        overflow-x: auto;
        overflow-y: hidden;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .hdr-menu::-webkit-scrollbar { display: none; }
    .hdr-menu > li > a { font-size: 13px; padding: 0 10px; }
    .hdr-slogan { display: none; }
}

@media screen and (max-width: 1100px) {
    .hdr .btn-menu { display: block; }
    .hdr-nav .nav-home { display: none; }
}

@media screen and (max-width: 900px) {
    .hdr-top { padding-top: 12px; padding-bottom: 12px; }
    .hdr-top-in { gap: 14px; }
    .hdr .site-logotype img { height: 42px; max-height: 42px; }
    .hdr-weather { display: none; }
    .hdr-nav-in { min-height: 48px; }
}

@media screen and (max-width: 760px) {
    .hdr .site-logotype img { height: 34px; max-height: 34px; }
    .hdr .btn-menu { width: 38px; height: 38px; line-height: 38px; font-size: 20px; }
    .hdr-search-btn { width: 40px; height: 40px; flex-basis: 40px; line-height: 40px; font-size: 16px; }
    .nav-soc { display: none; }
    .nav-live { height: 30px; padding: 0 12px; font-size: 12px; }
    .hdr-menu > li > a { line-height: 32px; font-size: 12.5px; padding: 0 9px; }
}

@media screen and (max-width: 420px) {
    .hdr .site-logotype img { height: 28px; max-height: 28px; }
}

/* --------------------------------------------------------------------------
   6. СБРОС СТИЛЕЙ ВНУТРИ БОКОВОЙ МОБИЛЬНОЙ ПАНЕЛИ
   (libs.js клонирует .to-mob в #side-panel)
   -------------------------------------------------------------------------- */
.side-panel .hdr-menu {
    display: block;
    overflow: visible;
    background: var(--hdr-nav-bg);
    margin: 0 -20px 20px -20px;
    padding: 0;
    width: calc(100% + 40px);
}

.side-panel .hdr-menu > li > a {
    display: block;
    line-height: 44px;
    padding: 0 20px;
    border-radius: 0;
    border-bottom: 1px solid rgba(255,255,255,.15);
    color: #fff;
    background: none;
    box-shadow: none;
}

.side-panel .hdr-menu > li.is-active > a { background: rgba(0,0,0,.22); }
