/* ============================================================
   header.css — Шапка сайта
   АНО «Бессмертный подвиг защитников Отечества»
   v2.2 (2026-09-21)

   Требует: style.css уже подключён (переменные --bpzo-*)
   Брейкпоинты: 992 / 768 / 480 / 360

   Изменения v2.2:
   - ЛОГОТИП УВЕЛИЧЕН:
       @992: 130 → 160
       @768: 100 → 130
       @480: 84 → 110
       @360: 72 → 96
   - H1 УВЕЛИЧЕН:
       @992: 2.1rem → 2.5rem
       @768: 1.7rem → 2.1rem
       @480: 1.4rem → 1.8rem
       @360: 1.2rem → 1.5rem
   - Расшифровка «АНО» увеличена:
       @992: 1.15rem → 1.3rem
       @768: 1rem → 1.15rem
       @480: 0.95rem → 1rem
       @360: 0.85rem → 0.95rem
   - Бургер крупнее:
       @992: 42 → 46
       @480: 40 → 42
       @360: 38 → 40
   - Padding лого-области увеличен (больше воздуха)
   - gap в .container увеличен: 12 → 16/20px

   Изменения v2.1:
   - Лента возвращена
   - Шапка на мобильных перестроена в колонку
   - Бургер справа в углу .logo-area
   ============================================================ */

/* ===== SKIP-LINK ===== */
.skip-link {
    position: absolute;
    top: -60px;
    left: 12px;
    z-index: 10000;
    padding: 10px 20px;
    background: var(--bpzo-light, #FFD700);
    color: var(--bpzo-dark, #1B2A4A);
    text-decoration: none;
    font-weight: 700;
    border-radius: 0 0 8px 8px;
    transition: top 0.25s ease;
}

.skip-link:focus,
.skip-link:focus-visible {
    top: 0;
    outline: 3px solid var(--bpzo-dark, #1B2A4A);
    outline-offset: 2px;
}

/* ============================================================
   ВЕРХНЯЯ ПАНЕЛЬ
   ============================================================ */
.top-bar {
    background: rgba(1, 87, 155, 0.85);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    padding: 6px 0;
    border-bottom: 1px solid rgba(212, 175, 55, 0.3);
    position: relative;
    z-index: 20;
}

.top-bar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.top-bar-left,
.top-bar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.live-clock {
    font-size: 0.9rem;
    color: var(--bpzo-light, #FFD700);
    font-weight: 700;
    background: rgba(0, 0, 0, 0.5);
    padding: 3px 12px;
    border-radius: 20px;
    font-variant-numeric: tabular-nums;
    border: 1px solid rgba(212, 175, 55, 0.3);
    letter-spacing: 0.5px;
}

.top-bar-link,
.top-bar-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    background: rgba(0, 0, 0, 0.2);
    color: var(--bpzo-light, #FFD700);
    border: 1px solid rgba(255, 215, 0, 0.55);
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.25s ease;
    line-height: 1.2;
    font-family: inherit;
}

.top-bar-link:hover,
.top-bar-link:focus-visible,
.top-bar-btn:hover,
.top-bar-btn:focus-visible {
    background: var(--bpzo-accent, #FFF176);
    color: var(--bpzo-dark, #1B2A4A);
    border-color: var(--bpzo-accent, #FFF176);
    transform: translateY(-1px);
    outline: none;
}

.top-bar-link--logout {
    border-color: var(--bpzo-error, #CD5C5C);
    color: #ff8a8a;
}

.top-bar-link--logout:hover,
.top-bar-link--logout:focus-visible {
    background: var(--bpzo-error, #CD5C5C);
    color: #fff;
    border-color: var(--bpzo-error, #CD5C5C);
}

/* ============================================================
   ЛОГОТИПЫ + НАЗВАНИЕ
   ============================================================ */
.logo-area {
    position: relative;
    width: 100%;
    padding: 0;
    min-height: 180px;
    background: linear-gradient(135deg, #01579B 0%, #0277BD 100%);
    overflow: hidden;
}

.logo-area::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.08);
    opacity: 1;
    z-index: 1;
    pointer-events: none;
}

.logo-area::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url('/images/stars_Images/stars.png');
    background-repeat: repeat;
    background-size: 600px 600px;
    opacity: 0.35;
    pointer-events: none;
    z-index: 2;
    animation: starsMove 400s linear infinite;
    transform: translateZ(0);
}

.logo-area .container {
    position: relative;
    z-index: 3;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

/* ============================================================
   ЛЕВЫЙ ЛОГОТИП (десктоп)
   ============================================================ */
.logo-area img.logo-left {
    height: 170px;
    width: auto;
    max-width: 170px;
    flex-shrink: 0;
    transition: transform 0.3s ease;
    object-fit: contain;
    display: block;
}

.logo-area img.logo-left:hover {
    transform: scale(1.04);
}

/* ============================================================
   БЛОК НАЗВАНИЯ
   ============================================================ */
.site-title {
    flex: 1;
    text-align: center;
    min-width: 0;
}

.site-title h1 {
    font-family: 'Times New Roman', Times, Georgia, serif;
    font-size: 2.35rem;
    font-weight: 700;
    color: var(--bpzo-primary, #D4AF37);
    text-shadow:
        0 0 15px rgba(212, 175, 55, 0.55),
        0 2px 5px rgba(0, 0, 0, 0.9);
    line-height: 1.05;
    margin: -35px 0 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    letter-spacing: 0.3px;
}

.site-title p {
    font-family: 'Times New Roman', Times, Georgia, serif;
    color: var(--bpzo-red, #D52B1E);
    font-size: 1.35rem;
    font-weight: 600;
    line-height: 1.35;
    margin: 4px 0 0;
    letter-spacing: 0.2px;
    text-shadow:
        0 1px 3px rgba(0, 0, 0, 0.85),
        0 0 8px rgba(213, 43, 30, 0.25);
}

.site-title p + p {
    margin-top: 12px;
}

.site-title p strong {
    font-weight: 700;
    letter-spacing: 1.5px;
    margin-right: 2px;
}

/* ============================================================
   ГЛАВНОЕ МЕНЮ
   ============================================================ */
.main-menu {
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    padding: 4px 0;
    border-top: 1px solid rgba(212, 175, 55, 0.15);
    border-bottom: 1px solid rgba(212, 175, 55, 0.15);
    position: relative;
    z-index: 15;
}

.main-menu .container {
    position: relative;
}

.menu-row {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    justify-content: center;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
}

.menu-row > li {
    position: relative;
}

.menu-row > li > a {
    color: var(--bpzo-primary, #D4AF37);
    text-decoration: none;
    font-weight: 600;
    padding: 8px 14px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.9rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    line-height: 1.3;
}

.menu-row > li > a:hover,
.menu-row > li > a:focus-visible,
.menu-row > li > a.active {
    color: var(--bpzo-accent, #FFF176);
    background: rgba(255, 215, 0, 0.12);
    outline: none;
}

.menu-row .arrow {
    font-size: 0.6rem;
    margin-left: 2px;
    transition: transform 0.2s ease;
    display: inline-block;
    opacity: 0.7;
}

.menu-row > li.has-dropdown:hover .arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%) translateY(-6px);
    min-width: 220px;
    max-width: 90vw;
    background: rgba(26, 42, 74, 0.98);
    border-radius: 0 0 12px 12px;
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-top: 2px solid var(--bpzo-primary, #D4AF37);
    padding: 8px 0;
    z-index: 1000;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    list-style: none;
    margin: 0;
    white-space: nowrap;
}

.menu-row > li.has-dropdown:hover .dropdown-menu,
.menu-row > li.has-dropdown:focus-within .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.menu-row > li:first-child .dropdown-menu {
    left: 0;
    transform: translateX(0) translateY(-6px);
}
.menu-row > li:first-child:hover .dropdown-menu {
    transform: translateX(0) translateY(0);
}

.menu-row > li:last-child .dropdown-menu {
    left: auto;
    right: 0;
    transform: translateX(0) translateY(-6px);
}
.menu-row > li:last-child:hover .dropdown-menu {
    transform: translateX(0) translateY(0);
}

.dropdown-menu li a {
    display: block;
    padding: 9px 18px;
    color: var(--bpzo-light, #FFD700);
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.15s ease;
    border-left: 3px solid transparent;
    white-space: normal;
}

.dropdown-menu li a:hover,
.dropdown-menu li a:focus-visible {
    background: rgba(255, 215, 0, 0.12);
    color: var(--bpzo-accent, #FFF176);
    border-left-color: var(--bpzo-light, #FFD700);
    outline: none;
}

/* ============================================================
   КНОПКА HAMBURGER
   ============================================================ */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 46px;
    height: 46px;
    padding: 11px 9px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(212, 175, 55, 0.55);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.25s ease;
    flex-shrink: 0;
}

.mobile-menu-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--bpzo-primary, #D4AF37);
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.mobile-menu-toggle:hover,
.mobile-menu-toggle:focus-visible {
    border-color: var(--bpzo-accent, #FFF176);
    background: rgba(255, 215, 0, 0.12);
    outline: none;
}

body.mobile-menu-open .mobile-menu-toggle span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
body.mobile-menu-open .mobile-menu-toggle span:nth-child(2) {
    opacity: 0;
}
body.mobile-menu-open .mobile-menu-toggle span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ============================================================
   ГЕОРГИЕВСКАЯ ЛЕНТА
   ============================================================ */
.georgian-ribbon {
    width: 100%;
    height: 12px;
    background: linear-gradient(
        to bottom,
        #000 0%, #000 20%,
        var(--bpzo-orange, #FF8C00) 20%, var(--bpzo-orange, #FF8C00) 40%,
        #000 40%, #000 60%,
        var(--bpzo-orange, #FF8C00) 60%, var(--bpzo-orange, #FF8C00) 80%,
        #000 80%, #000 100%
    );
    position: relative;
    overflow: hidden;
    z-index: 10;
}

.georgian-ribbon::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.25), transparent);
    animation: ribbonShine 4s ease-in-out infinite;
    transform: translate3d(-100%, 0, 0);
    will-change: transform;
}

@keyframes ribbonShine {
    0%   { transform: translate3d(-100%, 0, 0); }
    100% { transform: translate3d(100%, 0, 0); }
}

/* ============================================================
   АДАПТИВ
   ============================================================ */

/* -------- 992px: планшет горизонтально -------- */
@media (max-width: 992px) {
    .logo-area {
        min-height: 0;
        padding: 22px 15px 20px;
    }

    .logo-area .container {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 16px;
        text-align: center;
        position: relative;
    }

    /* ЛОГОТИП 160×160 */
    .logo-area img.logo-left {
        height: 160px;
        width: auto;
        max-width: 160px;
        order: 1;
    }

    /* НАЗВАНИЕ — под логотипом */
    .site-title {
        order: 2;
        width: 100%;
        text-align: center;
    }

    /* H1 — 2.5rem, 3D-объём */
    .site-title h1 {
        font-family: 'Times New Roman', Times, Georgia, serif;
        font-size: 2.5rem;
        font-weight: 900;
        color: #FFD700;
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
        line-height: 1.1;
        margin: 0 0 8px;
        letter-spacing: 0.5px;
        text-shadow:
            0 1px 0 #b8941f,
            0 2px 0 #a88317,
            0 3px 0 #98730f,
            0 4px 0 #886307,
            0 5px 8px rgba(0, 0, 0, 0.5),
            0 0 30px rgba(255, 215, 0, 0.45);
    }

    /* Расшифровка «АНО» — 1.3rem */
    .site-title p {
        font-family: 'Times New Roman', Times, Georgia, serif;
        font-size: 1.3rem;
        font-weight: 600;
        line-height: 1.3;
        margin: 6px 0 0;
        color: #D52B1E;
    }

    .site-title p + p {
        margin-top: 8px;
        font-size: 1rem;
        color: rgba(255, 255, 255, 0.75);
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
        font-style: italic;
    }

    /* Бургер — 46×46, в правом верхнем углу */
    .mobile-menu-toggle {
        display: flex;
        position: absolute;
        top: 16px;
        right: 16px;
        z-index: 10;
        width: 46px;
        height: 46px;
        padding: 11px 9px;
    }

    /* Главное меню — скрыто */
    .main-menu {
        display: none;
        padding: 0;
        background: rgba(0, 0, 0, 0.75);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        border-top: 2px solid rgba(212, 175, 55, 0.4);
    }

    body.mobile-menu-open .main-menu {
        display: block;
    }

    .menu-row {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 8px 0;
        margin: 0;
        border-top: none;
        list-style: none;
    }

    .menu-row > li {
        display: block;
        border-bottom: 1px solid rgba(212, 175, 55, 0.1);
    }

    .menu-row > li:last-child {
        border-bottom: none;
    }

    .menu-row > li > a {
        display: flex;
        justify-content: space-between;
        padding: 15px 22px;
        font-size: 1.05rem;
        border-radius: 0;
    }

    .menu-row > li > a.active,
    .menu-row > li > a:hover {
        background: rgba(255, 215, 0, 0.1);
    }

    .dropdown-menu {
        position: static;
        transform: none !important;
        opacity: 1;
        visibility: visible;
        box-shadow: none;
        border: none;
        border-radius: 0;
        background: rgba(0, 0, 0, 0.35);
        max-width: 100%;
        white-space: normal;
        min-width: 0;
        transition: none;
        display: none;
    }

    .menu-row > li.has-dropdown.is-open .dropdown-menu { display: block; }

    .dropdown-menu li a {
        padding: 12px 34px;
        font-size: 0.95rem;
        border-left: none;
        border-top: 1px solid rgba(255, 215, 0, 0.05);
    }

    .menu-row > li.has-dropdown.is-open .arrow { transform: rotate(180deg); }

    .live-clock { display: none; }
    .top-bar-link span,
    .top-bar-btn span { display: none; }
    .top-bar-link,
    .top-bar-btn { padding: 6px 10px; }
}

/* -------- 768px: планшет вертикально -------- */
@media (max-width: 768px) {
    .logo-area { padding: 18px 14px 16px; }
    .logo-area .container { gap: 12px; }

    /* ЛОГОТИП 130×130 */
    .logo-area img.logo-left {
        height: 130px;
        max-width: 130px;
    }

    /* H1 — 2.1rem */
    .site-title h1 {
        font-size: 2.1rem;
        letter-spacing: 0.4px;
        text-shadow:
            0 1px 0 #b8941f,
            0 2px 0 #a88317,
            0 3px 0 #98730f,
            0 4px 6px rgba(0, 0, 0, 0.5),
            0 0 25px rgba(255, 215, 0, 0.4);
    }

    /* АНО — 1.15rem */
    .site-title p {
        font-size: 1.15rem;
    }

    /* 3-ю строку скрываем */
    .site-title p + p {
        display: none;
    }

    /* Бургер 46×46 */
    .mobile-menu-toggle {
        top: 12px;
        right: 12px;
    }
}

/* -------- 480px: мобильный -------- */
@media (max-width: 480px) {
    .logo-area { padding: 16px 12px 14px; }
    .logo-area .container { gap: 10px; }

    /* ЛОГОТИП 110×110 */
    .logo-area img.logo-left {
        height: 110px;
        max-width: 110px;
    }

    /* Бургер 42×42 */
    .mobile-menu-toggle {
        top: 10px;
        right: 10px;
        width: 42px;
        height: 42px;
        padding: 10px 8px;
    }

    /* H1 — 1.8rem */
    .site-title h1 {
        font-size: 1.8rem;
        line-height: 1.15;
        letter-spacing: 0.3px;
        text-shadow:
            0 1px 0 #b8941f,
            0 2px 0 #a88317,
            0 3px 5px rgba(0, 0, 0, 0.5),
            0 0 20px rgba(255, 215, 0, 0.4);
    }

    /* АНО — 1rem */
    .site-title p {
        font-size: 1rem;
    }

    .site-title p + p {
        display: none;
    }

    .top-bar-link,
    .top-bar-btn { padding: 5px 8px; font-size: 0.78rem; }
}

/* -------- 360px: узкий мобильный -------- */
@media (max-width: 360px) {
    .top-bar { padding: 4px 0; }
    .top-bar .container { justify-content: center; gap: 6px; }
    .top-bar-left { display: none; }
    .top-bar-right { justify-content: center; gap: 4px; }
    .top-bar-link,
    .top-bar-btn {
        padding: 4px 7px;
        font-size: 0.72rem;
        min-width: 34px;
        justify-content: center;
    }
    .top-bar-link i,
    .top-bar-btn i { font-size: 0.9rem; }

    .logo-area { padding: 14px 10px 12px; }
    .logo-area .container { gap: 8px; }

    /* ЛОГОТИП 96×96 */
    .logo-area img.logo-left {
        height: 96px;
        max-width: 96px;
    }

    /* Бургер 40×40 */
    .mobile-menu-toggle {
        top: 8px;
        right: 8px;
        width: 40px;
        height: 40px;
        padding: 9px 7px;
    }

    /* H1 — 1.5rem */
    .site-title h1 {
        font-size: 1.5rem;
        line-height: 1.15;
        letter-spacing: 0.2px;
        text-shadow:
            0 1px 0 #b8941f,
            0 2px 4px rgba(0, 0, 0, 0.5),
            0 0 18px rgba(255, 215, 0, 0.35);
    }

    /* АНО — 0.95rem */
    .site-title p {
        font-size: 0.95rem;
        line-height: 1.25;
        margin-top: 5px;
    }

    .site-title p + p { display: none; }

    .menu-row > li > a { padding: 13px 18px; font-size: 0.98rem; }
    .dropdown-menu li a { padding: 11px 26px; font-size: 0.9rem; }

    .georgian-ribbon { height: 8px; }
}

/* ============================================================
   СНИЖЕННАЯ АНИМАЦИЯ
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    .logo-area::after,
    .georgian-ribbon::after { animation: none !important; }
    .dropdown-menu,
    .top-bar-link,
    .top-bar-btn,
    .logo-area img.logo-left,
    .mobile-menu-toggle span,
    .skip-link { transition: none !important; }
}

/* ============================================================
   ПЕЧАТЬ
   ============================================================ */
@media print {
    .top-bar,
    .main-menu,
    .mobile-menu-toggle,
    .georgian-ribbon,
    .logo-area::before,
    .logo-area::after { display: none !important; }
    .logo-area { background: white !important; }
    .site-title h1 {
        font-family: 'Times New Roman', Times, Georgia, serif !important;
        color: black !important;
        text-shadow: none !important;
    }
    .site-title p {
        font-family: 'Times New Roman', Times, Georgia, serif !important;
        color: #333 !important;
        text-shadow: none !important;
    }
    .skip-link { display: none !important; }
}